summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-15 03:48:50 (EDT)
committerEike Stepper2007-07-15 03:48:50 (EDT)
commit457fe4ac62e5bf259b6642d47780c5b5232991f5 (patch)
tree476f237aef99142edd8e164686210eeaba163cc3
parent17d5bc0b2eb45ce7e4f3ce158086a0553216efb8 (diff)
downloadcdo-457fe4ac62e5bf259b6642d47780c5b5232991f5.zip
cdo-457fe4ac62e5bf259b6642d47780c5b5232991f5.tar.gz
cdo-457fe4ac62e5bf259b6642d47780c5b5232991f5.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/SharedIcons.java (renamed from plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/bundle/SharedIcons.java)4
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java2
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/SharedIcons.java (renamed from plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/bundle/SharedIcons.java)4
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/bundle/OM.java6
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/ConnectorsView.java17
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/Net4jItemProvider.java2
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/views/ContainerView.java2
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java6
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/OM.java3
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/pref/Preferences.java37
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/OSGiActivator.java6
12 files changed, 47 insertions, 44 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/bundle/SharedIcons.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/SharedIcons.java
index 36204f0..b55ed9f 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/bundle/SharedIcons.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/SharedIcons.java
@@ -8,7 +8,9 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.cdo.internal.ui.bundle;
+package org.eclipse.emf.cdo.internal.ui;
+
+import org.eclipse.emf.cdo.internal.ui.bundle.OM;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java
index e175ed5..1879e84 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java
@@ -12,7 +12,7 @@ package org.eclipse.emf.cdo.internal.ui.editor;
import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.CDOView;
-import org.eclipse.emf.cdo.internal.ui.bundle.SharedIcons;
+import org.eclipse.emf.cdo.internal.ui.SharedIcons;
import org.eclipse.net4j.IConnector;
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java
index 0f782d3..cb892a9 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java
@@ -15,7 +15,7 @@ import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.CDOViewCommittedEvent;
import org.eclipse.emf.cdo.CDOViewDirtyEvent;
import org.eclipse.emf.cdo.CDOViewEvent;
-import org.eclipse.emf.cdo.internal.ui.bundle.SharedIcons;
+import org.eclipse.emf.cdo.internal.ui.SharedIcons;
import org.eclipse.emf.cdo.internal.ui.editor.CDOEditor;
import org.eclipse.emf.cdo.internal.ui.views.CDOViewHistory.Entry;
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/bundle/SharedIcons.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/SharedIcons.java
index e415071..b4b2e1d 100644
--- a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/bundle/SharedIcons.java
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/SharedIcons.java
@@ -8,7 +8,9 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.internal.ui.bundle;
+package org.eclipse.net4j.internal.ui;
+
+import org.eclipse.net4j.internal.ui.bundle.OM;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/bundle/OM.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/bundle/OM.java
index 16779a3..590c02f 100644
--- a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/bundle/OM.java
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/bundle/OM.java
@@ -14,8 +14,6 @@ import org.eclipse.net4j.util.om.OMBundle;
import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.net4j.util.om.OSGiActivator;
import org.eclipse.net4j.util.om.log.OMLogger;
-import org.eclipse.net4j.util.om.pref.OMPreference;
-import org.eclipse.net4j.util.om.pref.OMPreferences;
import org.eclipse.net4j.util.om.trace.OMTracer;
/**
@@ -31,10 +29,6 @@ public abstract class OM
public static final OMLogger LOG = BUNDLE.logger();
- public static final OMPreferences PREFS = BUNDLE.preferences();
-
- public static final OMPreference<String> PREF_TEXT = PREFS.initString("text");
-
/**
* @author Eike Stepper
*/
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/ConnectorsView.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/ConnectorsView.java
index fb4f205..138bc77 100644
--- a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/ConnectorsView.java
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/ConnectorsView.java
@@ -3,16 +3,13 @@ package org.eclipse.net4j.internal.ui.views;
import org.eclipse.net4j.IConnector;
import org.eclipse.net4j.IPluginTransportContainer;
import org.eclipse.net4j.ITransportContainer;
-import org.eclipse.net4j.internal.ui.bundle.OM;
import org.eclipse.net4j.ui.actions.SafeAction;
import org.eclipse.net4j.ui.views.ContainerItemProvider;
import org.eclipse.net4j.ui.views.ContainerView;
import org.eclipse.net4j.ui.views.IElementFilter;
-import org.eclipse.net4j.util.om.pref.OMPreference;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.dialogs.InputDialog;
public class ConnectorsView extends ContainerView
{
@@ -51,20 +48,6 @@ public class ConnectorsView extends ContainerView
protected void fillLocalToolBar(IToolBarManager manager)
{
manager.add(addConnectorAction);
- manager.add(new SafeAction("PREFS")
- {
- @Override
- protected void doRun() throws Exception
- {
- OMPreference<String> pref = OM.PREF_TEXT;
- InputDialog dlg = new InputDialog(getSite().getShell(), "PREFS", "Enter a text:", pref.getValue(), null);
- if (dlg.open() == InputDialog.OK)
- {
- pref.setValue(dlg.getValue());
- }
- }
- });
-
super.fillLocalToolBar(manager);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/Net4jItemProvider.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/Net4jItemProvider.java
index b948935..7bbca94 100644
--- a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/Net4jItemProvider.java
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/Net4jItemProvider.java
@@ -13,7 +13,7 @@ package org.eclipse.net4j.internal.ui.views;
import org.eclipse.net4j.IAcceptor;
import org.eclipse.net4j.IChannel;
import org.eclipse.net4j.IConnector;
-import org.eclipse.net4j.internal.ui.bundle.SharedIcons;
+import org.eclipse.net4j.internal.ui.SharedIcons;
import org.eclipse.net4j.ui.actions.SafeAction;
import org.eclipse.net4j.ui.views.ContainerItemProvider;
import org.eclipse.net4j.ui.views.ContainerView;
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/views/ContainerView.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/views/ContainerView.java
index fb2c6cf..f785db6 100644
--- a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/views/ContainerView.java
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/views/ContainerView.java
@@ -1,7 +1,7 @@
package org.eclipse.net4j.ui.views;
import org.eclipse.net4j.ITransportContainer;
-import org.eclipse.net4j.internal.ui.bundle.SharedIcons;
+import org.eclipse.net4j.internal.ui.SharedIcons;
import org.eclipse.net4j.ui.actions.SafeAction;
import org.eclipse.jface.action.Action;
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java
index 4dbf862..77f10fa 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java
@@ -312,6 +312,12 @@ public abstract class AbstractBundle implements OMBundle
return MessageFormat.format(getString(key, translate), args);
}
+ @Override
+ public String toString()
+ {
+ return bundleID;
+ }
+
public void start() throws Exception
{
invokeMethod("start");
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/OM.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/OM.java
index 0230d67..3b0ada5 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/OM.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/OM.java
@@ -10,6 +10,7 @@
**************************************************************************/
package org.eclipse.net4j.internal.util.bundle;
+import org.eclipse.net4j.internal.util.om.OSGiBundle;
import org.eclipse.net4j.internal.util.om.log.EclipseLoggingBridge;
import org.eclipse.net4j.internal.util.om.log.PrintLogHandler;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
@@ -56,6 +57,7 @@ public abstract class OM
{
AbstractPlatform.systemContext = context;
OM.BUNDLE.setBundleContext(context);
+ ((OSGiBundle)OM.BUNDLE).start();
PrintTraceHandler.CONSOLE.setPattern("{6} [{0}] {5}");
AbstractPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
@@ -75,6 +77,7 @@ public abstract class OM
public void stop(BundleContext context) throws Exception
{
traceStop(context);
+ ((OSGiBundle)OM.BUNDLE).stop();
OM.BUNDLE.setBundleContext(null);
AbstractPlatform.systemContext = null;
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/pref/Preferences.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/pref/Preferences.java
index bd39e16..030cfad 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/pref/Preferences.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/pref/Preferences.java
@@ -136,62 +136,62 @@ public class Preferences extends Notifier implements OMPreferences
public OMPreference<Boolean> init(String name, boolean defaultValue)
{
- return new BooleanPreference(this, name, defaultValue);
+ return init(new BooleanPreference(this, name, defaultValue));
}
public OMPreference<Integer> init(String name, int defaultValue)
{
- return new IntegerPreference(this, name, defaultValue);
+ return init(new IntegerPreference(this, name, defaultValue));
}
public OMPreference<Long> init(String name, long defaultValue)
{
- return new LongPreference(this, name, defaultValue);
+ return init(new LongPreference(this, name, defaultValue));
}
public OMPreference<Float> init(String name, float defaultValue)
{
- return new FloatPreference(this, name, defaultValue);
+ return init(new FloatPreference(this, name, defaultValue));
}
public OMPreference<Double> init(String name, double defaultValue)
{
- return new DoublePreference(this, name, defaultValue);
+ return init(new DoublePreference(this, name, defaultValue));
}
public OMPreference<String> init(String name, String defaultValue)
{
- return new StringPreference(this, name, defaultValue);
+ return init(new StringPreference(this, name, defaultValue));
}
public OMPreference<Boolean> initBoolean(String name)
{
- return new BooleanPreference(this, name, DEFAULT_BOOLEAN);
+ return init(name, DEFAULT_BOOLEAN);
}
public OMPreference<Integer> initInteger(String name)
{
- return new IntegerPreference(this, name, DEFAULT_INTEGER);
+ return init(name, DEFAULT_INTEGER);
}
public OMPreference<Long> initLong(String name)
{
- return new LongPreference(this, name, DEFAULT_LONG);
+ return init(name, DEFAULT_LONG);
}
public OMPreference<Float> initFloat(String name)
{
- return new FloatPreference(this, name, DEFAULT_FLOAT);
+ return init(name, DEFAULT_FLOAT);
}
public OMPreference<Double> initDouble(String name)
{
- return new DoublePreference(this, name, DEFAULT_DOUBLE);
+ return init(name, DEFAULT_DOUBLE);
}
public OMPreference<String> initString(String name)
{
- return new StringPreference(this, name, DEFAULT_STRING);
+ return init(name, DEFAULT_STRING);
}
public OMPreference<Boolean> getBoolean(String name)
@@ -226,9 +226,22 @@ public class Preferences extends Notifier implements OMPreferences
public <T> void fireChangeEvent(Preference<T> preference, T oldValue, T newValue)
{
+ dirty = true;
fireEvent(new PreferencesChangeEvent<T>(preference, oldValue, newValue));
}
+ private <T> OMPreference<T> init(Preference<T> preference)
+ {
+ String name = preference.getName();
+ if (prefs.containsKey(name))
+ {
+ throw new IllegalArgumentException("Duplicate name: " + name);
+ }
+
+ prefs.put(name, preference);
+ return preference;
+ }
+
private File getFile()
{
File file = new File(bundle.getStateLocation(), ".prefs");
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/OSGiActivator.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/OSGiActivator.java
index 40a712d..0e12471 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/OSGiActivator.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/OSGiActivator.java
@@ -10,8 +10,8 @@
**************************************************************************/
package org.eclipse.net4j.util.om;
-import org.eclipse.net4j.internal.util.bundle.AbstractBundle;
import org.eclipse.net4j.internal.util.bundle.OM;
+import org.eclipse.net4j.internal.util.om.OSGiBundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
@@ -36,7 +36,7 @@ public abstract class OSGiActivator implements BundleActivator
public final void start(BundleContext context) throws Exception
{
OM.Activator.traceStart(context);
- AbstractBundle bundle = (AbstractBundle)getOMBundle();
+ OSGiBundle bundle = (OSGiBundle)getOMBundle();
if (bundle == null)
{
throw new IllegalStateException("bundle == null");
@@ -62,7 +62,7 @@ public abstract class OSGiActivator implements BundleActivator
public final void stop(BundleContext context) throws Exception
{
OM.Activator.traceStop(context);
- AbstractBundle bundle = (AbstractBundle)getOMBundle();
+ OSGiBundle bundle = (OSGiBundle)getOMBundle();
if (bundle == null)
{
throw new IllegalStateException("bundle == null");