Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 164160 Details for
Bug 190711
[target] Add ability to export the artifacts for a target
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Target export wizard
org.eclipse.pde.ui.patch (text/plain), 23.41 KB, created by
Ian Bull
on 2010-04-07 22:00:18 EDT
(
hide
)
Description:
Target export wizard
Filename:
MIME Type:
Creator:
Ian Bull
Created:
2010-04-07 22:00:18 EDT
Size:
23.41 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.85 >diff -u -r1.85 MANIFEST.MF >--- META-INF/MANIFEST.MF 1 Apr 2010 21:30:55 -0000 1.85 >+++ META-INF/MANIFEST.MF 8 Apr 2010 01:56:55 -0000 >@@ -112,4 +112,5 @@ > Import-Package: com.ibm.icu.text, > org.eclipse.jdt.debug.core > Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Service-Component: OSGI-INF/component.xml > Bundle-ActivationPolicy: lazy >Index: OSGI-INF/component.xml >=================================================================== >RCS file: OSGI-INF/component.xml >diff -N OSGI-INF/component.xml >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ OSGI-INF/component.xml 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,5 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.pde.target"> >+ <implementation class="org.eclipse.pde.internal.ui.target.ExportTargetMetadata"/> >+ <reference bind="bind" cardinality="1..1" interface="org.eclipse.equinox.p2.core.IProvisioningAgent" name="IMetadataRepositoryManager" policy="static" unbind="unbind"/> >+</scr:component> >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/plugin.properties,v >retrieving revision 1.237 >diff -u -r1.237 plugin.properties >--- plugin.properties 31 Mar 2010 15:10:01 -0000 1.237 >+++ plugin.properties 8 Apr 2010 01:56:56 -0000 >@@ -77,6 +77,7 @@ > > PluginSearchPage.label = Plug-in Search > >+target.export.wizard.name=Target definition > PluginExportWizard.label=Deployable plug-ins and fragments > PluginExportWizard.description=Export the selected plug-ins and/or fragments \ > in a form suitable for deploying in an Eclipse product. >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/plugin.xml,v >retrieving revision 1.479 >diff -u -r1.479 plugin.xml >--- plugin.xml 31 Mar 2010 15:16:01 -0000 1.479 >+++ plugin.xml 8 Apr 2010 01:56:56 -0000 >@@ -36,6 +36,16 @@ > </perspective> > </extension> > <extension >+ point="org.eclipse.ui.exportWizards"> >+ <wizard >+ category="org.eclipse.pde.ui.PluginDevelopment" >+ class="org.eclipse.pde.internal.ui.target.TargetDefinitionExportWizard" >+ icon="icons/obj16/target_profile_xml_obj.gif" >+ id="org.eclipse.pde.target.wizard" >+ name="%target.export.wizard.name"> >+ </wizard> >+ </extension> >+ <extension > point="org.eclipse.ui.preferencePages"> > <page > name="%preferences.main.name" >Index: src/org/eclipse/pde/internal/ui/PDEUIMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java,v >retrieving revision 1.469 >diff -u -r1.469 PDEUIMessages.java >--- src/org/eclipse/pde/internal/ui/PDEUIMessages.java 1 Apr 2010 21:30:55 -0000 1.469 >+++ src/org/eclipse/pde/internal/ui/PDEUIMessages.java 8 Apr 2010 01:56:57 -0000 >@@ -1678,6 +1678,20 @@ > public static String CategorySection_newCategoryName; > public static String CategorySection_newCategoryLabel; > >+ // Target Export ######################################## >+ public static String ExportTargetDefinition_task; >+ public static String ExportTargetDeleteOldData; >+ public static String ExportTargetExportFeatures; >+ public static String ExportTargetExportPlugins; >+ public static String ExportActiveTargetDefinition; >+ public static String ExportTargetCurrentTarget; >+ public static String ExportTargetChooseFolder; >+ public static String ExportTargetBrowse; >+ public static String ExportTargetSelectDestination; >+ public static String ExportTargetSpecifyDestination; >+ public static String ExportTargetClearDestination; >+ public static String ExportTargetError_ChooseDestination; >+ > public static String CategoryDetails_title; > public static String CategoryDetails_sectionDescription; > public static String CategoryDetails_name; >Index: src/org/eclipse/pde/internal/ui/pderesources.properties >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties,v >retrieving revision 1.1128 >diff -u -r1.1128 pderesources.properties >--- src/org/eclipse/pde/internal/ui/pderesources.properties 1 Apr 2010 21:30:55 -0000 1.1128 >+++ src/org/eclipse/pde/internal/ui/pderesources.properties 8 Apr 2010 01:56:58 -0000 >@@ -1553,6 +1553,21 @@ > CategorySection_newCategoryName = new_category_{0} > CategorySection_newCategoryLabel = New Category {0} > >+######### Target Export Wizard ###################################33 >+ExportTargetDefinition_task = Exporting current target definition... >+ExportTargetDeleteOldData = Deleting old data... >+ExportTargetExportFeatures = Exporting features... >+ExportTargetExportPlugins = Exporting plugins... >+ExportActiveTargetDefinition = Export Active Target Definition >+ExportTargetCurrentTarget = Current Target Definition: >+ExportTargetChooseFolder = Folder >+ExportTargetBrowse = Browse... >+ExportTargetSelectDestination = Select Destination >+ExportTargetSpecifyDestination = Specify the destination folder for the current target >+ExportTargetClearDestination = Clear destination directory before exporting >+ExportTargetError_ChooseDestination = Please choose a destination directory" >+ >+ > CategoryDetails_title = Category Properties > CategoryDetails_sectionDescription = Provide a unique id, a name and a description for each category.\n\ > "*" denotes a required field. >Index: src/org/eclipse/pde/internal/ui/target/ExportActiveTargetJob.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/target/ExportActiveTargetJob.java >diff -N src/org/eclipse/pde/internal/ui/target/ExportActiveTargetJob.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/target/ExportActiveTargetJob.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,149 @@ >+/******************************************************************************* >+ * Copyright (c) 2009-2010 EclipseSource Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Chris Aniszczyk <zx@eclipsesource.com> - initial API and implementation >+ * Ian Bull <irbull@eclipsesource.com> - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.pde.internal.ui.target; >+ >+import java.net.URI; >+import org.eclipse.core.filesystem.*; >+import org.eclipse.core.runtime.*; >+import org.eclipse.core.runtime.jobs.Job; >+import org.eclipse.equinox.p2.engine.IProfile; >+import org.eclipse.pde.core.plugin.IPluginModelBase; >+import org.eclipse.pde.core.plugin.PluginRegistry; >+import org.eclipse.pde.internal.core.FeatureModelManager; >+import org.eclipse.pde.internal.core.PDECore; >+import org.eclipse.pde.internal.core.feature.ExternalFeatureModel; >+import org.eclipse.pde.internal.core.ifeature.IFeatureModel; >+import org.eclipse.pde.internal.core.target.TargetDefinition; >+import org.eclipse.pde.internal.core.target.TargetPlatformService; >+import org.eclipse.pde.internal.ui.PDEPlugin; >+import org.eclipse.pde.internal.ui.PDEUIMessages; >+ >+/** >+ * This job exports the bundles and features that make up your target. >+ * >+ */ >+public class ExportActiveTargetJob extends Job { >+ >+ private URI fDestination; >+ private boolean fclearDestinationDirectory = false; >+ >+ public ExportActiveTargetJob(URI destination, boolean clearDestinationDirectory) { >+ super("Export Current Target Definition Job"); //$NON-NLS-1$ >+ fDestination = destination; >+ fclearDestinationDirectory = clearDestinationDirectory; >+ } >+ >+ protected IStatus run(IProgressMonitor monitor) { >+ >+ IFileSystem fileSystem = EFS.getLocalFileSystem(); >+ if (!fileSystem.canWrite()) { >+ return new Status(IStatus.ERROR, PDEPlugin.getPluginId(), "Destination directory not writable."); //$NON-NLS-1$ >+ } >+ IFileStore destination = fileSystem.getStore(fDestination); >+ >+ FeatureModelManager featureManager = PDECore.getDefault().getFeatureModelManager(); >+ IFeatureModel[] featureModels = featureManager.getModels(); >+ IPluginModelBase[] pluginModels = PluginRegistry.getExternalModels(); >+ >+ IFileStore featureDir = destination.getChild("features"); //$NON-NLS-1$ >+ IFileStore pluginDir = destination.getChild("plugins"); //$NON-NLS-1$ >+ IFileStore metadataXML = destination.getChild("content.xml"); //$NON-NLS-1$ >+ IFileStore metadataJAR = destination.getChild("content.jar"); //$NON-NLS-1$ >+ >+ int totalWork = featureModels.length + pluginModels.length; >+ >+ try { >+ monitor.beginTask(PDEUIMessages.ExportTargetDefinition_task, totalWork); >+ if (fclearDestinationDirectory) { >+ monitor.subTask(PDEUIMessages.ExportTargetDeleteOldData); //Deleting old data... >+ } >+ >+ try { >+ if (fclearDestinationDirectory) { >+ ExportTargetMetadata.getDefault().clearExporedRepository(fDestination); >+ >+ if (featureDir.fetchInfo().exists()) { >+ featureDir.delete(EFS.NONE, new NullProgressMonitor()); >+ } >+ if (pluginDir.fetchInfo().exists()) { >+ pluginDir.delete(EFS.NONE, new NullProgressMonitor()); >+ } >+ if (metadataJAR.fetchInfo().exists()) { >+ metadataJAR.delete(EFS.NONE, new NullProgressMonitor()); >+ } >+ if (metadataXML.fetchInfo().exists()) { >+ metadataXML.delete(EFS.NONE, new NullProgressMonitor()); >+ } >+ } >+ >+ if (!featureDir.fetchInfo().exists()) { >+ featureDir.mkdir(EFS.NONE, new NullProgressMonitor()); >+ } >+ if (!pluginDir.fetchInfo().exists()) { >+ pluginDir.mkdir(EFS.NONE, new NullProgressMonitor()); >+ } >+ } catch (CoreException e1) { >+ return new Status(IStatus.ERROR, PDEPlugin.getPluginId(), "Failed to create destination directory.", e1); //$NON-NLS-1$ >+ } >+ >+ monitor.subTask(PDEUIMessages.ExportTargetExportFeatures); >+ for (int i = 0; i < featureModels.length; i++) { >+ IFeatureModel model = featureModels[i]; >+ if (model.isEnabled() && model instanceof ExternalFeatureModel) { >+ copy(model.getInstallLocation(), featureDir, fileSystem, monitor); >+ } >+ } >+ >+ monitor.subTask(PDEUIMessages.ExportTargetExportPlugins); >+ for (int i = 0; i < pluginModels.length; i++) { >+ IPluginModelBase model = pluginModels[i]; >+ //if (model.isEnabled()) { >+ copy(model.getInstallLocation(), pluginDir, fileSystem, monitor); >+ //} >+ } >+ >+ try { >+ IProfile profile = ((TargetDefinition) TargetPlatformService.getDefault().getWorkspaceTargetHandle().getTargetDefinition()).getProfile(); >+ ExportTargetMetadata component = ExportTargetMetadata.getDefault(); >+ IStatus status = component.exportMetadata(profile, fDestination, "Get target name plz"); //TODO: Get the target name //$NON-NLS-1$ >+ if (status.isOK()) >+ return status; >+ } catch (CoreException e) { >+ return new Status(IStatus.ERROR, PDEPlugin.getPluginId(), "Failed to export the target", e); //$NON-NLS-1$ >+ } >+ } catch (CoreException e) { >+ return new Status(IStatus.ERROR, PDEPlugin.getPluginId(), "Failed to export the target", e); //$NON-NLS-1$ >+ } >+ >+ finally { >+ monitor.done(); >+ } >+ return Status.OK_STATUS; >+ } >+ >+ private IStatus copy(String src, IFileStore destinationParent, IFileSystem fileSystem, IProgressMonitor monitor) throws CoreException { >+ Path srcPath = new Path(src); >+ IFileStore source = fileSystem.getStore(srcPath); >+ String elementName = srcPath.segment(srcPath.segmentCount() - 1); >+ IFileStore destinationDirectory = destinationParent.getChild(elementName); >+ if (destinationDirectory.fetchInfo().exists()) { >+ monitor.worked(1); >+ return Status.OK_STATUS; >+ } >+ if (source.fetchInfo().isDirectory()) { >+ destinationDirectory.mkdir(EFS.NONE, new NullProgressMonitor()); >+ } >+ source.copy(destinationDirectory, EFS.OVERWRITE, new SubProgressMonitor(monitor, 1)); >+ return Status.OK_STATUS; >+ } >+ >+} >Index: src/org/eclipse/pde/internal/ui/target/ExportTargetMetadata.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/target/ExportTargetMetadata.java >diff -N src/org/eclipse/pde/internal/ui/target/ExportTargetMetadata.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/target/ExportTargetMetadata.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,99 @@ >+/******************************************************************************* >+ * Copyright (c) 2009-2010 EclipseSource Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Ian Bull <irbull@eclipsesource.com> - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.pde.internal.ui.target; >+ >+import java.net.URI; >+import org.eclipse.core.runtime.*; >+import org.eclipse.equinox.p2.core.IProvisioningAgent; >+import org.eclipse.equinox.p2.core.ProvisionException; >+import org.eclipse.equinox.p2.engine.IProfile; >+import org.eclipse.equinox.p2.query.IQueryResult; >+import org.eclipse.equinox.p2.query.QueryUtil; >+import org.eclipse.equinox.p2.repository.IRepositoryManager; >+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; >+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager; >+import org.eclipse.pde.internal.ui.PDEPlugin; >+ >+public class ExportTargetMetadata { >+ >+ IProvisioningAgent agent = null; >+ public static ExportTargetMetadata instance = null; >+ >+ public void start() { >+ instance = this; >+ } >+ >+ public void stop() { >+ instance = null; >+ >+ } >+ >+ public static ExportTargetMetadata getDefault() { >+ return instance; >+ } >+ >+ public synchronized void clearExporedRepository(URI destination) { >+ if (agent == null) >+ return; >+ if (((IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME)).contains(destination)) >+ ((IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME)).removeRepository(destination); >+ } >+ >+ public synchronized IStatus exportMetadata(IProfile profile, URI destination, String targetName) { >+ if (agent == null) >+ return new Status(IStatus.ERROR, PDEPlugin.getPluginId(), "Failed to mirror the metadata."); //$NON-NLS-1$ >+ boolean removeRepoAfterLoad = false; >+ try { >+ IMetadataRepository repository = null; >+ >+ try { >+ //TODO: There appears to be a small (5 byte) difference from when I do the load vs. the create >+ // The create gives the repo a version 1, while the load gives it 1.0.0 >+ // this might be worth looking into >+ removeRepoAfterLoad = !((IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME)).contains(destination); >+ repository = ((IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME)).loadRepository(destination, IRepositoryManager.REPOSITORY_HINT_MODIFIABLE, new NullProgressMonitor()); >+ } catch (ProvisionException e) { >+ // The repository cannot be loaded >+ } >+ if (repository == null) { >+ repository = ((IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME)).createRepository(destination, targetName, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null); >+ } >+ >+ if (repository != null) { >+ mirrorMetadata(profile, repository); >+ } else { >+ return new Status(IStatus.ERROR, PDEPlugin.getPluginId(), "Failed to mirror the metadata."); //$NON-NLS-1$ >+ } >+ >+ } catch (ProvisionException e) { >+ return new Status(IStatus.ERROR, PDEPlugin.getPluginId(), "Failed to mirror the metadata.", e); //$NON-NLS-1$ >+ } finally { >+ if (removeRepoAfterLoad) { >+ ((IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME)).removeRepository(destination); >+ } >+ } >+ >+ return Status.OK_STATUS; >+ } >+ >+ private void mirrorMetadata(IProfile profile, IMetadataRepository repository) { >+ IQueryResult results = profile.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()); >+ repository.addInstallableUnits(results.toUnmodifiableSet()); >+ } >+ >+ public void bind(IProvisioningAgent agent) { >+ this.agent = agent; >+ } >+ >+ public synchronized void unbind(IProvisioningAgent agent) { >+ this.agent = null; >+ } >+} >Index: src/org/eclipse/pde/internal/ui/target/TargetDefinitionExportWizard.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/target/TargetDefinitionExportWizard.java >diff -N src/org/eclipse/pde/internal/ui/target/TargetDefinitionExportWizard.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/target/TargetDefinitionExportWizard.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,51 @@ >+/******************************************************************************* >+ * Copyright (c) 2009-2010 EclipseSource Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Chris Aniszczyk <zx@eclipsesource.com> - initial API and implementation >+ * Ian Bull <irbull@eclipsesource.com> - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.pde.internal.ui.target; >+ >+import java.io.File; >+import org.eclipse.core.runtime.jobs.Job; >+import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.jface.wizard.Wizard; >+import org.eclipse.pde.internal.ui.PDEUIMessages; >+import org.eclipse.ui.IExportWizard; >+import org.eclipse.ui.IWorkbench; >+ >+public class TargetDefinitionExportWizard extends Wizard implements IExportWizard { >+ >+ private TargetDefinitionExportWizardPage fPage = null; >+ >+ public TargetDefinitionExportWizard() { >+ setNeedsProgressMonitor(true); >+ setWindowTitle(PDEUIMessages.ExportActiveTargetDefinition); >+ } >+ >+ public void addPages() { >+ fPage = new TargetDefinitionExportWizardPage(); >+ addPage(fPage); >+ } >+ >+ public boolean performFinish() { >+ String destDir = fPage.getDestinationDirectory(); >+ boolean clearDestDir = fPage.isClearDestinationDirectory(); >+ File file = new File(destDir); >+ >+ Job job = new ExportActiveTargetJob(file.toURI(), clearDestDir); >+ job.schedule(200); >+ >+ return true; >+ } >+ >+ public void init(IWorkbench workbench, IStructuredSelection selection) { >+ // do nothing atm >+ } >+ >+} >Index: src/org/eclipse/pde/internal/ui/target/TargetDefinitionExportWizardPage.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/target/TargetDefinitionExportWizardPage.java >diff -N src/org/eclipse/pde/internal/ui/target/TargetDefinitionExportWizardPage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/target/TargetDefinitionExportWizardPage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,120 @@ >+/******************************************************************************* >+ * Copyright (c) 2009-2010 EclipseSource Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Chris Aniszczyk <zx@eclipsesource.com> - initial API and implementation >+ * Ian Bull <irbull@eclipsesource.com> - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.pde.internal.ui.target; >+ >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.jface.dialogs.Dialog; >+import org.eclipse.jface.wizard.WizardPage; >+import org.eclipse.pde.internal.ui.PDEUIMessages; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.*; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.*; >+ >+public class TargetDefinitionExportWizardPage extends WizardPage { >+ >+ private static final String PAGE_ID = "org.eclipse.pde.target.exportPage"; //$NON-NLS-1$ >+ private Button browseButton = null; >+ private Text destDirText = null; >+ private Button clearDestinationDirCheck = null; >+ >+ protected TargetDefinitionExportWizardPage() { >+ super(PAGE_ID); >+ setPageComplete(false); >+ setTitle(PDEUIMessages.ExportActiveTargetDefinition); >+ // TODO setImage(...) >+ } >+ >+ public void createControl(Composite parent) { >+ Composite container = new Composite(parent, SWT.NONE); >+ GridLayout layout = new GridLayout(1, false); >+ container.setLayout(layout); >+ createExportDirectoryControl(container); >+ >+ //TODO initSettings(); >+ >+ Dialog.applyDialogFont(container); >+ setControl(container); >+ setPageComplete(validate()); >+ } >+ >+ private void createExportDirectoryControl(Composite parent) { >+ parent.setLayout(new GridLayout(3, false)); >+ parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ new Label(parent, SWT.NONE).setText(PDEUIMessages.ExportTargetCurrentTarget); >+ Label l = new Label(parent, SWT.NONE); >+ >+ // TODO zx can you get the name of the current target here? >+ l.setText("get name of current target plz"); >+ GridData gd = new GridData(GridData.FILL_HORIZONTAL); >+ gd.horizontalSpan = 2; >+ l.setLayoutData(gd); >+ new Label(parent, SWT.NONE).setText(PDEUIMessages.ExportTargetChooseFolder); >+ >+ destDirText = new Text(parent, SWT.BORDER); >+ destDirText.setEditable(false); >+ destDirText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ destDirText.addModifyListener(new ModifyListener() { >+ public void modifyText(ModifyEvent e) { >+ controlChanged(); >+ } >+ }); >+ browseButton = new Button(parent, SWT.PUSH); >+ browseButton.setText(PDEUIMessages.ExportTargetBrowse); >+ browseButton.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ DirectoryDialog dialog = new DirectoryDialog(getShell()); >+ dialog.setText(PDEUIMessages.ExportTargetSelectDestination); >+ dialog.setMessage(PDEUIMessages.ExportTargetSpecifyDestination); >+ String dir = destDirText.getText(); >+ dialog.setFilterPath(dir); >+ dir = dialog.open(); >+ if (dir == null || dir.equals("")) { //$NON-NLS-1$ >+ return; >+ } >+ destDirText.setText(dir); >+ controlChanged(); >+ } >+ }); >+ >+ clearDestinationDirCheck = new Button(parent, SWT.CHECK); >+ clearDestinationDirCheck.setText(PDEUIMessages.ExportTargetClearDestination); >+ gd = new GridData(); >+ gd.horizontalSpan = 2; >+ clearDestinationDirCheck.setLayoutData(gd); >+ } >+ >+ public String getDestinationDirectory() { >+ return destDirText.getText(); >+ } >+ >+ public boolean isClearDestinationDirectory() { >+ return clearDestinationDirCheck.getSelection(); >+ } >+ >+ public void controlChanged() { >+ setPageComplete(validate()); >+ } >+ >+ protected boolean validate() { >+ setMessage(null); >+ >+ if (destDirText.getText().equals("")) { //$NON-NLS-1$ >+ setMessage(PDEUIMessages.ExportTargetError_ChooseDestination, IStatus.WARNING); >+ return false; >+ } >+ >+ return true; >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 190711
:
143232
|
164160
|
164371
|
164373