/** * Stores the widget values in the JAR package. */ protected void updateModel() { if (getControl() == null) return; // Manifest creation fJarPackage.setGenerateManifest(fGenerateManifestRadioButton.getSelection()); fJarPackage.setSaveManifest(fSaveManifestCheckbox.getSelection()); fJarPackage.setReuseManifest(fReuseManifestCheckbox.getSelection()); String path; if (fJarPackage.isManifestGenerated()) path= fNewManifestFileText.getText(); else path= fManifestFileText.getText(); if (path == null) path= ""; //$NON-NLS-1$ fJarPackage.setManifestLocation(new Path(path)); // Sealing fJarPackage.setSealJar(fSealJarRadioButton.getSelection()); } /**
/** * Stores the widget values in the JAR package. */ protected void updateModel() { if (getControl() == null) return; // Manifest creation fJarPackage.setGenerateManifest(fGenerateManifestRadioButton.getSelection()); fJarPackage.setSaveManifest(fSaveManifestCheckbox.getSelection()); fJarPackage.setReuseManifest(fReuseManifestCheckbox.getSelection()); String path; if (fJarPackage.isManifestGenerated()) path= fNewManifestFileText.getText(); else path= fManifestFileText.getText(); if (path == null) path= ""; //$NON-NLS-1$ fJarPackage.setManifestLocation(new Path(path)); // Sealing fJarPackage.setSealJar(fSealJarRadioButton.getSelection()); } /**
/** * Stores the widget values in the JAR package. */ protected void updateModel() { if (getControl() == null) return; // Manifest creation fJarPackage.setGenerateManifest(fGenerateManifestRadioButton.getSelection()); fJarPackage.setSaveManifest(fSaveManifestCheckbox.getSelection()); fJarPackage.setReuseManifest(fJarPackage.isManifestSaved() && fReuseManifestCheckbox.getSelection()); String path; if (fJarPackage.isManifestGenerated()) path= fNewManifestFileText.getText(); else path= fManifestFileText.getText(); if (path == null) path= ""; //$NON-NLS-1$ fJarPackage.setManifestLocation(new Path(path)); // Sealing fJarPackage.setSealJar(fSealJarRadioButton.getSelection()); } /**
/** * Stores the widget values in the JAR package. */ protected void updateModel() { if (getControl() == null) return; // Manifest creation fJarPackage.setGenerateManifest(fGenerateManifestRadioButton.getSelection()); fJarPackage.setSaveManifest(fSaveManifestCheckbox.getSelection()); fJarPackage.setReuseManifest(fJarPackage.isManifestSaved() && fReuseManifestCheckbox.getSelection()); String path; if (fJarPackage.isManifestGenerated()) path= fNewManifestFileText.getText(); else path= fManifestFileText.getText(); if (path == null) path= ""; //$NON-NLS-1$ fJarPackage.setManifestLocation(new Path(path)); // Sealing fJarPackage.setSealJar(fSealJarRadioButton.getSelection()); } /**
private void xmlReadManifest(JarPackageData jarPackage, Element element) throws java.io.IOException { if (element.getNodeName().equals("manifest")) { //$NON-NLS-1$ jarPackage.setManifestVersion(element.getAttribute("manifestVersion")); //$NON-NLS-1$ jarPackage.setUsesManifest(getBooleanAttribute(element, "usesManifest")); //$NON-NLS-1$ jarPackage.setReuseManifest(getBooleanAttribute(element, "reuseManifest")); //$NON-NLS-1$ jarPackage.setSaveManifest(getBooleanAttribute(element,"saveManifest")); //$NON-NLS-1$ jarPackage.setGenerateManifest(getBooleanAttribute(element, "generateManifest")); //$NON-NLS-1$ jarPackage.setManifestLocation(Path.fromPortableString(element.getAttribute("manifestLocation"))); //$NON-NLS-1$ jarPackage.setManifestMainClass(getMainClass(element)); xmlReadSealingInfo(jarPackage, element); } }
private void xmlReadManifest(JarPackageData jarPackage, Element element) throws java.io.IOException { if (element.getNodeName().equals("manifest")) { //$NON-NLS-1$ jarPackage.setManifestVersion(element.getAttribute("manifestVersion")); //$NON-NLS-1$ jarPackage.setUsesManifest(getBooleanAttribute(element, "usesManifest")); //$NON-NLS-1$ jarPackage.setReuseManifest(getBooleanAttribute(element, "reuseManifest")); //$NON-NLS-1$ jarPackage.setSaveManifest(getBooleanAttribute(element,"saveManifest")); //$NON-NLS-1$ jarPackage.setGenerateManifest(getBooleanAttribute(element, "generateManifest")); //$NON-NLS-1$ jarPackage.setManifestLocation(Path.fromPortableString(element.getAttribute("manifestLocation"))); //$NON-NLS-1$ jarPackage.setManifestMainClass(getMainClass(element)); xmlReadSealingInfo(jarPackage, element); } }
private void xmlReadManifest(JarPackageData jarPackage, Element element) throws java.io.IOException { if (element.getNodeName().equals("manifest")) { //$NON-NLS-1$ jarPackage.setManifestVersion(element.getAttribute("manifestVersion")); //$NON-NLS-1$ jarPackage.setUsesManifest(getBooleanAttribute(element, "usesManifest")); //$NON-NLS-1$ jarPackage.setReuseManifest(getBooleanAttribute(element, "reuseManifest")); //$NON-NLS-1$ jarPackage.setSaveManifest(getBooleanAttribute(element,"saveManifest")); //$NON-NLS-1$ jarPackage.setGenerateManifest(getBooleanAttribute(element, "generateManifest")); //$NON-NLS-1$ jarPackage.setManifestLocation(Path.fromPortableString(element.getAttribute("manifestLocation"))); //$NON-NLS-1$ jarPackage.setManifestMainClass(getMainClass(element)); xmlReadSealingInfo(jarPackage, element); } }
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(); } }
/** * Initializes the JAR package from last used wizard page values. */ protected void initializeJarPackage() { IDialogSettings settings= getDialogSettings(); if (settings != null) { // Manifest creation fJarPackage.setGenerateManifest(settings.getBoolean(STORE_GENERATE_MANIFEST)); fJarPackage.setSaveManifest(settings.getBoolean(STORE_SAVE_MANIFEST)); fJarPackage.setReuseManifest(settings.getBoolean(STORE_REUSE_MANIFEST)); String pathStr= settings.get(STORE_MANIFEST_LOCATION); if (pathStr == null) pathStr= ""; //$NON-NLS-1$ fJarPackage.setManifestLocation(new Path(pathStr)); // Sealing fJarPackage.setSealJar(settings.getBoolean(STORE_SEAL_JAR)); } } /**
/** * Initializes the JAR package from last used wizard page values. */ protected void initializeJarPackage() { IDialogSettings settings= getDialogSettings(); if (settings != null) { // Manifest creation fJarPackage.setGenerateManifest(settings.getBoolean(STORE_GENERATE_MANIFEST)); fJarPackage.setSaveManifest(settings.getBoolean(STORE_SAVE_MANIFEST)); fJarPackage.setReuseManifest(settings.getBoolean(STORE_REUSE_MANIFEST)); String pathStr= settings.get(STORE_MANIFEST_LOCATION); if (pathStr == null) pathStr= ""; //$NON-NLS-1$ fJarPackage.setManifestLocation(new Path(pathStr)); // Sealing fJarPackage.setSealJar(settings.getBoolean(STORE_SEAL_JAR)); } } /**
/** * Initializes the JAR package from last used wizard page values. */ protected void initializeJarPackage() { IDialogSettings settings= getDialogSettings(); if (settings != null) { // Manifest creation fJarPackage.setGenerateManifest(settings.getBoolean(STORE_GENERATE_MANIFEST)); fJarPackage.setSaveManifest(settings.getBoolean(STORE_SAVE_MANIFEST)); fJarPackage.setReuseManifest(settings.getBoolean(STORE_REUSE_MANIFEST)); String pathStr= settings.get(STORE_MANIFEST_LOCATION); if (pathStr == null) pathStr= ""; //$NON-NLS-1$ fJarPackage.setManifestLocation(new Path(pathStr)); // Sealing fJarPackage.setSealJar(settings.getBoolean(STORE_SEAL_JAR)); } } /**
/** * Initializes the JAR package from last used wizard page values. */ protected void initializeJarPackage() { IDialogSettings settings= getDialogSettings(); if (settings != null) { // Manifest creation fJarPackage.setGenerateManifest(settings.getBoolean(STORE_GENERATE_MANIFEST)); fJarPackage.setSaveManifest(settings.getBoolean(STORE_SAVE_MANIFEST)); fJarPackage.setReuseManifest(settings.getBoolean(STORE_REUSE_MANIFEST)); String pathStr= settings.get(STORE_MANIFEST_LOCATION); if (pathStr == null) pathStr= ""; //$NON-NLS-1$ fJarPackage.setManifestLocation(new Path(pathStr)); // Sealing fJarPackage.setSealJar(settings.getBoolean(STORE_SEAL_JAR)); } } /**
/** * Creates a new Jar Package Data structure */ public JarPackageData() { setExportClassFiles(true); setExportOutputFolders(false); setUseSourceFolderHierarchy(false); setCompress(true); setSaveDescription(false); setJarLocation(Path.EMPTY); setDescriptionLocation(Path.EMPTY); setUsesManifest(true); setGenerateManifest(true); setReuseManifest(false); setSaveManifest(false); setManifestLocation(Path.EMPTY); setExportErrors(true); setExportWarnings(true); setBuildIfNeeded(true); setIncludeDirectoryEntries(false); }
/** * Creates a new Jar Package Data structure */ public JarPackageData() { setExportClassFiles(true); setExportOutputFolders(false); setUseSourceFolderHierarchy(false); setCompress(true); setSaveDescription(false); setJarLocation(Path.EMPTY); setDescriptionLocation(Path.EMPTY); setUsesManifest(true); setGenerateManifest(true); setReuseManifest(false); setSaveManifest(false); setManifestLocation(Path.EMPTY); setExportErrors(true); setExportWarnings(true); setBuildIfNeeded(true); setIncludeDirectoryEntries(false); }
/** * Creates a new Jar Package Data structure */ public JarPackageData() { setExportClassFiles(true); setExportOutputFolders(false); setUseSourceFolderHierarchy(false); setCompress(true); setSaveDescription(false); setJarLocation(Path.EMPTY); setDescriptionLocation(Path.EMPTY); setUsesManifest(true); setGenerateManifest(true); setReuseManifest(false); setSaveManifest(false); setManifestLocation(Path.EMPTY); setExportErrors(true); setExportWarnings(true); setBuildIfNeeded(true); setIncludeDirectoryEntries(false); }