Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-07-24 13:38:31 -0400
committerrbrooks2010-07-24 13:38:31 -0400
commit4081f04850d3eff9eb1bd7241763707bfbb43a45 (patch)
tree258620df94d4b24077ff103a6c4dea9cb78493fb /plugins/org.eclipse.osee.ote.ui.message.util
parent4ed8bddc791fda93940f238c5135556a07041dc0 (diff)
downloadorg.eclipse.osee-4081f04850d3eff9eb1bd7241763707bfbb43a45.tar.gz
org.eclipse.osee-4081f04850d3eff9eb1bd7241763707bfbb43a45.tar.xz
org.eclipse.osee-4081f04850d3eff9eb1bd7241763707bfbb43a45.zip
applied Eclipse source cleanup
Diffstat (limited to 'plugins/org.eclipse.osee.ote.ui.message.util')
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ClientMessageServiceTracker.java65
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ElementFilter.java52
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/IOteMessageClientView.java6
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageElementSelectionDialog.java4
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageSelectionDialog.java140
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/internal/Activator.java41
6 files changed, 151 insertions, 157 deletions
diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ClientMessageServiceTracker.java b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ClientMessageServiceTracker.java
index e67e7da8f5..03b6a5626c 100644
--- a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ClientMessageServiceTracker.java
+++ b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ClientMessageServiceTracker.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.ote.ui.message.util;
import java.util.logging.Level;
-
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.ote.client.msg.IOteMessageService;
import org.osgi.framework.BundleContext;
@@ -20,41 +19,41 @@ import org.osgi.util.tracker.ServiceTracker;
/**
* @author Ken J. Aguilar
- *
*/
public class ClientMessageServiceTracker extends ServiceTracker {
- private final IOteMessageClientView viewer;
-
- /**
- * @param context
- * @param filter
- * @param customizer
- */
- public ClientMessageServiceTracker(BundleContext context, IOteMessageClientView viewer) {
- super(context, IOteMessageService.class.getName(), null);
- this.viewer = viewer;
- }
+ private final IOteMessageClientView viewer;
+
+ /**
+ * @param context
+ * @param filter
+ * @param customizer
+ */
+ public ClientMessageServiceTracker(BundleContext context, IOteMessageClientView viewer) {
+ super(context, IOteMessageService.class.getName(), null);
+ this.viewer = viewer;
+ }
- @Override
- public synchronized Object addingService(ServiceReference reference) {
- IOteMessageService service = (IOteMessageService)super.addingService(reference);
- try {
- viewer.oteMessageServiceAcquired(service);
- } catch (RuntimeException e) {
- OseeLog.log(ClientMessageServiceTracker.class, Level.SEVERE, "exception while notifying viewer of service", e);
- }
- return service;
- }
+ @Override
+ public synchronized Object addingService(ServiceReference reference) {
+ IOteMessageService service = (IOteMessageService) super.addingService(reference);
+ try {
+ viewer.oteMessageServiceAcquired(service);
+ } catch (RuntimeException e) {
+ OseeLog.log(ClientMessageServiceTracker.class, Level.SEVERE, "exception while notifying viewer of service", e);
+ }
+ return service;
+ }
- @Override
- public synchronized void removedService(ServiceReference reference, Object service) {
- try {
- viewer.oteMessageServiceReleased();
- } catch (RuntimeException e) {
- OseeLog.log(ClientMessageServiceTracker.class, Level.SEVERE, "exception while notifying viewer of service stop", e);
- } finally {
- super.removedService(reference, service);
- }
- }
+ @Override
+ public synchronized void removedService(ServiceReference reference, Object service) {
+ try {
+ viewer.oteMessageServiceReleased();
+ } catch (RuntimeException e) {
+ OseeLog.log(ClientMessageServiceTracker.class, Level.SEVERE,
+ "exception while notifying viewer of service stop", e);
+ } finally {
+ super.removedService(reference, service);
+ }
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ElementFilter.java b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ElementFilter.java
index 8e99f66c78..ebe4629006 100644
--- a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ElementFilter.java
+++ b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ElementFilter.java
@@ -12,40 +12,38 @@ package org.eclipse.osee.ote.ui.message.util;
import java.util.Arrays;
import java.util.HashSet;
-
import org.eclipse.osee.ote.message.elements.Element;
/**
* @author Ken J. Aguilar
- *
*/
public class ElementFilter {
- private final HashSet<Class<? extends Element>> classes = new HashSet<Class<? extends Element>>();
- private boolean headerElementsAllowed = true;
-
- /**
- * @param allowHeaderElements the allowHeaderElements to set
- */
- public void setHeaderElementsAllowed(boolean headerElementsAllowed) {
- this.headerElementsAllowed = headerElementsAllowed;
- }
+ private final HashSet<Class<? extends Element>> classes = new HashSet<Class<? extends Element>>();
+ private boolean headerElementsAllowed = true;
+
+ /**
+ * @param allowHeaderElements the allowHeaderElements to set
+ */
+ public void setHeaderElementsAllowed(boolean headerElementsAllowed) {
+ this.headerElementsAllowed = headerElementsAllowed;
+ }
+
+ public void addAllowableClass(Class<? extends Element> elementClass) {
+ classes.add(elementClass);
+ }
- public void addAllowableClass(Class<? extends Element> elementClass) {
- classes.add(elementClass);
- }
+ public void addAllowableClass(Class<? extends Element>... elementClasses) {
+ classes.addAll(Arrays.asList(elementClasses));
+ }
- public void addAllowableClass(Class<? extends Element>... elementClasses) {
- classes.addAll(Arrays.asList(elementClasses));
- }
-
- public boolean accept(Element e) {
- return classes.contains(e.getClass());
- }
+ public boolean accept(Element e) {
+ return classes.contains(e.getClass());
+ }
- /**
- * @return the headerElementsAllowed
- */
- public boolean isHeaderElementsAllowed() {
- return headerElementsAllowed;
- }
+ /**
+ * @return the headerElementsAllowed
+ */
+ public boolean isHeaderElementsAllowed() {
+ return headerElementsAllowed;
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/IOteMessageClientView.java b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/IOteMessageClientView.java
index 6ff815ea62..e3ef31ad5d 100644
--- a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/IOteMessageClientView.java
+++ b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/IOteMessageClientView.java
@@ -15,9 +15,9 @@ import org.eclipse.ui.IViewPart;
/**
* @author Ken J. Aguilar
- *
*/
public interface IOteMessageClientView extends IViewPart {
- void oteMessageServiceAcquired(IOteMessageService service);
- void oteMessageServiceReleased();
+ void oteMessageServiceAcquired(IOteMessageService service);
+
+ void oteMessageServiceReleased();
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageElementSelectionDialog.java b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageElementSelectionDialog.java
index aa43cad30a..8a493f25cc 100644
--- a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageElementSelectionDialog.java
+++ b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageElementSelectionDialog.java
@@ -54,8 +54,8 @@ public class MessageElementSelectionDialog extends ElementListSelectionDialog {
private static Message<?, ?, ?> getMessage(String msg) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
ServiceTracker tracker =
- new ServiceTracker(Activator.getDefault().getBundle().getBundleContext(),
- IOteClientService.class.getName(), null);
+ new ServiceTracker(Activator.getDefault().getBundle().getBundleContext(), IOteClientService.class.getName(),
+ null);
tracker.open(true);
try {
IMessageDictionary dictionary = ((IOteClientService) tracker.waitForService(1000)).getLoadedDictionary();
diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageSelectionDialog.java b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageSelectionDialog.java
index f6b0cf4bd0..152a4fcb5b 100644
--- a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageSelectionDialog.java
+++ b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageSelectionDialog.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.ote.ui.message.util;
import java.util.ArrayList;
import java.util.logging.Level;
-
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -25,81 +24,76 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.osgi.util.tracker.ServiceTracker;
-
/**
* @author Ken J. Aguilar
- *
*/
public class MessageSelectionDialog extends ElementListSelectionDialog {
-
- /**
- * @param parent
- */
- public MessageSelectionDialog(Shell parent) {
- super(parent, new ILabelProvider() {
-
- @Override
- public Image getImage(Object element) {
- return null;
- }
-
- @Override
- public String getText(Object element) {
- String msgName = (String) element;
- String packageName = msgName.substring(0, msgName
- .lastIndexOf('.'));
- String type = packageName.substring(packageName
- .lastIndexOf('.') + 1);
-
- return String.format("%s [%s]", msgName.substring(msgName
- .lastIndexOf('.') + 1), type);
- }
-
- @Override
- public void addListener(ILabelProviderListener listener) {
- }
-
- @Override
- public void dispose() {
- }
-
- @Override
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- @Override
- public void removeListener(ILabelProviderListener listener) {
- }
-
- });
-
- ServiceTracker tracker =new ServiceTracker(Activator.getDefault().getBundle().getBundleContext(), IOteClientService.class.getName(), null);
- tracker.open(true);
- try {
- IMessageDictionary dictionary = ((IOteClientService)tracker.waitForService(1000)).getLoadedDictionary();
- final ArrayList<String> messages = new ArrayList<String>(4096);
- dictionary.generateMessageIndex(new MessageSink() {
-
- @Override
- public void absorbElement(String elementName) {
- }
-
- @Override
- public void absorbMessage(String messageName) {
- messages.add(messageName);
- }
-
- });
- setElements(messages.toArray());
- } catch (Exception e) {
- OseeLog.log(MessageSelectionDialog.class, Level.SEVERE,
- "failed to generate message listing", e);
- } finally {
- tracker.close();
- }
- setMessage("Select a message. Use * as the wild card character");
- setTitle("Message Selection");
- }
+ /**
+ * @param parent
+ */
+ public MessageSelectionDialog(Shell parent) {
+ super(parent, new ILabelProvider() {
+
+ @Override
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ @Override
+ public String getText(Object element) {
+ String msgName = (String) element;
+ String packageName = msgName.substring(0, msgName.lastIndexOf('.'));
+ String type = packageName.substring(packageName.lastIndexOf('.') + 1);
+
+ return String.format("%s [%s]", msgName.substring(msgName.lastIndexOf('.') + 1), type);
+ }
+
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ });
+
+ ServiceTracker tracker =
+ new ServiceTracker(Activator.getDefault().getBundle().getBundleContext(), IOteClientService.class.getName(),
+ null);
+ tracker.open(true);
+ try {
+ IMessageDictionary dictionary = ((IOteClientService) tracker.waitForService(1000)).getLoadedDictionary();
+ final ArrayList<String> messages = new ArrayList<String>(4096);
+ dictionary.generateMessageIndex(new MessageSink() {
+
+ @Override
+ public void absorbElement(String elementName) {
+ }
+
+ @Override
+ public void absorbMessage(String messageName) {
+ messages.add(messageName);
+ }
+
+ });
+ setElements(messages.toArray());
+ } catch (Exception e) {
+ OseeLog.log(MessageSelectionDialog.class, Level.SEVERE, "failed to generate message listing", e);
+ } finally {
+ tracker.close();
+ }
+ setMessage("Select a message. Use * as the wild card character");
+ setTitle("Message Selection");
+ }
}
diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/internal/Activator.java b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/internal/Activator.java
index 1713d6e3aa..1249686465 100644
--- a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/internal/Activator.java
+++ b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/internal/Activator.java
@@ -15,28 +15,31 @@ import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
+ *
* @author Ken J. Aguilar
*/
public class Activator extends AbstractUIPlugin {
- public static final String PLUGIN_ID = "org.eclipse.osee.ote.ui.message.util";
- private static Activator plugin;
-
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
+ public static final String PLUGIN_ID = "org.eclipse.osee.ote.ui.message.util";
+ private static Activator plugin;
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
} \ No newline at end of file

Back to the top