private void xmlWriteManifest(JarPackageData jarPackage, Document document, Element xmlJarDesc) throws DOMException { Element manifest= document.createElement("manifest"); //$NON-NLS-1$ xmlJarDesc.appendChild(manifest); manifest.setAttribute("manifestVersion", jarPackage.getManifestVersion()); //$NON-NLS-1$ manifest.setAttribute("usesManifest", "" + jarPackage.usesManifest()); //$NON-NLS-2$ //$NON-NLS-1$ manifest.setAttribute("reuseManifest", "" + jarPackage.isManifestReused()); //$NON-NLS-2$ //$NON-NLS-1$ manifest.setAttribute("saveManifest", "" + jarPackage.isManifestSaved()); //$NON-NLS-2$ //$NON-NLS-1$ manifest.setAttribute("generateManifest", "" + jarPackage.isManifestGenerated()); //$NON-NLS-2$ //$NON-NLS-1$ manifest.setAttribute("manifestLocation", jarPackage.getManifestLocation().toPortableString()); //$NON-NLS-1$ if (jarPackage.getManifestMainClass() != null) manifest.setAttribute("mainClassHandleIdentifier", jarPackage.getManifestMainClass().getHandleIdentifier()); //$NON-NLS-1$ xmlWriteSealingInfo(jarPackage, document, manifest); }
private void xmlWriteManifest(JarPackageData jarPackage, Document document, Element xmlJarDesc) throws DOMException { Element manifest= document.createElement("manifest"); //$NON-NLS-1$ xmlJarDesc.appendChild(manifest); manifest.setAttribute("manifestVersion", jarPackage.getManifestVersion()); //$NON-NLS-1$ manifest.setAttribute("usesManifest", "" + jarPackage.usesManifest()); //$NON-NLS-2$ //$NON-NLS-1$ manifest.setAttribute("reuseManifest", "" + jarPackage.isManifestReused()); //$NON-NLS-2$ //$NON-NLS-1$ manifest.setAttribute("saveManifest", "" + jarPackage.isManifestSaved()); //$NON-NLS-2$ //$NON-NLS-1$ manifest.setAttribute("generateManifest", "" + jarPackage.isManifestGenerated()); //$NON-NLS-2$ //$NON-NLS-1$ manifest.setAttribute("manifestLocation", jarPackage.getManifestLocation().toPortableString()); //$NON-NLS-1$ if (jarPackage.getManifestMainClass() != null) manifest.setAttribute("mainClassHandleIdentifier", jarPackage.getManifestMainClass().getHandleIdentifier()); //$NON-NLS-1$ xmlWriteSealingInfo(jarPackage, document, manifest); }
private void xmlWriteManifest(JarPackageData jarPackage, Document document, Element xmlJarDesc) throws DOMException { Element manifest= document.createElement("manifest"); //$NON-NLS-1$ xmlJarDesc.appendChild(manifest); manifest.setAttribute("manifestVersion", jarPackage.getManifestVersion()); //$NON-NLS-1$ manifest.setAttribute("usesManifest", "" + jarPackage.usesManifest()); //$NON-NLS-2$ //$NON-NLS-1$ manifest.setAttribute("reuseManifest", "" + jarPackage.isManifestReused()); //$NON-NLS-2$ //$NON-NLS-1$ manifest.setAttribute("saveManifest", "" + jarPackage.isManifestSaved()); //$NON-NLS-2$ //$NON-NLS-1$ manifest.setAttribute("generateManifest", "" + jarPackage.isManifestGenerated()); //$NON-NLS-2$ //$NON-NLS-1$ manifest.setAttribute("manifestLocation", jarPackage.getManifestLocation().toPortableString()); //$NON-NLS-1$ if (jarPackage.getManifestMainClass() != null) manifest.setAttribute("mainClassHandleIdentifier", jarPackage.getManifestMainClass().getHandleIdentifier()); //$NON-NLS-1$ xmlWriteSealingInfo(jarPackage, document, manifest); }
/** * Hook method for restoring widget values to the values that they held * last time this wizard was used to completion. */ protected void restoreWidgetValues() { if (!((JarPackageWizard)getWizard()).isInitializingFromJarPackage()) initializeJarPackage(); // Manifest creation if (fJarPackage.isManifestGenerated()) fGenerateManifestRadioButton.setSelection(true); else fUseManifestRadioButton.setSelection(true); fSaveManifestCheckbox.setSelection(fJarPackage.isManifestSaved()); fReuseManifestCheckbox.setSelection(fJarPackage.isManifestReused()); fManifestFileText.setText(fJarPackage.getManifestLocation().toString()); fNewManifestFileText.setText(fJarPackage.getManifestLocation().toString()); // Sealing if (fJarPackage.isJarSealed()) fSealJarRadioButton.setSelection(true); else fSealPackagesRadioButton.setSelection(true); // Main-Class fMainClassText.setText(JarPackagerUtil.getMainClassName(fJarPackage)); } /**
/** * Hook method for restoring widget values to the values that they held * last time this wizard was used to completion. */ protected void restoreWidgetValues() { if (!((JarPackageWizard)getWizard()).isInitializingFromJarPackage()) initializeJarPackage(); // Manifest creation if (fJarPackage.isManifestGenerated()) fGenerateManifestRadioButton.setSelection(true); else fUseManifestRadioButton.setSelection(true); fSaveManifestCheckbox.setSelection(fJarPackage.isManifestSaved()); fReuseManifestCheckbox.setSelection(fJarPackage.isManifestReused()); fManifestFileText.setText(fJarPackage.getManifestLocation().toString()); fNewManifestFileText.setText(fJarPackage.getManifestLocation().toString()); // Sealing if (fJarPackage.isJarSealed()) fSealJarRadioButton.setSelection(true); else fSealPackagesRadioButton.setSelection(true); // Main-Class fMainClassText.setText(JarPackagerUtil.getMainClassName(fJarPackage)); } /**
/** * Hook method for restoring widget values to the values that they held * last time this wizard was used to completion. */ protected void restoreWidgetValues() { if (!((JarPackageWizard)getWizard()).isInitializingFromJarPackage()) initializeJarPackage(); // Manifest creation if (fJarPackage.isManifestGenerated()) fGenerateManifestRadioButton.setSelection(true); else fUseManifestRadioButton.setSelection(true); fSaveManifestCheckbox.setSelection(fJarPackage.isManifestSaved()); fReuseManifestCheckbox.setSelection(fJarPackage.isManifestReused()); fManifestFileText.setText(fJarPackage.getManifestLocation().toString()); fNewManifestFileText.setText(fJarPackage.getManifestLocation().toString()); // Sealing if (fJarPackage.isJarSealed()) fSealJarRadioButton.setSelection(true); else fSealPackagesRadioButton.setSelection(true); // Main-Class fMainClassText.setText(JarPackagerUtil.getMainClassName(fJarPackage)); } /**
fUseManifestRadioButton.setSelection(true); fSaveManifestCheckbox.setSelection(fJarPackage.isManifestSaved()); fReuseManifestCheckbox.setSelection(fJarPackage.isManifestReused()); fManifestFileText.setText(fJarPackage.getManifestLocation().toString()); fNewManifestFileText.setText(fJarPackage.getManifestLocation().toString());
protected void saveDescription() throws CoreException, IOException { // Adjust JAR package attributes if (fJarPackage.isManifestReused()) fJarPackage.setGenerateManifest(false); ByteArrayOutputStream objectStreamOutput= new ByteArrayOutputStream(); IJarDescriptionWriter writer= fJarPackage.createJarDescriptionWriter(objectStreamOutput); ByteArrayInputStream fileInput= null; try { writer.write(fJarPackage); fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray()); IFile descriptionFile= fJarPackage.getDescriptionFile(); if (descriptionFile.isAccessible()) { // AspectJ Change Begin if (fJarPackage.allowOverwrite() || AJJarPackagerUtil.askForOverwritePermission(fParentShell, descriptionFile.getFullPath().toString())) // AspectJ Change End descriptionFile.setContents(fileInput, true, true, null); } else descriptionFile.create(fileInput, true, null); } finally { if (fileInput != null) fileInput.close(); if (writer != null) writer.close(); } }
private void saveDescription() throws CoreException, IOException { // Adjust JAR package attributes if (fJarPackage.isManifestReused()) fJarPackage.setGenerateManifest(false); ByteArrayOutputStream objectStreamOutput= new ByteArrayOutputStream(); IFile descriptionFile= fJarPackage.getDescriptionFile(); String encoding= "UTF-8"; //$NON-NLS-1$ try { encoding= descriptionFile.getCharset(true); } catch (CoreException exception) { JavaPlugin.log(exception); } IJarDescriptionWriter writer= fJarPackage.createJarDescriptionWriter(objectStreamOutput, encoding); ByteArrayInputStream fileInput= null; try { writer.write(fJarPackage); fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray()); if (descriptionFile.isAccessible()) { if (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, descriptionFile.getFullPath().toString())) descriptionFile.setContents(fileInput, true, true, null); } else descriptionFile.create(fileInput, true, null); } finally { if (fileInput != null) fileInput.close(); if (writer != null) writer.close(); } }
private void saveDescription() throws CoreException, IOException { // Adjust JAR package attributes if (fJarPackage.isManifestReused()) fJarPackage.setGenerateManifest(false); ByteArrayOutputStream objectStreamOutput= new ByteArrayOutputStream(); IFile descriptionFile= fJarPackage.getDescriptionFile(); String encoding= "UTF-8"; //$NON-NLS-1$ try { encoding= descriptionFile.getCharset(true); } catch (CoreException exception) { JavaPlugin.log(exception); } IJarDescriptionWriter writer= fJarPackage.createJarDescriptionWriter(objectStreamOutput, encoding); ByteArrayInputStream fileInput= null; try { writer.write(fJarPackage); fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray()); if (descriptionFile.isAccessible()) { if (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, descriptionFile.getFullPath(), false)) descriptionFile.setContents(fileInput, true, true, null); } else descriptionFile.create(fileInput, true, null); } finally { if (fileInput != null) fileInput.close(); if (writer != null) writer.close(); } }
private void saveDescription() throws CoreException, IOException { // Adjust JAR package attributes if (fJarPackage.isManifestReused()) fJarPackage.setGenerateManifest(false); ByteArrayOutputStream objectStreamOutput= new ByteArrayOutputStream(); IFile descriptionFile= fJarPackage.getDescriptionFile(); String encoding= "UTF-8"; //$NON-NLS-1$ try { encoding= descriptionFile.getCharset(true); } catch (CoreException exception) { JavaPlugin.log(exception); } IJarDescriptionWriter writer= fJarPackage.createJarDescriptionWriter(objectStreamOutput, encoding); ByteArrayInputStream fileInput= null; try { writer.write(fJarPackage); fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray()); if (descriptionFile.isAccessible()) { if (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, descriptionFile.getFullPath(), false)) descriptionFile.setContents(fileInput, true, true, null); } else descriptionFile.create(fileInput, true, null); } finally { if (fileInput != null) fileInput.close(); if (writer != null) writer.close(); } }
/** * Persists resource specification control setting that are to be restored * in the next instance of this page. Subclasses wishing to persist * settings for their controls should extend the hook method * <code>internalSaveWidgetValues</code>. */ public final void saveWidgetValues() { IDialogSettings settings= getDialogSettings(); if (settings != null) { // Manifest creation settings.put(STORE_GENERATE_MANIFEST, fJarPackage.isManifestGenerated()); settings.put(STORE_SAVE_MANIFEST, fJarPackage.isManifestSaved()); settings.put(STORE_REUSE_MANIFEST, fJarPackage.isManifestReused()); settings.put(STORE_MANIFEST_LOCATION, fJarPackage.getManifestLocation().toString()); // Sealing settings.put(STORE_SEAL_JAR, fJarPackage.isJarSealed()); } // Allow subclasses to save values internalSaveWidgetValues(); } /**
/** * Persists resource specification control setting that are to be restored * in the next instance of this page. Subclasses wishing to persist * settings for their controls should extend the hook method * <code>internalSaveWidgetValues</code>. */ public final void saveWidgetValues() { IDialogSettings settings= getDialogSettings(); if (settings != null) { // Manifest creation settings.put(STORE_GENERATE_MANIFEST, fJarPackage.isManifestGenerated()); settings.put(STORE_SAVE_MANIFEST, fJarPackage.isManifestSaved()); settings.put(STORE_REUSE_MANIFEST, fJarPackage.isManifestReused()); settings.put(STORE_MANIFEST_LOCATION, fJarPackage.getManifestLocation().toString()); // Sealing settings.put(STORE_SEAL_JAR, fJarPackage.isJarSealed()); } // Allow subclasses to save values internalSaveWidgetValues(); } /**
/** * Persists resource specification control setting that are to be restored * in the next instance of this page. Subclasses wishing to persist * settings for their controls should extend the hook method * <code>internalSaveWidgetValues</code>. */ public final void saveWidgetValues() { IDialogSettings settings= getDialogSettings(); if (settings != null) { // Manifest creation settings.put(STORE_GENERATE_MANIFEST, fJarPackage.isManifestGenerated()); settings.put(STORE_SAVE_MANIFEST, fJarPackage.isManifestSaved()); settings.put(STORE_REUSE_MANIFEST, fJarPackage.isManifestReused()); settings.put(STORE_MANIFEST_LOCATION, fJarPackage.getManifestLocation().toString()); // Sealing settings.put(STORE_SEAL_JAR, fJarPackage.isJarSealed()); } // Allow subclasses to save values internalSaveWidgetValues(); } /**
/** * Persists resource specification control setting that are to be restored * in the next instance of this page. Subclasses wishing to persist * settings for their controls should extend the hook method * <code>internalSaveWidgetValues</code>. */ public final void saveWidgetValues() { IDialogSettings settings= getDialogSettings(); if (settings != null) { // Manifest creation settings.put(STORE_GENERATE_MANIFEST, fJarPackage.isManifestGenerated()); settings.put(STORE_SAVE_MANIFEST, fJarPackage.isManifestSaved()); settings.put(STORE_REUSE_MANIFEST, fJarPackage.isManifestReused()); settings.put(STORE_MANIFEST_LOCATION, fJarPackage.getManifestLocation().toString()); // Sealing settings.put(STORE_SEAL_JAR, fJarPackage.isJarSealed()); } // Allow subclasses to save values internalSaveWidgetValues(); } /**