diff options
| author | Paul Pazderski | 2019-03-04 10:08:52 +0000 |
|---|---|---|
| committer | Paul Pazderski | 2019-11-07 10:11:29 +0000 |
| commit | 38d12e3702baa5efc872a1c3c82c0126a8b1a858 (patch) | |
| tree | 50a804700d26a9d971ae5cbc6c5a43d8b56a4a7f | |
| parent | aac63d10ac3fab0ea5097501e0850ede86487ff8 (diff) | |
| download | eclipse.platform.ui-38d12e3702baa5efc872a1c3c82c0126a8b1a858.tar.gz eclipse.platform.ui-38d12e3702baa5efc872a1c3c82c0126a8b1a858.tar.xz eclipse.platform.ui-38d12e3702baa5efc872a1c3c82c0126a8b1a858.zip | |
Bug 552350 - Allow setting the action proxy's enable state
Change-Id: Ia49f81c44e6c243071e344c76c86d71c415937c8
Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
4 files changed, 23 insertions, 4 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginAction.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginAction.java index ce10535de8b..4d27cd4d0c6 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginAction.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginAction.java @@ -94,6 +94,13 @@ public abstract class PluginAction extends Action pluginId = configElement.getContributor().getName(); + // read initialEnabled attribute + String initialEnabledAttr = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_INITIAL_ENABLED); + if (initialEnabledAttr != null) { + boolean initialEnabled = Boolean.parseBoolean(initialEnabledAttr); + setEnabled(initialEnabled); + } + // Read enablement declaration. if (configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ENABLES_FOR) != null) { enabler = new SelectionEnabler(configElement); diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/IWorkbenchRegistryConstants.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/IWorkbenchRegistryConstants.java index ca563cb800d..00d796af99b 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/IWorkbenchRegistryConstants.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/IWorkbenchRegistryConstants.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2018 IBM Corporation and others. + * Copyright (c) 2004, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -252,6 +252,11 @@ public interface IWorkbenchRegistryConstants { String ATT_IMAGE_STYLE = "imageStyle"; //$NON-NLS-1$ /** + * Action attribute. Value <code>initialEnabled</code>. + */ + String ATT_INITIAL_ENABLED = "initialEnabled"; //$NON-NLS-1$ + + /** * Is-editable attribute. Value <code>isEditable</code>. */ String ATT_IS_EDITABLE = "isEditable"; //$NON-NLS-1$ diff --git a/bundles/org.eclipse.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui/META-INF/MANIFEST.MF index 3a1edc2ff52..4d30e64df58 100644 --- a/bundles/org.eclipse.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Plugin.name Bundle-SymbolicName: org.eclipse.ui; singleton:=true -Bundle-Version: 3.114.100.qualifier +Bundle-Version: 3.115.0.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.ui.internal.UIPlugin Bundle-ActivationPolicy: lazy @@ -12,7 +12,7 @@ Export-Package: org.eclipse.ui.internal;x-internal:=true Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", org.eclipse.swt;bundle-version="[3.103.0,4.0.0)";visibility:=reexport, org.eclipse.jface;bundle-version="[3.15.0,4.0.0)";visibility:=reexport, - org.eclipse.ui.workbench;bundle-version="[3.115.100,4.0.0)";visibility:=reexport, + org.eclipse.ui.workbench;bundle-version="[3.117.0,4.0.0)";visibility:=reexport, org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Automatic-Module-Name: org.eclipse.ui diff --git a/bundles/org.eclipse.ui/schema/actionSets.exsd b/bundles/org.eclipse.ui/schema/actionSets.exsd index f37989e081c..943565b4cf4 100644 --- a/bundles/org.eclipse.ui/schema/actionSets.exsd +++ b/bundles/org.eclipse.ui/schema/actionSets.exsd @@ -373,6 +373,13 @@ If omitted and the action appears in the toolbar, the Workbench will use a place </restriction> </simpleType> </attribute> + <attribute name="initialEnabled" type="boolean"> + <annotation> + <documentation> + The initial enablement state of this action until the plugin is loaded and the delegate can provide its real enablement state. Is overwritten by enablesFor or enablement tag if specified. Defaults to true if omitted. + </documentation> + </annotation> + </attribute> </complexType> </element> @@ -577,7 +584,7 @@ extensions are also added automatically to the window. <meta.section type="copyright"/> </appInfo> <documentation> - Copyright (c) 2000, 2011 IBM Corporation and others.<br> + Copyright (c) 2000, 2019 IBM Corporation and others.<br> This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which accompanies |
