/** * Tells whether a manifest is available. * * @return <code>true</code> if the manifest is generated or the provided one is accessible */ public boolean isManifestAccessible() { if (isManifestGenerated()) return true; IFile file= getManifestFile(); return file != null && file.isAccessible(); }
/** * Tells whether a manifest is available. * * @return <code>true</code> if the manifest is generated or the provided one is accessible */ public boolean isManifestAccessible() { if (isManifestGenerated()) return true; IFile file= getManifestFile(); return file != null && file.isAccessible(); }
/** * Tells whether a manifest is available. * * @return <code>true</code> if the manifest is generated or the provided one is accessible */ public boolean isManifestAccessible() { if (isManifestGenerated()) return true; IFile file= getManifestFile(); return file != null && file.isAccessible(); }
private Manifest createOwn(JarPackageData jarPackage) throws CoreException { if (jarPackage.isManifestGenerated()) return createGeneratedManifest(jarPackage); try { return createSuppliedManifest(jarPackage); } catch (IOException ex) { throw JarPackagerUtil.createCoreException(ex.getLocalizedMessage(), ex); } }
private Manifest createOwn(JarPackageData jarPackage) throws CoreException { if (jarPackage.isManifestGenerated()) return createGeneratedManifest(jarPackage); try { return createSuppliedManifest(jarPackage); } catch (IOException ex) { throw JarPackagerUtil.createCoreException(ex.getLocalizedMessage(), ex); } }
/** * Creates a manifest as defined by the <code>JarPackage</code>. * * @param jarPackage the JAR package specification */ public Manifest create(JarPackageData jarPackage) throws CoreException { Assert.isNotNull(jarPackage); if (jarPackage.isManifestGenerated()) return createGeneratedManifest(jarPackage); try { return createSuppliedManifest(jarPackage); } catch (IOException ex) { throw JarPackagerUtil.createCoreException(ex.getLocalizedMessage(), ex); } }
/** * Creates a manifest as defined by the <code>JarPackage</code>. * * @param jarPackage the JAR package specification * @return the manifest * @throws CoreException */ @Override public Manifest create(JarPackageData jarPackage) throws CoreException { Assert.isNotNull(jarPackage); if (jarPackage.isManifestGenerated()) return createGeneratedManifest(jarPackage); try { return createSuppliedManifest(jarPackage); } catch (IOException ex) { throw JarPackagerUtil.createCoreException(ex.getLocalizedMessage(), ex); } }
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); }
/** * Creates a manifest as defined by the <code>JarPackage</code>. * * @param jarPackage the JAR package specification * @return the manifest * @throws CoreException */ @Override public Manifest create(JarPackageData jarPackage) throws CoreException { Assert.isNotNull(jarPackage); if (jarPackage.isManifestGenerated()) return createGeneratedManifest(jarPackage); try { return createSuppliedManifest(jarPackage); } catch (IOException ex) { throw JarPackagerUtil.createCoreException(ex.getLocalizedMessage(), ex); } }
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); }
/** * 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()); } /**
/** * 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)); } /**
/** * 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()); } /**
/** * 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(); } /**
private void saveFiles() { // Save the manifest if (fJarPackage.areGeneratedFilesExported() && fJarPackage.isManifestGenerated() && fJarPackage.isManifestSaved()) { try { saveManifest(); } catch (CoreException ex) { addError(JarPackagerMessages.JarFileExportOperation_errorSavingManifest, ex); } catch (IOException ex) { addError(JarPackagerMessages.JarFileExportOperation_errorSavingManifest, ex); } } // Save the description if (fJarPackage.isDescriptionSaved()) { try { saveDescription(); } catch (CoreException ex) { addError(JarPackagerMessages.JarFileExportOperation_errorSavingDescription, ex); } catch (IOException ex) { addError(JarPackagerMessages.JarFileExportOperation_errorSavingDescription, ex); } } }
private void saveFiles() { // Save the manifest if (fJarPackage.areGeneratedFilesExported() && fJarPackage.isManifestGenerated() && fJarPackage.isManifestSaved()) { try { saveManifest(); } catch (CoreException ex) { addError(JarPackagerMessages.JarFileExportOperation_errorSavingManifest, ex); } catch (IOException ex) { addError(JarPackagerMessages.JarFileExportOperation_errorSavingManifest, ex); } } // Save the description if (fJarPackage.isDescriptionSaved()) { try { saveDescription(); } catch (CoreException ex) { addError(JarPackagerMessages.JarFileExportOperation_errorSavingDescription, ex); } catch (IOException ex) { addError(JarPackagerMessages.JarFileExportOperation_errorSavingDescription, ex); } } }