summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Fisher2010-11-29 12:45:49 (EST)
committerRyan D. Brooks2010-11-29 12:45:49 (EST)
commit0f1846ad33ed9286108a573e7592bb5b20a0d935 (patch)
treed5313cb20c4fa31de543a6f5a5e3535072b9da4c
parent81e916bbcceab5bd57b83e4671a275b14a29b117 (diff)
downloadorg.eclipse.osee-0f1846ad33ed9286108a573e7592bb5b20a0d935.zip
org.eclipse.osee-0f1846ad33ed9286108a573e7592bb5b20a0d935.tar.gz
org.eclipse.osee-0f1846ad33ed9286108a573e7592bb5b20a0d935.tar.bz2
refinement: Clean up messaging to support aggregation
-rw-r--r--plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/IMessageDictionary.java6
-rw-r--r--plugins/org.eclipse.osee.ote.message/src/org/eclipse/osee/ote/message/MessageSink.java8
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageTreeBuilder.java11
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageView.java14
4 files changed, 23 insertions, 16 deletions
diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/IMessageDictionary.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/IMessageDictionary.java
index 3838169..ec09e69 100644
--- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/IMessageDictionary.java
+++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/IMessageDictionary.java
@@ -16,7 +16,7 @@ import org.eclipse.osee.ote.message.MessageSink;
/**
* Allows the lookup of message definitions
- *
+ *
* @author Ken J. Aguilar
*/
public interface IMessageDictionary {
@@ -31,13 +31,11 @@ public interface IMessageDictionary {
/**
* Finds the class definition of a message of the given name
- *
+ *
* @return Returns values reference.
* @throws ClassNotFoundException if no class definition was found with the given name
*/
Class<? extends Message> lookupMessage(String messageName) throws ClassNotFoundException;
void dispose();
-
- String getImplementationVersion(String file) throws Exception;
}
diff --git a/plugins/org.eclipse.osee.ote.message/src/org/eclipse/osee/ote/message/MessageSink.java b/plugins/org.eclipse.osee.ote.message/src/org/eclipse/osee/ote/message/MessageSink.java
index 00da8e3..4556d64 100644
--- a/plugins/org.eclipse.osee.ote.message/src/org/eclipse/osee/ote/message/MessageSink.java
+++ b/plugins/org.eclipse.osee.ote.message/src/org/eclipse/osee/ote/message/MessageSink.java
@@ -16,12 +16,20 @@ package org.eclipse.osee.ote.message;
public interface MessageSink {
/**
+ * called once by each provider before it calls absorbMessage or absorbElement
+ * @param providerName The name of the provider
+ */
+ public void absorbProvider(String providerName);
+
+ /**
* called once for each message in the message list
+ * @param messageName The name of the message
*/
public void absorbMessage(String messageName);
/**
* called once for each element in a message after absorbMessage is called for that message
+ * @param elementName The name of the element
*/
public void absorbElement(String elementName);
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageTreeBuilder.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageTreeBuilder.java
index 5c34b65..e6b5ade 100644
--- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageTreeBuilder.java
+++ b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageTreeBuilder.java
@@ -19,7 +19,7 @@ import org.eclipse.osee.ote.message.MessageSink;
/**
* Builds a simple tree out of messages. All nodes under the root are messages. Each node under each message is a
* message element
- *
+ *
* @author Ken J. Aguilar
*/
public class MessageTreeBuilder implements MessageSink {
@@ -51,6 +51,15 @@ public class MessageTreeBuilder implements MessageSink {
numMessages++;
}
+ @Override
+ public void absorbProvider(String providerName) {
+ // We don't care about absorbing this yet
+ // In the future it would be nice to have this
+ // information stored and related to the messages
+ // that are from this provider for display
+ // to the users
+ }
+
public int getNumElements() {
return numElements;
}
diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageView.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageView.java
index 734ede1..6429b6a 100644
--- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageView.java
+++ b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageView.java
@@ -89,7 +89,6 @@ public class MessageView extends ViewPart implements IActionable, IMessageDictio
protected ViewerSorter nameSorter;
public static final String VIEW_ID = "org.eclipse.osee.ote.ui.message.view.MessageView";
private Label startLabel;
- private Label versionLbl;
private Composite parentComposite;
private Button searchButton;
private int numMessages = 0;
@@ -118,11 +117,6 @@ public class MessageView extends ViewPart implements IActionable, IMessageDictio
Widgets.attachToParent(startLabel, SWT.LEFT, 0, 0);
Widgets.attachToParent(startLabel, SWT.RIGHT, 50, 0);
- versionLbl = new Label(parentComposite, SWT.CENTER);
- Widgets.attachToParent(versionLbl, SWT.TOP, 0, 0);
- Widgets.attachToParent(versionLbl, SWT.LEFT, 50, 5);
- Widgets.attachToParent(versionLbl, SWT.RIGHT, 100, 0);
-
// Create the tree treeViewer as a child of the composite parent
treeViewer = new TreeViewer(parentComposite);
treeViewer.setContentProvider(new MessageContentProvider());
@@ -541,8 +535,7 @@ public class MessageView extends ViewPart implements IActionable, IMessageDictio
dictionary.generateMessageIndex(treeBuilder);
numMessages = treeBuilder.getNumMessages();
numElements = treeBuilder.getNumElements();
- versionLbl.setText(dictionary.getMessageLibraryVersion());
- versionLbl.setToolTipText(String.format("#Messages: %d, #Elements: %d", numMessages, numElements));
+ treeViewer.getTree().setToolTipText(String.format("#Messages: %d, #Elements: %d\n\nProviders:\n%s", numMessages, numElements, dictionary.getMessageLibraryVersion()));
searchText.setEnabled(true);
startLabel.setText("Ready for query");
} catch (Exception e) {
@@ -565,14 +558,13 @@ public class MessageView extends ViewPart implements IActionable, IMessageDictio
}
private void setLibraryUnloadedState() {
- if (treeViewer.getTree().isDisposed() || startLabel.isDisposed() || versionLbl.isDisposed() || searchText.isDisposed()) {
+ if (treeViewer.getTree().isDisposed() || startLabel.isDisposed() || searchText.isDisposed()) {
return;
}
+ treeViewer.getTree().setToolTipText("");
treeViewer.getTree().setBackground(Displays.getSystemColor(SWT.COLOR_GRAY));
startLabel.setText("message library not detected");
treeViewer.setInput(null);
- versionLbl.setText("");
- versionLbl.setToolTipText("");
searchText.setEnabled(false);
}