From 4ed8bddc791fda93940f238c5135556a07041dc0 Mon Sep 17 00:00:00 2001
From: rbrooks
Date: Sat, 24 Jul 2010 08:02:08 +0000
Subject: converted all line terminators to unix style
---
.../.classpath | 14 +-
.../org.eclipse.osee.ote.ui.message.util/.project | 56 ++--
.../build.properties | 8 +-
.../message/util/ClientMessageServiceTracker.java | 118 ++++-----
.../osee/ote/ui/message/util/ElementFilter.java | 100 ++++----
.../ote/ui/message/util/IOteMessageClientView.java | 44 ++--
.../util/MessageElementSelectionDialog.java | 282 ++++++++++-----------
.../ui/message/util/MessageSelectionDialog.java | 210 +++++++--------
.../ote/ui/message/util/internal/Activator.java | 82 +++---
9 files changed, 457 insertions(+), 457 deletions(-)
(limited to 'plugins/org.eclipse.osee.ote.ui.message.util')
diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/.classpath b/plugins/org.eclipse.osee.ote.ui.message.util/.classpath
index 8a8f1668cdc..ad32c83a788 100644
--- a/plugins/org.eclipse.osee.ote.ui.message.util/.classpath
+++ b/plugins/org.eclipse.osee.ote.ui.message.util/.classpath
@@ -1,7 +1,7 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/.project b/plugins/org.eclipse.osee.ote.ui.message.util/.project
index 01428f98d8f..652125d8c6f 100644
--- a/plugins/org.eclipse.osee.ote.ui.message.util/.project
+++ b/plugins/org.eclipse.osee.ote.ui.message.util/.project
@@ -1,28 +1,28 @@
-
-
- org.eclipse.osee.ote.ui.message.util
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
-
-
- org.eclipse.pde.PluginNature
- org.eclipse.jdt.core.javanature
-
-
+
+
+ org.eclipse.osee.ote.ui.message.util
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/build.properties b/plugins/org.eclipse.osee.ote.ui.message.util/build.properties
index 41eb6ade2b4..34d2e4d2dad 100644
--- a/plugins/org.eclipse.osee.ote.ui.message.util/build.properties
+++ b/plugins/org.eclipse.osee.ote.ui.message.util/build.properties
@@ -1,4 +1,4 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
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 2d6aa1d31ea..e67e7da8f50 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
@@ -1,60 +1,60 @@
-/*******************************************************************************
- * Copyright (c) 2010 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-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;
-import org.osgi.framework.ServiceReference;
-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;
- }
-
- @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);
- }
- }
+/*******************************************************************************
+ * Copyright (c) 2010 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+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;
+import org.osgi.framework.ServiceReference;
+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;
+ }
+
+ @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);
+ }
+ }
}
\ 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 a04fe1aa085..8e99f66c786 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
@@ -1,51 +1,51 @@
-/*******************************************************************************
- * Copyright (c) 2010 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-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> classes = new HashSet>();
- 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>... elementClasses) {
- classes.addAll(Arrays.asList(elementClasses));
- }
-
- public boolean accept(Element e) {
- return classes.contains(e.getClass());
- }
-
- /**
- * @return the headerElementsAllowed
- */
- public boolean isHeaderElementsAllowed() {
- return headerElementsAllowed;
- }
+/*******************************************************************************
+ * Copyright (c) 2010 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+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> classes = new HashSet>();
+ 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>... elementClasses) {
+ classes.addAll(Arrays.asList(elementClasses));
+ }
+
+ public boolean accept(Element e) {
+ return classes.contains(e.getClass());
+ }
+
+ /**
+ * @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 6bc0fd83407..6ff815ea62e 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
@@ -1,23 +1,23 @@
-/*******************************************************************************
- * Copyright (c) 2010 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.ote.ui.message.util;
-
-import org.eclipse.osee.ote.client.msg.IOteMessageService;
-import org.eclipse.ui.IViewPart;
-
-/**
- * @author Ken J. Aguilar
- *
- */
-public interface IOteMessageClientView extends IViewPart {
- void oteMessageServiceAcquired(IOteMessageService service);
- void oteMessageServiceReleased();
+/*******************************************************************************
+ * Copyright (c) 2010 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ote.ui.message.util;
+
+import org.eclipse.osee.ote.client.msg.IOteMessageService;
+import org.eclipse.ui.IViewPart;
+
+/**
+ * @author Ken J. Aguilar
+ *
+ */
+public interface IOteMessageClientView extends IViewPart {
+ 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 5db1fb61b66..aa43cad30a7 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
@@ -1,141 +1,141 @@
-/*******************************************************************************
- * Copyright (c) 2010 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.ote.ui.message.util;
-
-import java.util.LinkedList;
-import java.util.List;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.osee.ote.message.ElementPath;
-import org.eclipse.osee.ote.message.Message;
-import org.eclipse.osee.ote.message.elements.Element;
-import org.eclipse.osee.ote.message.elements.RecordElement;
-import org.eclipse.osee.ote.message.elements.RecordMap;
-import org.eclipse.osee.ote.service.IMessageDictionary;
-import org.eclipse.osee.ote.service.IOteClientService;
-import org.eclipse.osee.ote.ui.message.util.internal.Activator;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * @author Ken J. Aguilar
- */
-public class MessageElementSelectionDialog extends ElementListSelectionDialog {
-
- public MessageElementSelectionDialog(Shell parent, Message, ?, ?> msg) {
- this(parent, msg, null);
- }
-
- public MessageElementSelectionDialog(Shell parent, String msg, ElementFilter filter) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalStateException {
- this(parent, getMessage(msg), filter);
- }
-
- public MessageElementSelectionDialog(Shell parent, Message, ?, ?> msg, ElementFilter filter) {
- super(parent, new LabelProvider());
- LinkedList topLevelElements = new LinkedList();
- LinkedList filterElements = new LinkedList();
- msg.getAllElements(topLevelElements);
-
- process(filter, topLevelElements, filterElements);
- setElements(filterElements.toArray());
- setMessage("Select a message element. Use * as the wild card character");
- setTitle("Message Element Selection");
- }
-
- private static Message, ?, ?> getMessage(String msg) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
- ServiceTracker tracker =
- new ServiceTracker(Activator.getDefault().getBundle().getBundleContext(),
- IOteClientService.class.getName(), null);
- tracker.open(true);
- try {
- IMessageDictionary dictionary = ((IOteClientService) tracker.waitForService(1000)).getLoadedDictionary();
- if (dictionary == null) {
- throw new IllegalStateException("no dictionary loaded");
- }
- return dictionary.lookupMessage(msg).newInstance();
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- throw new IllegalStateException("interrupted", e);
- } finally {
- tracker.close();
- }
- }
-
- private static final class LabelProvider implements ILabelProvider {
-
- @Override
- public Image getImage(Object element) {
- return null;
- }
-
- @Override
- public String getText(Object element) {
- Element msgElement = (Element) element;
- return new ElementPath(msgElement.getElementPath()).toString();
- }
-
- @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) {
- }
-
- };
-
- private void process(ElementFilter filter, List list, List destinationList) {
- for (Element element : list) {
- processElement(filter, element, destinationList);
- }
- }
-
- private void processElement(ElementFilter filter, Element element, List destinationList) {
- if (element instanceof RecordMap>) {
- processRecordMap(filter, (RecordMap>) element, destinationList);
- } else if (element instanceof RecordElement) {
- processRecordElement(filter, (RecordElement) element, destinationList);
- } else {
- if (filter == null || filter.accept(element)) {
- destinationList.add(element);
- }
- }
- }
-
- private void processRecordMap(ElementFilter filter, RecordMap> map, List destinationList) {
- for (int i = 0; i < map.length(); i++) {
- processRecordElement(filter, map.get(i), destinationList);
- }
-
- }
-
- private void processRecordElement(ElementFilter filter, RecordElement element, List destinationList) {
- if (element instanceof RecordMap>) {
- processRecordMap(filter, (RecordMap>) element, destinationList);
- } else {
- for (Element childElement : element.getElementMap().values()) {
- processElement(filter, childElement, destinationList);
- }
- }
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2010 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ote.ui.message.util;
+
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.osee.ote.message.ElementPath;
+import org.eclipse.osee.ote.message.Message;
+import org.eclipse.osee.ote.message.elements.Element;
+import org.eclipse.osee.ote.message.elements.RecordElement;
+import org.eclipse.osee.ote.message.elements.RecordMap;
+import org.eclipse.osee.ote.service.IMessageDictionary;
+import org.eclipse.osee.ote.service.IOteClientService;
+import org.eclipse.osee.ote.ui.message.util.internal.Activator;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * @author Ken J. Aguilar
+ */
+public class MessageElementSelectionDialog extends ElementListSelectionDialog {
+
+ public MessageElementSelectionDialog(Shell parent, Message, ?, ?> msg) {
+ this(parent, msg, null);
+ }
+
+ public MessageElementSelectionDialog(Shell parent, String msg, ElementFilter filter) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalStateException {
+ this(parent, getMessage(msg), filter);
+ }
+
+ public MessageElementSelectionDialog(Shell parent, Message, ?, ?> msg, ElementFilter filter) {
+ super(parent, new LabelProvider());
+ LinkedList topLevelElements = new LinkedList();
+ LinkedList filterElements = new LinkedList();
+ msg.getAllElements(topLevelElements);
+
+ process(filter, topLevelElements, filterElements);
+ setElements(filterElements.toArray());
+ setMessage("Select a message element. Use * as the wild card character");
+ setTitle("Message Element Selection");
+ }
+
+ private static Message, ?, ?> getMessage(String msg) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
+ ServiceTracker tracker =
+ new ServiceTracker(Activator.getDefault().getBundle().getBundleContext(),
+ IOteClientService.class.getName(), null);
+ tracker.open(true);
+ try {
+ IMessageDictionary dictionary = ((IOteClientService) tracker.waitForService(1000)).getLoadedDictionary();
+ if (dictionary == null) {
+ throw new IllegalStateException("no dictionary loaded");
+ }
+ return dictionary.lookupMessage(msg).newInstance();
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new IllegalStateException("interrupted", e);
+ } finally {
+ tracker.close();
+ }
+ }
+
+ private static final class LabelProvider implements ILabelProvider {
+
+ @Override
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ @Override
+ public String getText(Object element) {
+ Element msgElement = (Element) element;
+ return new ElementPath(msgElement.getElementPath()).toString();
+ }
+
+ @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) {
+ }
+
+ };
+
+ private void process(ElementFilter filter, List list, List destinationList) {
+ for (Element element : list) {
+ processElement(filter, element, destinationList);
+ }
+ }
+
+ private void processElement(ElementFilter filter, Element element, List destinationList) {
+ if (element instanceof RecordMap>) {
+ processRecordMap(filter, (RecordMap>) element, destinationList);
+ } else if (element instanceof RecordElement) {
+ processRecordElement(filter, (RecordElement) element, destinationList);
+ } else {
+ if (filter == null || filter.accept(element)) {
+ destinationList.add(element);
+ }
+ }
+ }
+
+ private void processRecordMap(ElementFilter filter, RecordMap> map, List destinationList) {
+ for (int i = 0; i < map.length(); i++) {
+ processRecordElement(filter, map.get(i), destinationList);
+ }
+
+ }
+
+ private void processRecordElement(ElementFilter filter, RecordElement element, List destinationList) {
+ if (element instanceof RecordMap>) {
+ processRecordMap(filter, (RecordMap>) element, destinationList);
+ } else {
+ for (Element childElement : element.getElementMap().values()) {
+ processElement(filter, childElement, destinationList);
+ }
+ }
+ }
+
+}
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 23276b048e1..f6b0cf4bd08 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
@@ -1,105 +1,105 @@
-/*******************************************************************************
- * Copyright (c) 2010 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-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;
-import org.eclipse.osee.ote.service.IMessageDictionary;
-import org.eclipse.osee.ote.service.IOteClientService;
-import org.eclipse.osee.ote.service.MessageSink;
-import org.eclipse.osee.ote.ui.message.util.internal.Activator;
-import org.eclipse.swt.graphics.Image;
-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 messages = new ArrayList(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");
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2010 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+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;
+import org.eclipse.osee.ote.service.IMessageDictionary;
+import org.eclipse.osee.ote.service.IOteClientService;
+import org.eclipse.osee.ote.service.MessageSink;
+import org.eclipse.osee.ote.ui.message.util.internal.Activator;
+import org.eclipse.swt.graphics.Image;
+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 messages = new ArrayList(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 f60880598cd..1713d6e3aac 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
@@ -1,42 +1,42 @@
-/*******************************************************************************
- * Copyright (c) 2010 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.ote.ui.message.util.internal;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-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 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;
- }
+/*******************************************************************************
+ * Copyright (c) 2010 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ote.ui.message.util.internal;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+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 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
--
cgit v1.2.3