View | Details | Raw Unified | Return to bug 204347 | Differences between
and this patch

Collapse All | Expand All

(-).classpath (+7 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
4
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5
	<classpathentry kind="src" path="src"/>
6
	<classpathentry kind="output" path="bin"/>
7
</classpath>
(-)src/org/eclipse/pde/internal/p2/ui/PDEP2Plugin.java (+36 lines)
Added Link Here
1
package org.eclipse.pde.internal.p2.ui;
2
3
import org.eclipse.ui.plugin.AbstractUIPlugin;
4
5
public class PDEP2Plugin extends AbstractUIPlugin {
6
	
7
	public static final String PLUGIN_ID = "org.eclipse.pde.p2.ui"; //$NON-NLS-1$
8
	
9
	private static PDEP2Plugin fgPDEP2Plugin; 
10
	
11
	/**
12
	 * Constructs the PDE p2 UI plug-in
13
	 */
14
	public PDEP2Plugin() {
15
		super();
16
		fgPDEP2Plugin = this;
17
	}
18
	
19
	/**
20
	 * Convenience method which returns the unique identifier of this plug-in.
21
	 */
22
	public static String getUniqueIdentifier() {
23
		return PLUGIN_ID;
24
	}
25
	
26
	/**
27
	 * Returns the singleton instance of the debug plug-in.
28
	 */
29
	public static PDEP2Plugin getDefault() {
30
		if(fgPDEP2Plugin == null) {
31
			fgPDEP2Plugin = new PDEP2Plugin();
32
		}
33
		return fgPDEP2Plugin;
34
	}
35
36
}
(-)src/org/eclipse/pde/internal/p2/ui/provisioner/ProvisionerMessages.properties (+31 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2008 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
#
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
P2TargetProvisionerWizard_1=Repository and Update Site Target Provisioner
12
P2TargetProvisionerWizard_10=Clearing install folder
13
P2TargetProvisionerWizard_2=Add plug-ins from repository or update site to the target platform
14
P2TargetProvisionerWizard_3=Error During Download Operation
15
P2TargetProvisionerWizard_7=Download Operation Was Interrupted
16
P2TargetProvisionerWizard_9=Provisioning target
17
P2TargetProvisionerWizardPage_0=Location:
18
P2TargetProvisionerWizardPage_1=At least one plug-in must be selected
19
P2TargetProvisionerWizardPage_10=&Properties...
20
P2TargetProvisionerWizardPage_11=&Manage sites...
21
P2TargetProvisionerWizardPage_12=Add Site
22
P2TargetProvisionerWizardPage_13=Remove Site
23
P2TargetProvisionerWizardPage_16=Install Location
24
P2TargetProvisionerWizardPage_17=Select a folder to download plug-ins to:
25
P2TargetProvisionerWizardPage_3=The specified folder is invalid or does not exist
26
P2TargetProvisionerWizardPage_4=Use &default location
27
P2TargetProvisionerWizardPage_5=Problem opening directory: The specified folder invalid or does not exist.
28
P2TargetProvisionerWizardPage_6=Problem opening directory: 
29
P2TargetProvisionerWizardPage_7=B&rowse...
30
P2TargetProvisionerWizardPage_8=&Clear contents of folder before downloading
31
P2TargetProvisionerWizardPage_9=Available Plug-ins
(-)META-INF/MANIFEST.MF (+22 lines)
Added Link Here
1
Manifest-Version: 1.0
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %Bundle-Name.0
4
Bundle-SymbolicName: org.eclipse.pde.p2.ui;singleton:=true
5
Bundle-Version: 3.4.0.qualifier
6
Require-Bundle: org.eclipse.ui,
7
 org.eclipse.core.runtime,
8
 org.eclipse.core.resources,
9
 org.eclipse.equinox.p2.engine,
10
 org.eclipse.equinox.p2.metadata,
11
 org.eclipse.equinox.p2.ui,
12
 org.eclipse.equinox.p2.ui.sdk,
13
 org.eclipse.equinox.p2.core,
14
 org.eclipse.equinox.p2.director,
15
 org.eclipse.pde.ui,
16
 org.eclipse.equinox.p2.metadata.repository;bundle-version="0.1.0"
17
Bundle-RequiredExecutionEnvironment: J2SE-1.4
18
Bundle-ActivationPolicy: lazy
19
Bundle-Activator: org.eclipse.pde.internal.p2.ui.PDEP2Plugin
20
Bundle-Localization: plugin
21
Export-Package: org.eclipse.pde.internal.p2.ui;x-internal:=true,
22
 org.eclipse.pde.internal.p2.ui.provisioner;x-internal:=true
(-)plugin.xml (+17 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?eclipse version="3.2"?>
3
<plugin>
4
   <extension
5
         point="org.eclipse.pde.ui.targetProvisioners">
6
      <provisioner
7
            class="org.eclipse.pde.internal.p2.ui.provisioner.P2TargetProvisionerWizard"
8
            icon="icons/obj/iu_obj.gif"
9
            id="org.eclipse.pde.p2.ui.availableIUTargetProvisioner"
10
            name="%provisioner.name.0">
11
         <description>
12
            %provisioner.description.0
13
         </description>
14
      </provisioner>
15
   </extension>
16
17
</plugin>
(-)src/org/eclipse/pde/internal/p2/ui/provisioner/P2TargetProvisionerWizard.java (+209 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others. All rights reserved. This
3
 * program and the accompanying materials are made available under the terms of
4
 * the Eclipse Public License v1.0 which accompanies this distribution, and is
5
 * available at http://www.eclipse.org/legal/epl-v10.html
6
 * 
7
 * Contributors: IBM Corporation - initial API and implementation
8
 ******************************************************************************/
9
package org.eclipse.pde.internal.p2.ui.provisioner;
10
11
import java.io.File;
12
import java.lang.reflect.InvocationTargetException;
13
import java.util.HashMap;
14
import java.util.Map;
15
import org.eclipse.core.runtime.*;
16
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
17
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
18
import org.eclipse.equinox.internal.provisional.p2.director.ProvisioningPlan;
19
import org.eclipse.equinox.internal.provisional.p2.engine.IProfile;
20
import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningContext;
21
import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
22
import org.eclipse.equinox.internal.provisional.p2.ui.ProvUIImages;
23
import org.eclipse.equinox.internal.provisional.p2.ui.operations.DownloadPhaseSet;
24
import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil;
25
import org.eclipse.jface.dialogs.ErrorDialog;
26
import org.eclipse.jface.dialogs.IDialogSettings;
27
import org.eclipse.jface.operation.IRunnableWithProgress;
28
import org.eclipse.jface.wizard.Wizard;
29
import org.eclipse.pde.internal.p2.ui.PDEP2Plugin;
30
import org.eclipse.pde.ui.IProvisionerWizard;
31
32
/**
33
 * Wizard to provision a target using a p2 metadata repository such as an update site.
34
 * The user will select a download location and a list of installable units from known
35
 * sites.  When the user is finished, the IUs will be downloaded to a specific directory
36
 * and the directory will be added to the 'additional locations' of the target platform.
37
 * 
38
 * @since 3.4
39
 * @see IProvisionerWizard
40
 * @see P2TargetProvisionerWizardPage
41
 */
42
public class P2TargetProvisionerWizard extends Wizard implements IProvisionerWizard {
43
44
	private P2TargetProvisionerWizardPage fSelectIUPage;
45
	private File[] fLocations;
46
47
	/**
48
	 * Name of the temporary profile that will be created to execute the download.
49
	 */
50
	private static final String PROFILE_ID = "TEMP_TARGET_PROVISIONER_PROFILE"; //$NON-NLS-1$
51
52
	/**
53
	 * Identifier for dialog settings section 
54
	 */
55
	private static final String DIALOG_SETTINGS_SECTION = "P2TargetProvisionerWizardSettings"; //$NON-NLS-1$
56
57
	public P2TargetProvisionerWizard() {
58
		setWindowTitle(ProvisionerMessages.P2TargetProvisionerWizard_1);
59
		setDefaultPageImageDescriptor(ProvUIImages.getImageDescriptor(ProvUIImages.WIZARD_BANNER_INSTALL));
60
		setNeedsProgressMonitor(true);
61
		IDialogSettings workbenchSettings = PDEP2Plugin.getDefault().getDialogSettings();
62
		IDialogSettings section = workbenchSettings.getSection(DIALOG_SETTINGS_SECTION);
63
		if (section == null)
64
			section = workbenchSettings.addNewSection(DIALOG_SETTINGS_SECTION);
65
		setDialogSettings(section);
66
	}
67
68
	/* (non-Javadoc)
69
	 * @see org.eclipse.jface.wizard.Wizard#addPages()
70
	 */
71
	public void addPages() {
72
		fSelectIUPage = new P2TargetProvisionerWizardPage("Select IU Page"); //$NON-NLS-1$
73
		fSelectIUPage.setTitle(ProvisionerMessages.P2TargetProvisionerWizard_1);
74
		fSelectIUPage.setDescription(ProvisionerMessages.P2TargetProvisionerWizard_2);
75
		addPage(fSelectIUPage);
76
		super.addPages();
77
	}
78
79
	/* (non-Javadoc)
80
	 * @see org.eclipse.jface.wizard.Wizard#canFinish()
81
	 */
82
	public boolean canFinish() {
83
		return fSelectIUPage.isPageComplete();
84
	}
85
86
	/* (non-Javadoc)
87
	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
88
	 */
89
	public boolean performFinish() {
90
		fSelectIUPage.saveWidgetState();
91
		DownloadIUOperation op = new DownloadIUOperation(fSelectIUPage.getDownloadLocation(true), fSelectIUPage.isClearContentsBeforeDownloading(), fSelectIUPage.getUnits());
92
		try {
93
			fLocations = new File[0];
94
			getContainer().run(true, true, op);
95
			return true;
96
		} catch (InvocationTargetException e) {
97
			if (e.getTargetException() != null) {
98
				ErrorDialog.openError(getShell(), ProvisionerMessages.P2TargetProvisionerWizard_3, e.getTargetException().getMessage(), e.getTargetException() instanceof CoreException ? ((CoreException) e.getTargetException()).getStatus() : new Status(IStatus.ERROR, PDEP2Plugin.getUniqueIdentifier(), e.getTargetException().getMessage()));
99
			} else {
100
				ErrorDialog.openError(getShell(), ProvisionerMessages.P2TargetProvisionerWizard_3, e.getMessage(), new Status(IStatus.ERROR, PDEP2Plugin.getUniqueIdentifier(), e.getMessage()));
101
			}
102
			return false;
103
		} catch (InterruptedException e) {
104
			ErrorDialog.openError(getShell(), ProvisionerMessages.P2TargetProvisionerWizard_7, e.getMessage(), new Status(IStatus.ERROR, PDEP2Plugin.getUniqueIdentifier(), e.getMessage()));
105
			return false;
106
		}
107
	}
108
109
	/* (non-Javadoc)
110
	 * @see org.eclipse.pde.ui.IProvisionerWizard#getLocations()
111
	 */
112
	public File[] getLocations() {
113
		return fLocations;
114
	}
115
116
	/**
117
	 * Job to perform the download of the installable units, reports progress.
118
	 * @since 3.4
119
	 */
120
	private class DownloadIUOperation implements IRunnableWithProgress {
121
122
		private File fInstallDir;
123
		private boolean fClearContents;
124
		private IInstallableUnit[] fUnits;
125
126
		public DownloadIUOperation(File installDir, boolean clearContentsBeforeDownload, IInstallableUnit[] units) {
127
			fInstallDir = installDir;
128
			fClearContents = clearContentsBeforeDownload;
129
			fUnits = units;
130
		}
131
132
		/* (non-Javadoc)
133
		 * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
134
		 */
135
		public void run(IProgressMonitor monitor) throws InvocationTargetException {
136
			monitor.beginTask(ProvisionerMessages.P2TargetProvisionerWizard_9, 4);
137
			if (fInstallDir != null && fInstallDir.isDirectory()) {
138
139
				// Clear the contents of the directory if required
140
				if (fClearContents) {
141
					File[] contents = fInstallDir.listFiles();
142
					SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, contents.length, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
143
					subMonitor.setTaskName(ProvisionerMessages.P2TargetProvisionerWizard_10);
144
					for (int i = 0; i < contents.length; i++) {
145
						deleteDir(contents[i]);
146
						subMonitor.worked(1);
147
					}
148
					subMonitor.done();
149
				} else {
150
					monitor.worked(1);
151
				}
152
153
				try {
154
					// Create the temporary profile
155
					Map properties = new HashMap();
156
					properties.put(IProfile.PROP_INSTALL_FOLDER, fInstallDir.toString());
157
					properties.put(IProfile.PROP_CACHE, fInstallDir.toString());
158
					ProvisioningUtil.removeProfile(PROFILE_ID, monitor);
159
					IProfile newProfile = ProvisioningUtil.addProfile(PROFILE_ID, properties, monitor);
160
					monitor.worked(1);
161
162
					// Create the provisioning plan
163
					ProfileChangeRequest request = new ProfileChangeRequest(newProfile);
164
					request.addInstallableUnits(fUnits);
165
					ProvisioningPlan plan = ProvisioningUtil.getProvisioningPlan(request, new ProvisioningContext(), monitor);
166
					monitor.worked(1);
167
168
					// Execute the provisioning plan
169
					IStatus result = ProvisioningUtil.performProvisioningPlan(plan, new DownloadPhaseSet(), newProfile, monitor);
170
171
					if (result.isOK()) {
172
						fLocations = new File[] {fInstallDir};
173
					} else {
174
						throw new InvocationTargetException(new CoreException(result));
175
					}
176
177
				} catch (ProvisionException e) {
178
					throw new InvocationTargetException(e);
179
				} finally {
180
					// Make sure to remove the temporary profile
181
					try {
182
						ProvisioningUtil.removeProfile(PROFILE_ID, monitor);
183
					} catch (ProvisionException e) {
184
					}
185
				}
186
			}
187
			monitor.done();
188
		}
189
190
		/**
191
		 * Deletes a directory
192
		 * @param dir the directory to delete
193
		 */
194
		private void deleteDir(File dir) {
195
			if (dir.exists()) {
196
				if (dir.isDirectory()) {
197
					File[] children = dir.listFiles();
198
					if (children != null) {
199
						for (int i = 0; i < children.length; i++) {
200
							deleteDir(children[i]);
201
						}
202
					}
203
				}
204
				dir.delete();
205
			}
206
		}
207
	}
208
209
}
(-)about.html (+28 lines)
Added Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head>
5
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
6
<title>About</title>
7
</head>
8
<body lang="EN-US">
9
<h2>About This Content</h2>
10
 
11
<p>June 2, 2006</p>	
12
<h3>License</h3>
13
14
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
15
indicated below, the Content is provided to you under the terms and conditions of the
16
Eclipse Public License Version 1.0 (&quot;EPL&quot;).  A copy of the EPL is available 
17
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
18
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
19
20
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
21
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
22
apply to your use of any object code in the Content.  Check the Redistributor's license that was 
23
provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
24
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
25
and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
26
27
</body>
28
</html>
(-)src/org/eclipse/pde/internal/p2/ui/provisioner/ProvisionerMessages.java (+43 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others. All rights reserved. This
3
 * program and the accompanying materials are made available under the terms of
4
 * the Eclipse Public License v1.0 which accompanies this distribution, and is
5
 * available at http://www.eclipse.org/legal/epl-v10.html
6
 * 
7
 * Contributors: IBM Corporation - initial API and implementation
8
 ******************************************************************************/
9
package org.eclipse.pde.internal.p2.ui.provisioner;
10
11
import org.eclipse.osgi.util.NLS;
12
13
public class ProvisionerMessages extends NLS {
14
	private static final String BUNDLE_NAME = "org.eclipse.pde.internal.p2.ui.provisioner.ProvisionerMessages"; //$NON-NLS-1$
15
	public static String P2TargetProvisionerWizard_1;
16
	public static String P2TargetProvisionerWizard_10;
17
	public static String P2TargetProvisionerWizard_2;
18
	public static String P2TargetProvisionerWizard_3;
19
	public static String P2TargetProvisionerWizard_7;
20
	public static String P2TargetProvisionerWizard_9;
21
	public static String P2TargetProvisionerWizardPage_0;
22
	public static String P2TargetProvisionerWizardPage_1;
23
	public static String P2TargetProvisionerWizardPage_10;
24
	public static String P2TargetProvisionerWizardPage_11;
25
	public static String P2TargetProvisionerWizardPage_12;
26
	public static String P2TargetProvisionerWizardPage_13;
27
	public static String P2TargetProvisionerWizardPage_16;
28
	public static String P2TargetProvisionerWizardPage_17;
29
	public static String P2TargetProvisionerWizardPage_3;
30
	public static String P2TargetProvisionerWizardPage_4;
31
	public static String P2TargetProvisionerWizardPage_5;
32
	public static String P2TargetProvisionerWizardPage_6;
33
	public static String P2TargetProvisionerWizardPage_7;
34
	public static String P2TargetProvisionerWizardPage_8;
35
	public static String P2TargetProvisionerWizardPage_9;
36
	static {
37
		// initialize resource bundle
38
		NLS.initializeMessages(BUNDLE_NAME, ProvisionerMessages.class);
39
	}
40
41
	private ProvisionerMessages() {
42
	}
43
}
(-)src/org/eclipse/pde/internal/p2/ui/PixelConverter.java (+58 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.pde.internal.p2.ui;
12
13
import org.eclipse.jface.dialogs.Dialog;
14
import org.eclipse.jface.dialogs.DialogPage;
15
import org.eclipse.swt.graphics.FontMetrics;
16
import org.eclipse.swt.graphics.GC;
17
import org.eclipse.swt.widgets.Control;
18
19
public class PixelConverter {
20
21
	private FontMetrics fFontMetrics;
22
23
	public PixelConverter(Control control) {
24
		GC gc = new GC(control);
25
		gc.setFont(control.getFont());
26
		fFontMetrics = gc.getFontMetrics();
27
		gc.dispose();
28
	}
29
30
	/**
31
	 * @see DialogPage#convertHeightInCharsToPixels
32
	 */
33
	public int convertHeightInCharsToPixels(int chars) {
34
		return Dialog.convertHeightInCharsToPixels(fFontMetrics, chars);
35
	}
36
37
	/**
38
	 * @see DialogPage#convertHorizontalDLUsToPixels
39
	 */
40
	public int convertHorizontalDLUsToPixels(int dlus) {
41
		return Dialog.convertHorizontalDLUsToPixels(fFontMetrics, dlus);
42
	}
43
44
	/**
45
	 * @see DialogPage#convertVerticalDLUsToPixels
46
	 */
47
	public int convertVerticalDLUsToPixels(int dlus) {
48
		return Dialog.convertVerticalDLUsToPixels(fFontMetrics, dlus);
49
	}
50
51
	/**
52
	 * @see DialogPage#convertWidthInCharsToPixels
53
	 */
54
	public int convertWidthInCharsToPixels(int chars) {
55
		return Dialog.convertWidthInCharsToPixels(fFontMetrics, chars);
56
	}
57
58
}
(-)src/org/eclipse/pde/internal/p2/ui/provisioner/P2TargetProvisionerWizardPage.java (+405 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others. All rights reserved. This
3
 * program and the accompanying materials are made available under the terms of
4
 * the Eclipse Public License v1.0 which accompanies this distribution, and is
5
 * available at http://www.eclipse.org/legal/epl-v10.html
6
 * 
7
 * Contributors: IBM Corporation - initial API and implementation
8
 ******************************************************************************/
9
package org.eclipse.pde.internal.p2.ui.provisioner;
10
11
import java.io.File;
12
import java.net.URL;
13
14
import org.eclipse.core.resources.ResourcesPlugin;
15
import org.eclipse.core.runtime.IPath;
16
import org.eclipse.core.runtime.IStatus;
17
import org.eclipse.core.runtime.Status;
18
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
19
import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningContext;
20
import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
21
import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager;
22
import org.eclipse.equinox.internal.provisional.p2.ui.IRepositoryManipulator;
23
import org.eclipse.equinox.internal.provisional.p2.ui.actions.PropertyDialogAction;
24
import org.eclipse.equinox.internal.provisional.p2.ui.dialogs.AvailableIUGroup;
25
import org.eclipse.equinox.internal.provisional.p2.ui.dialogs.DefaultMetadataURLValidator;
26
import org.eclipse.equinox.internal.provisional.p2.ui.dialogs.URLValidator;
27
import org.eclipse.equinox.internal.provisional.p2.ui.operations.AddColocatedRepositoryOperation;
28
import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningOperation;
29
import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil;
30
import org.eclipse.equinox.internal.provisional.p2.ui.operations.RemoveColocatedRepositoryOperation;
31
import org.eclipse.equinox.internal.provisional.p2.ui.sdk.ProvPolicies;
32
import org.eclipse.equinox.internal.provisional.p2.ui.sdk.RepositoryManipulationDialog;
33
import org.eclipse.jface.action.IAction;
34
import org.eclipse.jface.dialogs.IDialogSettings;
35
import org.eclipse.jface.viewers.ISelectionChangedListener;
36
import org.eclipse.jface.viewers.SelectionChangedEvent;
37
import org.eclipse.jface.window.SameShellProvider;
38
import org.eclipse.jface.wizard.WizardPage;
39
import org.eclipse.pde.internal.p2.ui.PDEP2Plugin;
40
import org.eclipse.pde.internal.p2.ui.SWTUtil;
41
import org.eclipse.swt.SWT;
42
import org.eclipse.swt.events.ModifyEvent;
43
import org.eclipse.swt.events.ModifyListener;
44
import org.eclipse.swt.events.SelectionAdapter;
45
import org.eclipse.swt.events.SelectionEvent;
46
import org.eclipse.swt.layout.GridData;
47
import org.eclipse.swt.layout.GridLayout;
48
import org.eclipse.swt.program.Program;
49
import org.eclipse.swt.widgets.Button;
50
import org.eclipse.swt.widgets.Composite;
51
import org.eclipse.swt.widgets.DirectoryDialog;
52
import org.eclipse.swt.widgets.Group;
53
import org.eclipse.swt.widgets.Link;
54
import org.eclipse.swt.widgets.Shell;
55
import org.eclipse.swt.widgets.Text;
56
57
/**
58
 * Wizard page allowing users to select which IUs they would like to download
59
 * and where they would like them to be downloaded to.
60
 * 
61
 * @since 3.4
62
 * @see P2TargetProvisionerWizard
63
 */
64
public class P2TargetProvisionerWizardPage extends WizardPage {
65
66
	/**
67
	 * Default location to download IUs to, will be created if it does not exist.
68
	 * Will be appended to the current workspace.
69
	 */
70
	private static final String DEFAULT_DIR_NAME = ".metadata/.plugins/org.eclipse.pde.core/target_plugins"; //$NON-NLS-1$;
71
	//	state constants
72
	private static final String USE_DEFAULT = "useDefault"; //$NON-NLS-1$
73
	private static final String CLEAR_CONTENTS = "clearContents"; //$NON-NLS-1$
74
	private static final String FOLDER_NAME = "folderName"; //$NON-NLS-1$
75
76
	static final IStatus BAD_IU_SELECTION = new Status(IStatus.ERROR, PDEP2Plugin.getUniqueIdentifier(), ProvisionerMessages.P2TargetProvisionerWizardPage_1);
77
	private static final IStatus DIR_DOES_NOT_EXIST = new Status(IStatus.ERROR, PDEP2Plugin.getUniqueIdentifier(), ProvisionerMessages.P2TargetProvisionerWizardPage_3);
78
79
	private IStatus fDirectoryStatus = Status.OK_STATUS;
80
	IStatus fSelectedIUStatus = BAD_IU_SELECTION;
81
82
	private String previousLocation;
83
	IInstallableUnit[] fUnits;
84
85
	private Link fLocationLink;
86
	private Text fInstallLocation;
87
	private Button fUseDefaultsButton;
88
	private Button fBrowseButton;
89
	private Button fClearContentsButton;
90
91
	AvailableIUGroup fAvailableIUGroup;
92
	Button fPropertiesButton;
93
	private IAction fPropertyAction;
94
	private IRepositoryManipulator fManipulator;
95
96
	protected P2TargetProvisionerWizardPage(String pageName) {
97
		super(pageName);
98
	}
99
100
	/* (non-Javadoc)
101
	 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
102
	 */
103
	public void createControl(Composite parent) {
104
		Composite composite = new Composite(parent, SWT.NONE);
105
		composite.setLayout(new GridLayout());
106
		composite.setLayoutData(new GridData(GridData.FILL_BOTH));
107
		composite.setFont(parent.getFont());
108
109
		createInstallFolderArea(composite);
110
		createAvailableIUArea(composite);
111
112
		setPageComplete(false);
113
		restoreWidgetState();
114
		setControl(composite);
115
	}
116
117
	/**
118
	 * Create the UI area where the user will choose what directory to download
119
	 * bundles to.  The user can choose to use the default area and they can choose
120
	 * to delete the contents of the folder before downloading.
121
	 * 
122
	 * @param composite parent composite
123
	 */
124
	private void createInstallFolderArea(Composite composite) {
125
		Composite locationComp = new Composite(composite, SWT.NONE);
126
		locationComp.setLayout(new GridLayout(3, false));
127
		locationComp.setFont(composite.getFont());
128
		locationComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
129
130
		fUseDefaultsButton = new Button(locationComp, SWT.CHECK | SWT.RIGHT);
131
		GridData gd = new GridData();
132
		gd.horizontalSpan = 3;
133
		fUseDefaultsButton.setLayoutData(gd);
134
		fUseDefaultsButton.setText(ProvisionerMessages.P2TargetProvisionerWizardPage_4);
135
		fUseDefaultsButton.setSelection(true);
136
		fUseDefaultsButton.addSelectionListener(new SelectionAdapter() {
137
			public void widgetSelected(SelectionEvent e) {
138
				Button button = (Button) e.getSource();
139
				if (button.getSelection()) {
140
					fInstallLocation.setEnabled(false);
141
					fBrowseButton.setEnabled(false);
142
					previousLocation = fInstallLocation.getText();
143
					fInstallLocation.setText(getDefaultDownloadLocation());
144
				} else {
145
					fInstallLocation.setEnabled(true);
146
					fBrowseButton.setEnabled(true);
147
					fInstallLocation.setText(previousLocation);
148
				}
149
150
			}
151
		});
152
		fUseDefaultsButton.setSelection(true);
153
154
		fLocationLink = new Link(locationComp, SWT.NONE);
155
		fLocationLink.setText("<a>" + ProvisionerMessages.P2TargetProvisionerWizardPage_0 + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$
156
		fLocationLink.addSelectionListener(new SelectionAdapter() {
157
			public void widgetSelected(SelectionEvent e) {
158
				try {
159
					File file = getDownloadLocation(true);
160
					if (file != null && file.isDirectory())
161
						Program.launch(file.getCanonicalPath());
162
					else
163
						setErrorMessage(ProvisionerMessages.P2TargetProvisionerWizardPage_5);
164
				} catch (Exception ex) {
165
					setErrorMessage(ProvisionerMessages.P2TargetProvisionerWizardPage_6 + ex.getMessage());
166
				}
167
			}
168
		});
169
170
		fInstallLocation = new Text(locationComp, SWT.BORDER);
171
		gd = new GridData(GridData.FILL_HORIZONTAL);
172
		fInstallLocation.setLayoutData(gd);
173
		previousLocation = getDefaultDownloadLocation();
174
		fInstallLocation.setText(previousLocation);
175
		fInstallLocation.setEnabled(false);
176
		fInstallLocation.addModifyListener(new ModifyListener() {
177
			public void modifyText(ModifyEvent e) {
178
				File location = getDownloadLocation(false);
179
				if (location == null || (!location.exists() && !fUseDefaultsButton.getSelection())) {
180
					fDirectoryStatus = DIR_DOES_NOT_EXIST;
181
				} else {
182
					fDirectoryStatus = Status.OK_STATUS;
183
				}
184
				pageChanged();
185
			}
186
		});
187
188
		fBrowseButton = new Button(locationComp, SWT.PUSH);
189
		fBrowseButton.setText(ProvisionerMessages.P2TargetProvisionerWizardPage_7);
190
		fBrowseButton.addSelectionListener(new SelectionAdapter() {
191
			public void widgetSelected(SelectionEvent event) {
192
				handleLocationBrowseButtonPressed();
193
			}
194
		});
195
		fBrowseButton.setEnabled(false);
196
		fBrowseButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
197
		SWTUtil.setButtonDimensionHint(fBrowseButton);
198
199
		fClearContentsButton = new Button(locationComp, SWT.CHECK | SWT.RIGHT);
200
		gd = new GridData();
201
		gd.horizontalSpan = 3;
202
		fClearContentsButton.setLayoutData(gd);
203
		fClearContentsButton.setText(ProvisionerMessages.P2TargetProvisionerWizardPage_8);
204
		fClearContentsButton.setSelection(false);
205
206
	}
207
208
	/**
209
	 * Create the UI area where the user will be able to select which IUs they
210
	 * would like to download.  There will also be buttons to see properties for
211
	 * the selection and open the manage sites dialog.
212
	 * 
213
	 * @param composite parent composite
214
	 */
215
	private void createAvailableIUArea(Composite composite) {
216
		Group mainGroup = new Group(composite, SWT.NONE);
217
		mainGroup.setText(ProvisionerMessages.P2TargetProvisionerWizardPage_9);
218
		mainGroup.setLayout(new GridLayout(2, false));
219
		mainGroup.setFont(composite.getFont());
220
		mainGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
221
		fAvailableIUGroup = new AvailableIUGroup(mainGroup, ProvPolicies.getDefault().getQueryProvider(), mainGroup.getFont(), new ProvisioningContext());
222
		fAvailableIUGroup.getStructuredViewer().addSelectionChangedListener(new ISelectionChangedListener() {
223
			public void selectionChanged(SelectionChangedEvent event) {
224
				fUnits = fAvailableIUGroup.getSelectedIUs();
225
				fPropertiesButton.setEnabled(fUnits.length > 0);
226
				if (fUnits.length > 0) {
227
					fSelectedIUStatus = Status.OK_STATUS;
228
				} else {
229
					fSelectedIUStatus = BAD_IU_SELECTION;
230
				}
231
				pageChanged();
232
			}
233
		});
234
		fAvailableIUGroup.setUseBoldFontForFilteredItems(true);
235
		GridData data = (GridData) fAvailableIUGroup.getStructuredViewer().getControl().getLayoutData();
236
		data.heightHint = 200;
237
238
		Composite iuButtonComp = new Composite(mainGroup, SWT.NONE);
239
		iuButtonComp.setLayout(new GridLayout(1, false));
240
		iuButtonComp.setFont(mainGroup.getFont());
241
		iuButtonComp.setLayoutData(new GridData(GridData.FILL_BOTH));
242
243
		fPropertiesButton = new Button(iuButtonComp, SWT.PUSH);
244
		fPropertiesButton.setText(ProvisionerMessages.P2TargetProvisionerWizardPage_10);
245
		fPropertiesButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
246
		fPropertiesButton.addSelectionListener(new SelectionAdapter() {
247
			public void widgetSelected(SelectionEvent event) {
248
				fPropertyAction.run();
249
			}
250
		});
251
		fPropertyAction = new PropertyDialogAction(new SameShellProvider(getShell()), fAvailableIUGroup.getStructuredViewer());
252
253
		fManipulator = new IRepositoryManipulator(){
254
			public String getManipulatorLabel() {
255
				return ProvisionerMessages.P2TargetProvisionerWizardPage_11;
256
			}
257
			public boolean manipulateRepositories(Shell shell) {
258
				new RepositoryManipulationDialog(shell, this).open();
259
				return true;
260
			}
261
			public ProvisioningOperation getAddOperation(URL repoURL) {
262
				return new AddColocatedRepositoryOperation(getAddOperationLabel(), repoURL);
263
			}
264
			public String getAddOperationLabel() {
265
				return ProvisionerMessages.P2TargetProvisionerWizardPage_12;
266
			}
267
			public URL[] getKnownRepositories() {
268
				try {
269
					return ProvisioningUtil.getMetadataRepositories(IMetadataRepositoryManager.REPOSITORIES_ALL);
270
				} catch (ProvisionException e) {
271
					return new URL[0];
272
				}
273
			}
274
			public ProvisioningOperation getRemoveOperation(URL[] reposToRemove) {
275
				return new RemoveColocatedRepositoryOperation(getRemoveOperationLabel(), reposToRemove);
276
			}
277
			public String getRemoveOperationLabel() {
278
				return ProvisionerMessages.P2TargetProvisionerWizardPage_13;
279
			}
280
			public URLValidator getURLValidator(Shell shell) {
281
				return new DefaultMetadataURLValidator();
282
			}
283
		};
284
		Button editReposButton = new Button(iuButtonComp, SWT.PUSH);
285
		editReposButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
286
		editReposButton.setText(ProvisionerMessages.P2TargetProvisionerWizardPage_11);
287
		editReposButton.addSelectionListener(new SelectionAdapter() {
288
			public void widgetSelected(SelectionEvent event) {
289
				fManipulator.manipulateRepositories(getShell());
290
			}
291
		});
292
	}
293
294
	/**
295
	 * Checks if the page is complete, updating messages and finish button.
296
	 */
297
	void pageChanged() {
298
		if (fDirectoryStatus.getSeverity() == IStatus.ERROR) {
299
			setErrorMessage(fDirectoryStatus.getMessage());
300
			setPageComplete(false);
301
		} else if (fSelectedIUStatus.getSeverity() == IStatus.ERROR) {
302
			setErrorMessage(fSelectedIUStatus.getMessage());
303
			setPageComplete(false);
304
		} else {
305
			setErrorMessage(null);
306
			setPageComplete(true);
307
		}
308
	}
309
310
	/**
311
	 * Determines the default download folder location based on the workspace
312
	 * location.
313
	 */
314
	private String getDefaultDownloadLocation() {
315
		IPath path = ResourcesPlugin.getWorkspace().getRoot().getLocation();
316
		if (path != null) {
317
			return new File(path.toFile(), DEFAULT_DIR_NAME).toString();
318
		}
319
		return ""; //$NON-NLS-1$
320
	}
321
322
	/**
323
	 * Open a directory dialog to select a folder.
324
	 */
325
	private void handleLocationBrowseButtonPressed() {
326
		DirectoryDialog dialog = new DirectoryDialog(getShell());
327
		dialog.setFilterPath(fInstallLocation.getText());
328
		dialog.setText(ProvisionerMessages.P2TargetProvisionerWizardPage_16);
329
		dialog.setMessage(ProvisionerMessages.P2TargetProvisionerWizardPage_17);
330
		String result = dialog.open();
331
		if (result != null)
332
			fInstallLocation.setText(result);
333
	}
334
	
335
	/**
336
	 * Save the state of the widgets select, for successive invocations of the wizard
337
	 */
338
	void saveWidgetState() {
339
		IDialogSettings settings = getDialogSettings();
340
		if(settings != null) {
341
			if (fUseDefaultsButton.getSelection()){
342
				settings.put(USE_DEFAULT, true);
343
			} else {
344
				settings.put(USE_DEFAULT, false);
345
				settings.put(FOLDER_NAME, fInstallLocation.getText());
346
			}
347
			settings.put(CLEAR_CONTENTS, fClearContentsButton.getSelection());
348
		}
349
	}
350
	
351
	/**
352
	 * Restores the state of the wizard from previous invocations
353
	 */
354
	private void restoreWidgetState() {
355
		IDialogSettings settings = getDialogSettings();
356
		if(settings != null) {
357
			String location = settings.get(FOLDER_NAME);
358
			if (location != null && location.length() > 0){
359
				previousLocation = location;
360
			}
361
			String useDefaults = settings.get(USE_DEFAULT);
362
			if (useDefaults != null){
363
				boolean useDefaultsBoolean = Boolean.valueOf(useDefaults).booleanValue();
364
				fUseDefaultsButton.setSelection(useDefaultsBoolean);
365
				if (!useDefaultsBoolean){
366
					fInstallLocation.setText(previousLocation);
367
					fInstallLocation.setEnabled(true);
368
					fBrowseButton.setEnabled(true);
369
					
370
				}
371
			}
372
			fClearContentsButton.setSelection(Boolean.valueOf(settings.get(CLEAR_CONTENTS)).booleanValue());
373
		}
374
	}
375
376
	/**
377
	 * @return the list of installable units to download on finish
378
	 */
379
	public IInstallableUnit[] getUnits() {
380
		return fUnits;
381
	}
382
383
	/**
384
	 * @param createIfDefault whether to create the directory structure if it doesn't exist, only occurs if default is used
385
	 * @return the location where installable units should be downloaded to
386
	 */
387
	public File getDownloadLocation(boolean createIfDefault) {
388
		if (fInstallLocation.getText().trim().length() > 0) {
389
			File file = new File(fInstallLocation.getText());
390
			if (createIfDefault && fUseDefaultsButton.getSelection() && !file.isDirectory()) {
391
				file.mkdirs();
392
			}
393
			return file;
394
		}
395
		return null;
396
	}
397
398
	/**
399
	 * @return whether contents of the download location should be deleted before starting the download
400
	 */
401
	public boolean isClearContentsBeforeDownloading() {
402
		return fClearContentsButton.getSelection();
403
	}
404
405
}
(-).settings/org.eclipse.jdt.core.prefs (+344 lines)
Added Link Here
1
#Wed Jan 02 10:06:25 CST 2008
2
eclipse.preferences.version=1
3
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
4
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
5
org.eclipse.jdt.core.builder.invalidClasspath=abort
6
org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
7
org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
8
org.eclipse.jdt.core.circularClasspath=error
9
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
10
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
11
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
12
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
13
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
14
org.eclipse.jdt.core.compiler.compliance=1.4
15
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
16
org.eclipse.jdt.core.compiler.debug.localVariable=generate
17
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
18
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
19
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
20
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
21
org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
22
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
23
org.eclipse.jdt.core.compiler.problem.deprecation=warning
24
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
25
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
26
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
27
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
28
org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
29
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
30
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
31
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
32
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
33
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
34
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
35
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
36
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
37
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
38
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
39
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
40
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
41
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
42
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
43
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
44
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
45
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
46
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
47
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
48
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
49
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
50
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
51
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
52
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
53
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
54
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
55
org.eclipse.jdt.core.compiler.problem.nullReference=warning
56
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
57
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
58
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
59
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
60
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
61
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
62
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
63
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
64
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
65
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
66
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
67
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
68
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
69
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
70
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
71
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
72
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
73
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
74
org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
75
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
76
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
77
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
78
org.eclipse.jdt.core.compiler.problem.unusedImport=error
79
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
80
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
81
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
82
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
83
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
84
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
85
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
86
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
87
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
88
org.eclipse.jdt.core.compiler.source=1.3
89
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
90
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
91
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
92
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
93
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
94
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
95
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
96
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
97
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
98
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
99
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
100
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
101
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
102
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
103
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
104
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
105
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
106
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
107
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
108
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
109
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
110
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
111
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
112
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
113
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
114
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
115
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
116
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
117
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
118
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
119
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
120
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
121
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
122
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
123
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
124
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
125
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
126
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
127
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
128
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
129
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
130
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
131
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
132
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
133
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
134
org.eclipse.jdt.core.formatter.comment.format_block_comments=false
135
org.eclipse.jdt.core.formatter.comment.format_header=false
136
org.eclipse.jdt.core.formatter.comment.format_html=true
137
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
138
org.eclipse.jdt.core.formatter.comment.format_line_comments=false
139
org.eclipse.jdt.core.formatter.comment.format_source_code=true
140
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
141
org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
142
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
143
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
144
org.eclipse.jdt.core.formatter.comment.line_length=80
145
org.eclipse.jdt.core.formatter.compact_else_if=true
146
org.eclipse.jdt.core.formatter.continuation_indentation=2
147
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
148
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
149
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
150
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
151
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
152
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
153
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
154
org.eclipse.jdt.core.formatter.indent_empty_lines=false
155
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
156
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
157
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
158
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
159
org.eclipse.jdt.core.formatter.indentation.size=4
160
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
161
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
162
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
163
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
164
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
165
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
166
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
167
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
168
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
169
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
170
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
171
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
172
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
173
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
174
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
175
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
176
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
177
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
178
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
179
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
180
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
181
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
182
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
183
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
184
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
185
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
186
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
187
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
188
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
189
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
190
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
191
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
192
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
193
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
194
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
195
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
196
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
197
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
198
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
199
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
200
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
201
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
202
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
203
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
204
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
205
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
206
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
207
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
208
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
209
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
210
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
211
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
212
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
213
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
214
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
215
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
216
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
217
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
218
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
219
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
220
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
221
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
222
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
223
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
224
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
225
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
226
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
227
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
228
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
229
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
230
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
231
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
232
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
233
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
234
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
235
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
236
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
237
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
238
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
239
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
240
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
241
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
242
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
243
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
244
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
245
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
246
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
247
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
248
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
249
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
250
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
251
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
252
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
253
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
254
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
255
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
256
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
257
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
258
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert
259
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
260
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert
261
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
262
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
263
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
264
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
265
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
266
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
267
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
268
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
269
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
270
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
271
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
272
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
273
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
274
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
275
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
276
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
277
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
278
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
279
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
280
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
281
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
282
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
283
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
284
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
285
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
286
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
287
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
288
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
289
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
290
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
291
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
292
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
293
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
294
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
295
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
296
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
297
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
298
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
299
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
300
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
301
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
302
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
303
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
304
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
305
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
306
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
307
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
308
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
309
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
310
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
311
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
312
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
313
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
314
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
315
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
316
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
317
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
318
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
319
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
320
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
321
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
322
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
323
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
324
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
325
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
326
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
327
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
328
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
329
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
330
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
331
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
332
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
333
org.eclipse.jdt.core.formatter.lineSplit=800
334
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
335
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
336
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
337
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
338
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
339
org.eclipse.jdt.core.formatter.tabulation.char=tab
340
org.eclipse.jdt.core.formatter.tabulation.size=4
341
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
342
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
343
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
344
org.eclipse.jdt.core.incompleteClasspath=error
(-)src/org/eclipse/pde/internal/p2/ui/SWTUtil.java (+98 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.pde.internal.p2.ui;
12
13
import org.eclipse.core.runtime.Assert;
14
import org.eclipse.jface.dialogs.Dialog;
15
import org.eclipse.jface.dialogs.IDialogConstants;
16
import org.eclipse.jface.resource.JFaceResources;
17
import org.eclipse.swt.SWT;
18
import org.eclipse.swt.dnd.DragSource;
19
import org.eclipse.swt.dnd.DropTarget;
20
import org.eclipse.swt.graphics.Point;
21
import org.eclipse.swt.layout.GridData;
22
import org.eclipse.swt.widgets.*;
23
24
/**
25
 * Utility class to simplify access to some SWT resources. 
26
 */
27
public class SWTUtil {
28
29
	/**
30
	 * Returns the standard display to be used. The method first checks, if
31
	 * the thread calling this method has an associated disaply. If so, this
32
	 * display is returned. Otherwise the method returns the default display.
33
	 */
34
	public static Display getStandardDisplay() {
35
		Display display;
36
		display = Display.getCurrent();
37
		if (display == null)
38
			display = Display.getDefault();
39
		return display;
40
	}
41
42
	/**
43
	 * Returns the shell for the given widget. If the widget doesn't represent
44
	 * a SWT object that manage a shell, <code>null</code> is returned.
45
	 * 
46
	 * @return the shell for the given widget
47
	 */
48
	public static Shell getShell(Widget widget) {
49
		if (widget instanceof Control)
50
			return ((Control) widget).getShell();
51
		if (widget instanceof Caret)
52
			return ((Caret) widget).getParent().getShell();
53
		if (widget instanceof DragSource)
54
			return ((DragSource) widget).getControl().getShell();
55
		if (widget instanceof DropTarget)
56
			return ((DropTarget) widget).getControl().getShell();
57
		if (widget instanceof Menu)
58
			return ((Menu) widget).getParent().getShell();
59
		if (widget instanceof ScrollBar)
60
			return ((ScrollBar) widget).getParent().getShell();
61
62
		return null;
63
	}
64
65
	/**
66
	 * Returns a width hint for a button control.
67
	 */
68
	public static int getButtonWidthHint(Button button) {
69
		if (button.getFont().equals(JFaceResources.getDefaultFont()))
70
			button.setFont(JFaceResources.getDialogFont());
71
		PixelConverter converter = new PixelConverter(button);
72
		int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
73
		return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
74
	}
75
76
	/**
77
	 * Sets width and height hint for the button control.
78
	 * <b>Note:</b> This is a NOP if the button's layout data is not
79
	 * an instance of <code>GridData</code>.
80
	 * 
81
	 * @param	the button for which to set the dimension hint
82
	 */
83
	public static void setButtonDimensionHint(Button button) {
84
		Dialog.applyDialogFont(button);
85
		Assert.isNotNull(button);
86
		Object gd = button.getLayoutData();
87
		if (gd instanceof GridData) {
88
			((GridData) gd).widthHint = getButtonWidthHint(button);
89
		}
90
	}
91
92
	public static void setDialogSize(Dialog dialog, int width, int height) {
93
		Point computedSize = dialog.getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
94
		width = Math.max(computedSize.x, width);
95
		height = Math.max(computedSize.y, height);
96
		dialog.getShell().setSize(width, height);
97
	}
98
}
(-)build.properties (+6 lines)
Added Link Here
1
source.. = src/
2
output.. = bin/
3
bin.includes = META-INF/,\
4
               .,\
5
               plugin.xml,\
6
               plugin.properties
(-).project (+28 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>org.eclipse.pde.p2.ui</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>org.eclipse.jdt.core.javabuilder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
		<buildCommand>
14
			<name>org.eclipse.pde.ManifestBuilder</name>
15
			<arguments>
16
			</arguments>
17
		</buildCommand>
18
		<buildCommand>
19
			<name>org.eclipse.pde.SchemaBuilder</name>
20
			<arguments>
21
			</arguments>
22
		</buildCommand>
23
	</buildSpec>
24
	<natures>
25
		<nature>org.eclipse.pde.PluginNature</nature>
26
		<nature>org.eclipse.jdt.core.javanature</nature>
27
	</natures>
28
</projectDescription>
(-)plugin.properties (+14 lines)
Added Link Here
1
###############################################################################
2
# Copyright (c) 2008 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
#
8
# Contributors:
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
11
#Properties file for org.eclipse.pde.p2.ui
12
Bundle-Name.0 = PDE p2 UI
13
provisioner.name.0 = Repository or Update Site
14
provisioner.description.0 = This provisioner adds new plug-ins from repositories and update sites into your target platform.

Return to bug 204347