Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2005, 2007 IBM Corporation and others. |
2 |
* Copyright (c) 2005, 2008 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 10-17
Link Here
|
10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.pde.internal.ui.editor.product; |
11 |
package org.eclipse.pde.internal.ui.editor.product; |
12 |
|
12 |
|
13 |
import org.eclipse.pde.internal.ui.dialogs.FeatureSelectionDialog; |
|
|
14 |
|
15 |
import java.util.ArrayList; |
13 |
import java.util.ArrayList; |
16 |
import org.eclipse.jface.action.*; |
14 |
import org.eclipse.jface.action.*; |
17 |
import org.eclipse.jface.util.IPropertyChangeListener; |
15 |
import org.eclipse.jface.util.IPropertyChangeListener; |
Lines 27-32
Link Here
|
27 |
import org.eclipse.pde.internal.core.iproduct.*; |
25 |
import org.eclipse.pde.internal.core.iproduct.*; |
28 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
26 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
29 |
import org.eclipse.pde.internal.ui.PDEUIMessages; |
27 |
import org.eclipse.pde.internal.ui.PDEUIMessages; |
|
|
28 |
import org.eclipse.pde.internal.ui.dialogs.FeatureSelectionDialog; |
30 |
import org.eclipse.pde.internal.ui.editor.*; |
29 |
import org.eclipse.pde.internal.ui.editor.*; |
31 |
import org.eclipse.pde.internal.ui.editor.actions.SortAction; |
30 |
import org.eclipse.pde.internal.ui.editor.actions.SortAction; |
32 |
import org.eclipse.pde.internal.ui.editor.feature.FeatureEditor; |
31 |
import org.eclipse.pde.internal.ui.editor.feature.FeatureEditor; |
Lines 61-75
Link Here
|
61 |
} |
60 |
} |
62 |
|
61 |
|
63 |
private static String[] getButtonLabels() { |
62 |
private static String[] getButtonLabels() { |
64 |
String[] labels = new String[8]; |
63 |
String[] labels = new String[9]; |
65 |
labels[0] = PDEUIMessages.Product_FeatureSection_add; |
64 |
labels[0] = PDEUIMessages.Product_FeatureSection_add; |
66 |
labels[1] = PDEUIMessages.Product_FeatureSection_remove; |
65 |
labels[1] = PDEUIMessages.Product_FeatureSection_remove; |
67 |
labels[2] = PDEUIMessages.Product_PluginSection_removeAll; |
66 |
labels[2] = PDEUIMessages.Product_PluginSection_removeAll; |
68 |
labels[3] = PDEUIMessages.Product_FeatureSection_up; |
67 |
labels[3] = PDEUIMessages.Product_FeatureSection_properties; |
69 |
labels[4] = PDEUIMessages.Product_FeatureSection_down; |
68 |
labels[4] = PDEUIMessages.Product_FeatureSection_up; |
70 |
labels[5] = null; |
69 |
labels[5] = PDEUIMessages.Product_FeatureSection_down; |
71 |
labels[6] = null; |
70 |
labels[6] = null; |
72 |
labels[7] = PDEUIMessages.Product_FeatureSection_newFeature; |
71 |
labels[7] = null; |
|
|
72 |
labels[8] = PDEUIMessages.Product_FeatureSection_newFeature; |
73 |
return labels; |
73 |
return labels; |
74 |
} |
74 |
} |
75 |
|
75 |
|
Lines 102-108
Link Here
|
102 |
|
102 |
|
103 |
tablePart.setButtonEnabled(3, isEditable()); |
103 |
tablePart.setButtonEnabled(3, isEditable()); |
104 |
tablePart.setButtonEnabled(4, isEditable()); |
104 |
tablePart.setButtonEnabled(4, isEditable()); |
105 |
tablePart.setButtonEnabled(7, isEditable()); |
105 |
tablePart.setButtonEnabled(5, isEditable()); |
|
|
106 |
tablePart.setButtonEnabled(8, isEditable()); |
106 |
|
107 |
|
107 |
toolkit.paintBordersFor(container); |
108 |
toolkit.paintBordersFor(container); |
108 |
section.setClient(container); |
109 |
section.setClient(container); |
Lines 154-169
Link Here
|
154 |
handleRemoveAll(); |
155 |
handleRemoveAll(); |
155 |
break; |
156 |
break; |
156 |
case 3 : |
157 |
case 3 : |
157 |
handleUp(); |
158 |
handleProperties(); |
158 |
break; |
159 |
break; |
159 |
case 4 : |
160 |
case 4 : |
|
|
161 |
handleUp(); |
162 |
break; |
163 |
case 5 : |
160 |
handleDown(); |
164 |
handleDown(); |
161 |
break; |
165 |
break; |
162 |
case 7 : |
166 |
case 8 : |
163 |
handleNewFeature(); |
167 |
handleNewFeature(); |
164 |
} |
168 |
} |
165 |
} |
169 |
} |
166 |
|
170 |
|
|
|
171 |
private void handleProperties() { |
172 |
IStructuredSelection ssel = (IStructuredSelection) fFeatureTable.getSelection(); |
173 |
if (ssel.size() == 1) { |
174 |
IProductFeature feature = (IProductFeature) ssel.toArray()[0]; |
175 |
VersionDialog dialog = new VersionDialog(PDEPlugin.getActiveWorkbenchShell(), isEditable(), feature.getVersion()); |
176 |
dialog.create(); |
177 |
SWTUtil.setDialogSize(dialog, 400, 200); |
178 |
if (dialog.open() == Window.OK) { |
179 |
feature.setVersion(dialog.getVersion()); |
180 |
} |
181 |
} |
182 |
} |
183 |
|
167 |
private void handleNewFeature() { |
184 |
private void handleNewFeature() { |
168 |
NewFeatureProjectWizard wizard = new NewFeatureProjectWizard(); |
185 |
NewFeatureProjectWizard wizard = new NewFeatureProjectWizard(); |
169 |
WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); |
186 |
WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); |