diff options
author | Eike Stepper | 2013-10-25 11:00:57 +0000 |
---|---|---|
committer | Eike Stepper | 2013-10-25 11:00:57 +0000 |
commit | 09aee65510418cc81c7ca8523256b78aec78fe7e (patch) | |
tree | 9521806253d7b76b1e1712b40b022666f27244c2 | |
parent | b968cd8b2a2f79e59101a93a28b7f2b8b7d848de (diff) | |
download | cdo-09aee65510418cc81c7ca8523256b78aec78fe7e.tar.gz cdo-09aee65510418cc81c7ca8523256b78aec78fe7e.tar.xz cdo-09aee65510418cc81c7ca8523256b78aec78fe7e.zip |
Improve setup related models
3 files changed, 50 insertions, 6 deletions
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java index 00e0926839..64b626a937 100644 --- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java +++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/internal/setup/SetupTaskPerformer.java @@ -428,7 +428,6 @@ public class SetupTaskPerformer extends HashMap<Object, Object> implements Setup if (Activator.SETUP_IDE && trigger != Trigger.MANUAL) { Shell shell = PlatformUI.getWorkbench().getWorkbenchWindows()[0].getShell(); - ProgressLogDialog.run(shell, "Setting up IDE", new ProgressLogRunnable() { public boolean run(ProgressLog log) throws Exception diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/EclipsePreferenceTaskImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/EclipsePreferenceTaskImpl.java index 68132cfd68..8dc183bfeb 100644 --- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/EclipsePreferenceTaskImpl.java +++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/EclipsePreferenceTaskImpl.java @@ -21,6 +21,7 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.eclipse.ui.PlatformUI; @@ -129,7 +130,9 @@ public class EclipsePreferenceTaskImpl extends SetupTaskImpl implements EclipseP String oldKey = key; key = newKey; if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.ECLIPSE_PREFERENCE_TASK__KEY, oldKey, key)); + } } /** @@ -152,8 +155,10 @@ public class EclipsePreferenceTaskImpl extends SetupTaskImpl implements EclipseP String oldValue = value; value = newValue; if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.ECLIPSE_PREFERENCE_TASK__VALUE, oldValue, value)); + } } /** @@ -241,7 +246,9 @@ public class EclipsePreferenceTaskImpl extends SetupTaskImpl implements EclipseP public String toString() { if (eIsProxy()) + { return super.toString(); + } StringBuffer result = new StringBuffer(super.toString()); result.append(" (key: "); @@ -255,7 +262,7 @@ public class EclipsePreferenceTaskImpl extends SetupTaskImpl implements EclipseP @Override public Object getOverrideToken() { - return createToken(getKey()); + return createToken(new Path(getKey()).makeAbsolute().toString()); } @Override diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/KeyBindingTaskImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/KeyBindingTaskImpl.java index b3ddfda5e1..91ead02e25 100644 --- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/KeyBindingTaskImpl.java +++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/KeyBindingTaskImpl.java @@ -31,12 +31,15 @@ import org.eclipse.core.commands.Command; import org.eclipse.core.commands.ParameterizedCommand; import org.eclipse.core.commands.common.NotDefinedException; import org.eclipse.jface.bindings.Binding; +import org.eclipse.jface.bindings.Scheme; import org.eclipse.jface.bindings.keys.KeyBinding; import org.eclipse.jface.bindings.keys.KeySequence; +import org.eclipse.swt.widgets.Display; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.commands.ICommandService; import org.eclipse.ui.keys.IBindingService; +import java.io.IOException; import java.util.Collection; import java.util.HashMap; import java.util.Map; @@ -234,7 +237,9 @@ public class KeyBindingTaskImpl extends SetupTaskImpl implements KeyBindingTask String oldScheme = scheme; scheme = newScheme; if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.KEY_BINDING_TASK__SCHEME, oldScheme, scheme)); + } } /** @@ -257,7 +262,9 @@ public class KeyBindingTaskImpl extends SetupTaskImpl implements KeyBindingTask String oldContext = context; context = newContext; if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.KEY_BINDING_TASK__CONTEXT, oldContext, context)); + } } /** @@ -280,8 +287,10 @@ public class KeyBindingTaskImpl extends SetupTaskImpl implements KeyBindingTask String oldPlatform = platform; platform = newPlatform; if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.KEY_BINDING_TASK__PLATFORM, oldPlatform, platform)); + } } /** @@ -304,7 +313,9 @@ public class KeyBindingTaskImpl extends SetupTaskImpl implements KeyBindingTask String oldLocale = locale; locale = newLocale; if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.KEY_BINDING_TASK__LOCALE, oldLocale, locale)); + } } /** @@ -327,7 +338,9 @@ public class KeyBindingTaskImpl extends SetupTaskImpl implements KeyBindingTask String oldKeys = keys; keys = newKeys; if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.KEY_BINDING_TASK__KEYS, oldKeys, keys)); + } } /** @@ -350,7 +363,9 @@ public class KeyBindingTaskImpl extends SetupTaskImpl implements KeyBindingTask String oldCommand = command; command = newCommand; if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, SetupPackage.KEY_BINDING_TASK__COMMAND, oldCommand, command)); + } } /** @@ -521,7 +536,9 @@ public class KeyBindingTaskImpl extends SetupTaskImpl implements KeyBindingTask public String toString() { if (eIsProxy()) + { return super.toString(); + } StringBuffer result = new StringBuffer(super.toString()); result.append(" (scheme: "); @@ -578,7 +595,8 @@ public class KeyBindingTaskImpl extends SetupTaskImpl implements KeyBindingTask continue; } - if (!ObjectUtil.equals(keyBinding.getKeySequence(), KeySequence.getInstance(getKeys()))) + KeySequence keySequence = KeySequence.getInstance(getKeys()); + if (!ObjectUtil.equals(keyBinding.getKeySequence(), keySequence)) { continue; } @@ -606,14 +624,34 @@ public class KeyBindingTaskImpl extends SetupTaskImpl implements KeyBindingTask KeyBinding binding = new KeyBinding(KeySequence.getInstance(getKeys()), getParameterizedCommand(), getScheme(), getContext(), getLocale(), getPlatform(), null, Binding.USER); - IBindingService bindingService = (IBindingService)PlatformUI.getWorkbench().getService(IBindingService.class); + final IBindingService bindingService = (IBindingService)PlatformUI.getWorkbench().getService(IBindingService.class); Binding[] bindings = bindingService.getBindings(); - Binding[] newBindings = new Binding[bindings.length + 1]; + final Binding[] newBindings = new Binding[bindings.length + 1]; System.arraycopy(bindings, 0, newBindings, 0, bindings.length); newBindings[bindings.length] = binding; - bindingService.savePreferences(bindingService.getActiveScheme(), newBindings); + final Exception[] exception = { null }; + Display.getDefault().syncExec(new Runnable() + { + public void run() + { + try + { + Scheme activeScheme = bindingService.getActiveScheme(); + bindingService.savePreferences(activeScheme, newBindings); + } + catch (IOException ex) + { + exception[0] = ex; + } + } + }); + + if (exception[0] != null) + { + throw exception[0]; + } } private ParameterizedCommand getParameterizedCommand() throws NotDefinedException |