Lines 18-23
Link Here
|
18 |
import org.eclipse.core.runtime.IStatus; |
18 |
import org.eclipse.core.runtime.IStatus; |
19 |
import org.eclipse.core.runtime.Status; |
19 |
import org.eclipse.core.runtime.Status; |
20 |
import org.eclipse.jface.viewers.IFilter; |
20 |
import org.eclipse.jface.viewers.IFilter; |
|
|
21 |
import org.eclipse.ui.SelectionEnabler; |
21 |
import org.eclipse.ui.internal.views.properties.tabbed.TabbedPropertyViewPlugin; |
22 |
import org.eclipse.ui.internal.views.properties.tabbed.TabbedPropertyViewPlugin; |
22 |
import org.eclipse.ui.internal.views.properties.tabbed.TabbedPropertyViewStatusCodes; |
23 |
import org.eclipse.ui.internal.views.properties.tabbed.TabbedPropertyViewStatusCodes; |
23 |
import org.eclipse.ui.internal.views.properties.tabbed.l10n.TabbedPropertyMessages; |
24 |
import org.eclipse.ui.internal.views.properties.tabbed.l10n.TabbedPropertyMessages; |
Lines 64-69
Link Here
|
64 |
|
65 |
|
65 |
private int enablesFor = ENABLES_FOR_ANY; |
66 |
private int enablesFor = ENABLES_FOR_ANY; |
66 |
|
67 |
|
|
|
68 |
private SelectionEnabler selectionEnabler; |
69 |
|
67 |
private IConfigurationElement configurationElement; |
70 |
private IConfigurationElement configurationElement; |
68 |
|
71 |
|
69 |
/** |
72 |
/** |
Lines 86-94
Link Here
|
86 |
if (getConfigurationElement().getAttribute(ATT_SECTION_ENABLES_FOR) != null) { |
89 |
if (getConfigurationElement().getAttribute(ATT_SECTION_ENABLES_FOR) != null) { |
87 |
String enablesForStr = getConfigurationElement().getAttribute( |
90 |
String enablesForStr = getConfigurationElement().getAttribute( |
88 |
ATT_SECTION_ENABLES_FOR); |
91 |
ATT_SECTION_ENABLES_FOR); |
89 |
int enablesForTest = Integer.parseInt(enablesForStr); |
92 |
try{ |
90 |
if (enablesForTest > 0) { |
93 |
int enablesForTest = Integer.parseInt(enablesForStr); |
91 |
enablesFor = enablesForTest; |
94 |
if (enablesForTest > 0) { |
|
|
95 |
enablesFor = enablesForTest; |
96 |
} |
97 |
} catch (NumberFormatException nfe) { |
98 |
enablesFor = ENABLES_FOR_ANY; |
92 |
} |
99 |
} |
93 |
} |
100 |
} |
94 |
|
101 |
|
Lines 156-167
Link Here
|
156 |
* 4 items are selected. If not specified, enable for all selections. |
163 |
* 4 items are selected. If not specified, enable for all selections. |
157 |
* |
164 |
* |
158 |
* @return the value for section enablement. |
165 |
* @return the value for section enablement. |
|
|
166 |
* @deprecated {@link org.eclipse.ui.views.properties.tabbed.ISectionDescriptor#getEnablesFor()} |
159 |
*/ |
167 |
*/ |
160 |
public int getEnablesFor() { |
168 |
public int getEnablesFor() { |
161 |
return enablesFor; |
169 |
return enablesFor; |
162 |
} |
170 |
} |
163 |
|
171 |
|
164 |
/** |
172 |
/** |
|
|
173 |
* @see org.eclipse.ui.views.properties.tabbed.ISectionDescriptor#getSelectionEnabler() |
174 |
*/ |
175 |
public SelectionEnabler getSelectionEnabler() { |
176 |
if (selectionEnabler == null) { |
177 |
selectionEnabler = new SelectionEnabler(configurationElement); |
178 |
} |
179 |
return selectionEnabler; |
180 |
} |
181 |
|
182 |
/** |
165 |
* @see org.eclipse.ui.views.properties.tabbed.ISectionDescriptor#getTargetTab() |
183 |
* @see org.eclipse.ui.views.properties.tabbed.ISectionDescriptor#getTargetTab() |
166 |
*/ |
184 |
*/ |
167 |
public String getTargetTab() { |
185 |
public String getTargetTab() { |
Lines 227-230
Link Here
|
227 |
private IConfigurationElement getConfigurationElement() { |
245 |
private IConfigurationElement getConfigurationElement() { |
228 |
return configurationElement; |
246 |
return configurationElement; |
229 |
} |
247 |
} |
|
|
248 |
|
230 |
} |
249 |
} |