/** * Gets the manifest file (as workspace resource). * * @return a file which points to the manifest */ public IFile getManifestFile() { IPath path= getManifestLocation(); if (path.isValidPath(path.toString()) && path.segmentCount() >= 2) return JavaPlugin.getWorkspace().getRoot().getFile(path); else return null; }
/** * Gets the manifest file (as workspace resource). * * @return a file which points to the manifest */ public IFile getManifestFile() { IPath path= getManifestLocation(); if (path.isValidPath(path.toString()) && path.segmentCount() >= 2) return JavaPlugin.getWorkspace().getRoot().getFile(path); else return null; }
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); }
/** * Gets the manifest file (as workspace resource). * * @return a file which points to the manifest */ public IFile getManifestFile() { IPath path= getManifestLocation(); if (path.isValidPath(path.toString()) && path.segmentCount() >= 2) return JavaPlugin.getWorkspace().getRoot().getFile(path); else return null; }
/** * 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)); } /**
fSaveManifestCheckbox.setSelection(fJarPackage.isManifestSaved()); fReuseManifestCheckbox.setSelection(fJarPackage.isManifestReused()); fManifestFileText.setText(fJarPackage.getManifestLocation().toString()); fNewManifestFileText.setText(fJarPackage.getManifestLocation().toString());
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); }
protected void handleManifestFileBrowseButtonPressed() { ElementTreeSelectionDialog dialog= createWorkspaceFileSelectionDialog(JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_title, JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_message); if (fJarPackage.isManifestAccessible()) dialog.setInitialSelections(new IResource[] {fJarPackage.getManifestFile()}); if (dialog.open() == Window.OK) { Object[] resources= dialog.getResult(); if (resources.length != 1) setErrorMessage(JarPackagerMessages.JarManifestWizardPage_error_onlyOneManifestMustBeSelected); else { setErrorMessage(""); //$NON-NLS-1$ fJarPackage.setManifestLocation(((IResource)resources[0]).getFullPath()); fManifestFileText.setText(fJarPackage.getManifestLocation().toString()); } } }
protected void handleManifestFileBrowseButtonPressed() { ElementTreeSelectionDialog dialog= createWorkspaceFileSelectionDialog(JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_title, JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_message); if (fJarPackage.isManifestAccessible()) dialog.setInitialSelections(new IResource[] {fJarPackage.getManifestFile()}); if (dialog.open() == Window.OK) { Object[] resources= dialog.getResult(); if (resources.length != 1) setErrorMessage(JarPackagerMessages.JarManifestWizardPage_error_onlyOneManifestMustBeSelected); else { setErrorMessage(""); //$NON-NLS-1$ fJarPackage.setManifestLocation(((IResource)resources[0]).getFullPath()); fManifestFileText.setText(fJarPackage.getManifestLocation().toString()); } } }
protected void handleManifestFileBrowseButtonPressed() { ElementTreeSelectionDialog dialog= createWorkspaceFileSelectionDialog(JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_title, JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_message); if (fJarPackage.isManifestAccessible()) dialog.setInitialSelections(new IResource[] {fJarPackage.getManifestFile()}); if (dialog.open() == Window.OK) { Object[] resources= dialog.getResult(); if (resources.length != 1) setErrorMessage(JarPackagerMessages.JarManifestWizardPage_error_onlyOneManifestMustBeSelected); else { setErrorMessage(""); //$NON-NLS-1$ fJarPackage.setManifestLocation(((IResource)resources[0]).getFullPath()); fManifestFileText.setText(fJarPackage.getManifestLocation().toString()); } } }
/** * Open an appropriate dialog so that the user can specify a manifest * to save */ protected void handleNewManifestFileBrowseButtonPressed() { // Use Save As dialog to select a new file inside the workspace SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getManifestLocation())); if (dialog.open() == Window.OK) { fJarPackage.setManifestLocation(dialog.getResult()); fNewManifestFileText.setText(dialog.getResult().toString()); } }
/** * Open an appropriate dialog so that the user can specify a manifest * to save */ protected void handleNewManifestFileBrowseButtonPressed() { // Use Save As dialog to select a new file inside the workspace SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getManifestLocation())); if (dialog.open() == Window.OK) { fJarPackage.setManifestLocation(dialog.getResult()); fNewManifestFileText.setText(dialog.getResult().toString()); } }
protected void handleManifestFileBrowseButtonPressed() { ElementTreeSelectionDialog dialog= createWorkspaceFileSelectionDialog(JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_title, JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_message); if (fJarPackage.isManifestAccessible()) dialog.setInitialSelections(fJarPackage.getManifestFile()); if (dialog.open() == Window.OK) { Object[] resources= dialog.getResult(); if (resources.length != 1) setErrorMessage(JarPackagerMessages.JarManifestWizardPage_error_onlyOneManifestMustBeSelected); else { setErrorMessage(""); //$NON-NLS-1$ fJarPackage.setManifestLocation(((IResource)resources[0]).getFullPath()); fManifestFileText.setText(fJarPackage.getManifestLocation().toString()); } } }
/** * Open an appropriate dialog so that the user can specify a manifest * to save */ protected void handleNewManifestFileBrowseButtonPressed() { // Use Save As dialog to select a new file inside the workspace SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getManifestLocation())); if (dialog.open() == Window.OK) { fJarPackage.setManifestLocation(dialog.getResult()); fNewManifestFileText.setText(dialog.getResult().toString()); } }
/** * Open an appropriate dialog so that the user can specify a manifest * to save */ protected void handleNewManifestFileBrowseButtonPressed() { // Use Save As dialog to select a new file inside the workspace SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getManifestLocation())); if (dialog.open() == Window.OK) { fJarPackage.setManifestLocation(dialog.getResult()); fNewManifestFileText.setText(dialog.getResult().toString()); } }
/** * 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(); } /**