Permalink
Browse files

Change OptionDialog.show method signature.

  • Loading branch information...
1 parent a23ea81 commit a000992499bd680f25e8240c873c7d9995345ccc @semanticsoft committed Jan 8, 2013
@@ -209,6 +209,7 @@ public Save promptToSave(MPart dirtyPart)
OptionDialog.show((Window) mWindow.getWidget(), caption,
msg,
new String[] {"Yes", "No", "Cancel"},
+ 400, 80, Component.UNITS_PIXELS,
new OptionDialog.OptionListener() {
@Override
@@ -237,7 +238,7 @@ public void optionSelected(OptionDialog dlg, int optionId)
saveCandidate = null;
dlg.close();
}
- }, 400, 80, Component.UNITS_PIXELS);
+ });
return Save.CANCEL;
}
@@ -11,8 +11,6 @@
package org.semanticsoft.vaaclipsedemo.cassandra.app;
-import org.apache.commons.io.FileUtils;
-
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
@@ -23,31 +21,17 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipInputStream;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
+import org.apache.commons.io.FileUtils;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.osgi.service.datalocation.Location;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.Filter;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.util.tracker.ServiceTracker;
public class BundleActivatorImpl implements BundleActivator
{
-
- private static final String F_META_AREA = ".metadata"; //$NON-NLS-1$
- private static final String F_PLUGIN_DATA = ".plugins"; //$NON-NLS-1$
-
private static BundleActivatorImpl instance;
private BundleContext context;
-
- private ServiceTracker locationServiceTracker;
-
- private IPath stateLocation;
-
private File cassandraHome;
private File srcStore;
@@ -134,36 +118,6 @@ public void stop(BundleContext context) throws Exception
instance = null;
}
- public IPath getStateLocation()
- {
- try
- {
- if (stateLocation == null)
- {
- Filter filter = context.createFilter(Location.INSTANCE_FILTER);
- if (locationServiceTracker == null)
- {
- locationServiceTracker = new ServiceTracker(context, filter, null);
- locationServiceTracker.open();
- }
- Location location = (Location) locationServiceTracker.getService();
- if (location != null)
- {
- IPath path = new Path(location.getURL().getPath());
- stateLocation = path.append(F_META_AREA).append(F_PLUGIN_DATA)
- .append(context.getBundle().getSymbolicName());
- stateLocation.toFile().mkdirs();
- }
- }
- }
- catch (InvalidSyntaxException e)
- {
- // ignore this. It should never happen as we have tested the above
- // format.
- }
- return stateLocation;
- }
-
public static BundleActivatorImpl getInstance()
{
return instance;
@@ -30,6 +30,15 @@
private String msg;
private boolean modal = true;
+ public static final OptionListener CLOSE_LISTENER = new OptionListener() {
+
+ @Override
+ public void optionSelected(OptionDialog optionDialog, int optionId)
+ {
+ optionDialog.close();
+ }
+ };
+
private ComponentProvider componentProvider = new ComponentProvider() {
Label label = new Label();
@@ -173,8 +182,8 @@ public void setOptionEnabled(int optionId, boolean enabled)
button.setEnabled(enabled);
}
- public static void show(Window parentWindow, String caption, String message, String[] options,
- OptionListener optionListener, int w, int h, int units)
+ public static void show(Window parentWindow, String caption, String message, String[] options, int w, int h, int units,
+ OptionListener optionListener)
{
OptionDialog optionDialog = new OptionDialog();
if (w > 0 && h > 0)
@@ -199,6 +208,6 @@ public static void show(Window parentWindow, String caption, String message, Str
public static void show(Window parentWindow, String caption, String message, String[] options,
OptionListener optionListener)
{
- show(parentWindow, caption, message, options, optionListener, -1, -1, -1);
+ show(parentWindow, caption, message, options, -1, -1, -1, optionListener);
}
}

0 comments on commit a000992

Please sign in to comment.