Issue #711 add roles and site capability
Former-commit-id:a9d225066a
[formerlya9d225066a
[formerly a49eee36dac39f172d7c4fa723a297d7cf94d5db]] Former-commit-id:032827aa1b
Former-commit-id:13a1fa879e
This commit is contained in:
parent
8eac89d337
commit
34f57345ac
13 changed files with 548 additions and 234 deletions
|
@ -25,7 +25,8 @@ Require-Bundle: com.raytheon.viz.ui,
|
|||
com.raytheon.uf.viz.collaboration.display;bundle-version="1.0.0",
|
||||
gov.noaa.nws.ncep.ui.pgen;bundle-version="1.0.0",
|
||||
gov.noaa.nws.ncep.staticdataprovider;bundle-version="1.0.0",
|
||||
gov.noaa.nws.ncep.common.staticdata;bundle-version="1.0.0"
|
||||
gov.noaa.nws.ncep.common.staticdata;bundle-version="1.0.0",
|
||||
org.eclipse.ecf.presence
|
||||
Import-Package: com.raytheon.uf.common.status,
|
||||
com.raytheon.uf.viz.core.maps.display,
|
||||
com.raytheon.uf.viz.core.maps.rsc,
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 330 B |
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!-- Override this file in localization to customize the sites and roles
|
||||
that may be selected. Also, add any other information that you would like
|
||||
to make available to users from other sites. -->
|
||||
<userInformation>
|
||||
<info name="site">
|
||||
<attibuteOptions>OAX</attibuteOptions>
|
||||
<attibuteOptions>DMX</attibuteOptions>
|
||||
</info>
|
||||
<info name="role">
|
||||
<attibuteOptions>None</attibuteOptions>
|
||||
<attibuteOptions>Short Term Forecaster</attibuteOptions>
|
||||
<attibuteOptions>Long Term Forecaster</attibuteOptions>
|
||||
</info>
|
||||
</userInformation>
|
|
@ -22,26 +22,6 @@
|
|||
<plugin>
|
||||
<extension-point id="renderingExtension" name="renderingExtension" schema="schema/renderingExtension.exsd"/>
|
||||
|
||||
<!-- Collaboration groups -->
|
||||
<extension
|
||||
point="org.eclipse.ui.views">
|
||||
<view
|
||||
allowMultiple="false"
|
||||
category="com.raytheon.viz.ui"
|
||||
class="com.raytheon.uf.viz.collaboration.ui.CollaborationGroupView"
|
||||
id="com.raytheon.uf.viz.collaboration.ui.CollaborationGroupView"
|
||||
icon="icons/browser.gif"
|
||||
name="Collaboration Information"
|
||||
restorable="false"/>
|
||||
<view
|
||||
allowMultiple="true"
|
||||
category="com.raytheon.viz.ui"
|
||||
class="com.raytheon.uf.viz.collaboration.ui.session.SessionMsgArchiveView"
|
||||
id="com.raytheon.uf.viz.collaboration.ui.session.SessionMsgArchiveView"
|
||||
icon="icons/browser.gif"
|
||||
name="Log Browser"
|
||||
restorable="false"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.commands">
|
||||
<category
|
||||
|
@ -60,9 +40,9 @@
|
|||
commandId="com.raytheon.uf.viz.collaboration.collaborationBrowser">
|
||||
</handler>
|
||||
</extension>
|
||||
<!-- Session Views -->
|
||||
<extension
|
||||
point="org.eclipse.ui.views">
|
||||
<!-- Session Views -->
|
||||
<view
|
||||
allowMultiple="true"
|
||||
category="com.raytheon.viz.ui"
|
||||
|
@ -71,9 +51,6 @@
|
|||
icon="icons/messages.gif"
|
||||
name="Collaboration Session"
|
||||
restorable="false"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.views">
|
||||
<view
|
||||
allowMultiple="true"
|
||||
category="com.raytheon.viz.ui"
|
||||
|
@ -90,9 +67,6 @@
|
|||
icon="icons/chats.gif"
|
||||
name="Text Session"
|
||||
restorable="false"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.views">
|
||||
<view
|
||||
allowMultiple="true"
|
||||
category="com.raytheon.viz.ui"
|
||||
|
@ -101,6 +75,23 @@
|
|||
icon="icons/chats.gif"
|
||||
name="Chat"
|
||||
restorable="false"/>
|
||||
<!-- Collaboration groups -->
|
||||
<view
|
||||
allowMultiple="false"
|
||||
category="com.raytheon.viz.ui"
|
||||
class="com.raytheon.uf.viz.collaboration.ui.CollaborationGroupView"
|
||||
id="com.raytheon.uf.viz.collaboration.ui.CollaborationGroupView"
|
||||
icon="icons/browser.gif"
|
||||
name="Collaboration Information"
|
||||
restorable="false"/>
|
||||
<view
|
||||
allowMultiple="true"
|
||||
category="com.raytheon.viz.ui"
|
||||
class="com.raytheon.uf.viz.collaboration.ui.session.SessionMsgArchiveView"
|
||||
id="com.raytheon.uf.viz.collaboration.ui.session.SessionMsgArchiveView"
|
||||
icon="icons/browser.gif"
|
||||
name="Log Browser"
|
||||
restorable="false"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.commands">
|
||||
|
|
|
@ -55,7 +55,6 @@ import org.eclipse.jface.viewers.DoubleClickEvent;
|
|||
import org.eclipse.jface.viewers.IDoubleClickListener;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.TreeSelection;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.window.ToolTip;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.TreeEditor;
|
||||
|
@ -90,6 +89,8 @@ import org.eclipse.ui.IWorkbenchPage;
|
|||
import org.eclipse.ui.IWorkbenchPart;
|
||||
import org.eclipse.ui.PartInitException;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.dialogs.FilteredTree;
|
||||
import org.eclipse.ui.dialogs.PatternFilter;
|
||||
import org.osgi.framework.Bundle;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
|
@ -119,6 +120,7 @@ import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants;
|
|||
import com.raytheon.uf.viz.collaboration.ui.session.AbstractSessionView;
|
||||
import com.raytheon.uf.viz.collaboration.ui.session.CollaborationSessionView;
|
||||
import com.raytheon.uf.viz.collaboration.ui.session.PeerToPeerView;
|
||||
import com.raytheon.uf.viz.collaboration.ui.session.SessionFeedView;
|
||||
import com.raytheon.uf.viz.collaboration.ui.session.SessionMsgArchive;
|
||||
import com.raytheon.uf.viz.collaboration.ui.session.SessionView;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
|
@ -151,7 +153,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
|
||||
private SessionGroupContainer activeSessionGroup;
|
||||
|
||||
private TreeViewer usersTreeViewer;
|
||||
private FilteredTree usersTreeViewer;
|
||||
|
||||
private CollaborationGroupContainer topLevel;
|
||||
|
||||
|
@ -175,10 +177,6 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
|
||||
private Action addGroupAction;
|
||||
|
||||
private Action addUserAction;
|
||||
|
||||
private Action selectGroups;
|
||||
|
||||
private Action changeStatusMessageAction;
|
||||
|
||||
private Action changeStatusAction;
|
||||
|
@ -187,6 +185,8 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
|
||||
private Action changePasswordAction;
|
||||
|
||||
private Action displayFeedAction;
|
||||
|
||||
// Drawing *will* be activated in collaboration views
|
||||
// private Action drawToolbarAction;
|
||||
|
||||
|
@ -253,7 +253,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
connection.registerEventHandler(this);
|
||||
}
|
||||
populateTree();
|
||||
usersTreeViewer.refresh();
|
||||
usersTreeViewer.getViewer().refresh();
|
||||
parent.layout();
|
||||
}
|
||||
|
||||
|
@ -295,7 +295,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
createArchiveViewerAction = new Action("View Log...") {
|
||||
private String getSessionName() {
|
||||
IStructuredSelection selection = (IStructuredSelection) usersTreeViewer
|
||||
.getSelection();
|
||||
.getViewer().getSelection();
|
||||
Object o = selection.getFirstElement();
|
||||
String sessionName = null;
|
||||
|
||||
|
@ -316,15 +316,6 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
return sessionName;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean isEnabled() {
|
||||
// CollaborationConnection conn = CollaborationDataManager
|
||||
// .getInstance().getCollaborationConnection(true);
|
||||
// UserId user = conn.getUser();
|
||||
// return SessionMsgArchive.getArchiveDir(user.getHost(),
|
||||
// user.getName(), getSessionName()).exists();
|
||||
// };
|
||||
|
||||
@Override
|
||||
public void runWithEvent(Event event) {
|
||||
UserId user = CollaborationConnection.getConnection().getUser();
|
||||
|
@ -398,12 +389,11 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
@Override
|
||||
public void run() {
|
||||
TreeSelection selection = (TreeSelection) usersTreeViewer
|
||||
.getSelection();
|
||||
.getViewer().getSelection();
|
||||
Object node = selection.getFirstElement();
|
||||
if (node instanceof IVenueSession) {
|
||||
// loop through all the views so that we can bring the one
|
||||
// that
|
||||
// was selected to the top...
|
||||
// that was selected to the top...
|
||||
IVenueSession session = (IVenueSession) selection
|
||||
.getFirstElement();
|
||||
for (IViewReference ref : getViewSite()
|
||||
|
@ -423,7 +413,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
@Override
|
||||
public void run() {
|
||||
TreeSelection selection = (TreeSelection) usersTreeViewer
|
||||
.getSelection();
|
||||
.getViewer().getSelection();
|
||||
Object node = selection.getFirstElement();
|
||||
if (node instanceof IRosterEntry) {
|
||||
IRosterEntry user = (IRosterEntry) node;
|
||||
|
@ -469,16 +459,6 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
};
|
||||
};
|
||||
|
||||
addUserAction = new Action("Add User") {
|
||||
public void run() {
|
||||
// addUsersToGroup();
|
||||
nyiFeature("Add User to a Group");
|
||||
};
|
||||
};
|
||||
addUserAction.setImageDescriptor(IconUtil.getImageDescriptor(bundle,
|
||||
"add_contact.gif"));
|
||||
addUserAction.setEnabled(false);
|
||||
|
||||
addGroupAction = new Action("Create Group") {
|
||||
public void run() {
|
||||
System.out.println("Create Group here");
|
||||
|
@ -489,14 +469,6 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
"add_group.gif"));
|
||||
addGroupAction.setEnabled(false);
|
||||
|
||||
selectGroups = new Action("Select System Groups...") {
|
||||
public void run() {
|
||||
System.out.println("Select System Groups to Display...");
|
||||
nyiFeature("Select System Groups.");
|
||||
}
|
||||
};
|
||||
selectGroups.setEnabled(false);
|
||||
|
||||
changeStatusMessageAction = new Action("Change Status Message...") {
|
||||
public void run() {
|
||||
changeStatusMessage();
|
||||
|
@ -541,7 +513,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
collapseAllAction = new Action("Collapse All") {
|
||||
public void run() {
|
||||
if (usersTreeViewer != null) {
|
||||
usersTreeViewer.collapseAll();
|
||||
usersTreeViewer.getViewer().collapseAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -575,45 +547,30 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
};
|
||||
changeStatusAction.setMenuCreator(creator);
|
||||
|
||||
// TODO: Delete once drawing is activated in collaboration shared
|
||||
// dispaly views
|
||||
// drawToolbarAction = new Action("Drawing Toolbar") {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// // TODO: What should this do now?
|
||||
// System.err.println("What should this method do now!?");
|
||||
// }
|
||||
// };
|
||||
// drawToolbarAction.setImageDescriptor(IconUtil.getImageDescriptor(
|
||||
// com.raytheon.uf.viz.drawing.Activator.getDefault().getBundle(),
|
||||
// "draw.gif"));
|
||||
//
|
||||
// pgenAction = new Action("PGEN") {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// StaticDataProvider.getInstance();
|
||||
// try {
|
||||
// // cause the classloader to load StaticDataProvider and thus
|
||||
// // to call the Activator for
|
||||
// // gov.noaa.nws.ncep.staticdataprovider.
|
||||
// // This is done because of an initialization order problem
|
||||
// // in PgenStaticDataProvider
|
||||
// StaticDataProvider.getInstance();
|
||||
// ServiceReference ref = Activator
|
||||
// .getDefault()
|
||||
// .getBundle()
|
||||
// .getBundleContext()
|
||||
// .getServiceReference(
|
||||
// IStaticDataProvider.class.getName());
|
||||
//
|
||||
// PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
// .getActivePage().showView(PgenUtil.VIEW_ID);
|
||||
// } catch (PartInitException e) {
|
||||
// statusHandler.handle(Priority.PROBLEM,
|
||||
// "Unable to open PGEN palette", e);
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
displayFeedAction = new Action("Display Feed") {
|
||||
public void run() {
|
||||
CollaborationConnection connection = CollaborationConnection
|
||||
.getConnection();
|
||||
try {
|
||||
// TODO, make this configurable?
|
||||
IVenueSession session = connection
|
||||
.joinTextOnlyVenue("nws-collaboration");
|
||||
PlatformUI
|
||||
.getWorkbench()
|
||||
.getActiveWorkbenchWindow()
|
||||
.getActivePage()
|
||||
.showView(SessionFeedView.ID,
|
||||
session.getSessionId(),
|
||||
IWorkbenchPage.VIEW_ACTIVATE);
|
||||
} catch (CollaborationException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to join the collaboration feed", e);
|
||||
} catch (PartInitException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to join collaboration feed", e);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -624,6 +581,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
mgr.add(createSessionAction);
|
||||
mgr.add(collapseAllAction);
|
||||
mgr.add(linkToEditorAction);
|
||||
// mgr.add(displayFeedAction);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -645,8 +603,6 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
|
||||
private void createMenu(IMenuManager mgr) {
|
||||
mgr.add(addGroupAction);
|
||||
mgr.add(addUserAction);
|
||||
mgr.add(selectGroups);
|
||||
mgr.add(new Separator());
|
||||
mgr.add(fontChangeAction);
|
||||
mgr.add(changeStatusAction);
|
||||
|
@ -676,9 +632,10 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
fillContextMenu(manager);
|
||||
}
|
||||
});
|
||||
Menu menu = menuMgr.createContextMenu(usersTreeViewer.getControl());
|
||||
usersTreeViewer.getControl().setMenu(menu);
|
||||
getSite().registerContextMenu(menuMgr, usersTreeViewer);
|
||||
Menu menu = menuMgr.createContextMenu(usersTreeViewer.getViewer()
|
||||
.getControl());
|
||||
usersTreeViewer.getViewer().getControl().setMenu(menu);
|
||||
getSite().registerContextMenu(menuMgr, usersTreeViewer.getViewer());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -690,10 +647,8 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
topLevel.clear();
|
||||
// set all the menu actions to false to start with
|
||||
if (connection == null) {
|
||||
usersTreeViewer.getTree().setEnabled(false);
|
||||
usersTreeViewer.getViewer().getTree().setEnabled(false);
|
||||
addGroupAction.setEnabled(false);
|
||||
addUserAction.setEnabled(false);
|
||||
selectGroups.setEnabled(false);
|
||||
changeStatusAction.setEnabled(false);
|
||||
fontChangeAction.setEnabled(false);
|
||||
changeStatusMessageAction.setEnabled(false);
|
||||
|
@ -703,8 +658,6 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
|
||||
// enable all the actions
|
||||
addGroupAction.setEnabled(true);
|
||||
addUserAction.setEnabled(true);
|
||||
selectGroups.setEnabled(true);
|
||||
changeStatusAction.setEnabled(true);
|
||||
fontChangeAction.setEnabled(true);
|
||||
changeStatusMessageAction.setEnabled(true);
|
||||
|
@ -726,8 +679,8 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
populateGroups();
|
||||
|
||||
// enable the tree, and then refresh it just to be safe
|
||||
usersTreeViewer.getTree().setEnabled(true);
|
||||
usersTreeViewer.refresh(topLevel, true);
|
||||
usersTreeViewer.getViewer().getTree().setEnabled(true);
|
||||
usersTreeViewer.getViewer().refresh(topLevel, true);
|
||||
this.disableOrEnableToolbarActions();
|
||||
createArchiveViewerAction.setEnabled(true);
|
||||
}
|
||||
|
@ -787,7 +740,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
*/
|
||||
private void fillContextMenu(IMenuManager manager) {
|
||||
IStructuredSelection selection = (IStructuredSelection) usersTreeViewer
|
||||
.getSelection();
|
||||
.getViewer().getSelection();
|
||||
Object o = selection.getFirstElement();
|
||||
|
||||
// handle the session group portion of the group view
|
||||
|
@ -847,18 +800,20 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
}
|
||||
|
||||
private void addDoubleClickListeners() {
|
||||
usersTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
|
||||
@Override
|
||||
public void doubleClick(DoubleClickEvent event) {
|
||||
peerToPeerChatAction.run();
|
||||
}
|
||||
});
|
||||
usersTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
|
||||
@Override
|
||||
public void doubleClick(DoubleClickEvent event) {
|
||||
joinAction.run();
|
||||
}
|
||||
});
|
||||
usersTreeViewer.getViewer().addDoubleClickListener(
|
||||
new IDoubleClickListener() {
|
||||
@Override
|
||||
public void doubleClick(DoubleClickEvent event) {
|
||||
peerToPeerChatAction.run();
|
||||
}
|
||||
});
|
||||
usersTreeViewer.getViewer().addDoubleClickListener(
|
||||
new IDoubleClickListener() {
|
||||
@Override
|
||||
public void doubleClick(DoubleClickEvent event) {
|
||||
joinAction.run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -872,11 +827,11 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
if (oldEditor != null) {
|
||||
oldEditor.dispose();
|
||||
}
|
||||
TreeSelection selection = (TreeSelection) usersTreeViewer
|
||||
TreeSelection selection = (TreeSelection) usersTreeViewer.getViewer()
|
||||
.getSelection();
|
||||
final IRosterEntry entry = (IRosterEntry) selection.getFirstElement();
|
||||
final Composite comp = new Composite(usersTreeViewer.getTree(),
|
||||
SWT.NONE);
|
||||
final Composite comp = new Composite(usersTreeViewer.getViewer()
|
||||
.getTree(), SWT.NONE);
|
||||
comp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
|
||||
final Text text = new Text(comp, SWT.NONE);
|
||||
|
||||
|
@ -909,10 +864,11 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
// public void handleEvent(Event event) {
|
||||
// final TreeItem item = (TreeItem) event.item;
|
||||
// if (item != null && item == lastItem[0]) {
|
||||
final TreeItem item = usersTreeViewer.getTree().getSelection()[0];
|
||||
final TreeItem item = usersTreeViewer.getViewer().getTree()
|
||||
.getSelection()[0];
|
||||
boolean showBorder = true;
|
||||
final Composite composite = new Composite(usersTreeViewer.getTree(),
|
||||
SWT.NONE);
|
||||
final Composite composite = new Composite(usersTreeViewer.getViewer()
|
||||
.getTree(), SWT.NONE);
|
||||
if (showBorder)
|
||||
composite.setBackground(Display.getCurrent().getSystemColor(
|
||||
SWT.COLOR_BLACK));
|
||||
|
@ -959,7 +915,8 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
size = modText.computeSize(size.x, SWT.DEFAULT);
|
||||
treeEditor.horizontalAlignment = SWT.LEFT;
|
||||
Rectangle itemRect = item.getBounds(),
|
||||
rect = usersTreeViewer.getTree().getClientArea();
|
||||
rect = usersTreeViewer.getViewer().getTree()
|
||||
.getClientArea();
|
||||
treeEditor.minimumWidth = Math.max(size.x, itemRect.width)
|
||||
+ inset * 2;
|
||||
int left = itemRect.x,
|
||||
|
@ -1035,7 +992,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
// need to refresh the local tree so that the top user shows up with the
|
||||
// current status
|
||||
UserId id = (UserId) topLevel.getObjects().get(0);
|
||||
usersTreeViewer.refresh(id);
|
||||
usersTreeViewer.getViewer().refresh(id);
|
||||
}
|
||||
|
||||
private void createSession() {
|
||||
|
@ -1161,7 +1118,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
UserId id = (UserId) peer;
|
||||
String name = peer.getFQName();
|
||||
TreeSelection selection = (TreeSelection) usersTreeViewer
|
||||
.getSelection();
|
||||
.getViewer().getSelection();
|
||||
IRosterEntry entry = (IRosterEntry) selection.getFirstElement();
|
||||
if (id.getAlias() != null && !id.getAlias().isEmpty()) {
|
||||
name = id.getAlias();
|
||||
|
@ -1192,21 +1149,27 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
Composite child = new Composite(parent, SWT.NONE);
|
||||
child.setLayout(new GridLayout(1, false));
|
||||
child.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
||||
usersTreeViewer = new TreeViewer(child);
|
||||
usersTreeViewer.getTree().setLayoutData(
|
||||
new GridData(SWT.FILL, SWT.FILL, true, true));
|
||||
PatternFilter pFilter = new UsersTreeFilter();
|
||||
usersTreeViewer = new FilteredTree(child, SWT.MULTI | SWT.V_SCROLL
|
||||
| SWT.H_SCROLL | SWT.BORDER, pFilter, true);
|
||||
usersTreeViewer.getViewer().getTree()
|
||||
.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
||||
|
||||
TreeColumn column = new TreeColumn(usersTreeViewer.getTree(), SWT.NONE);
|
||||
TreeColumn column = new TreeColumn(usersTreeViewer.getViewer()
|
||||
.getTree(), SWT.NONE);
|
||||
column.setWidth(200); // any width would work
|
||||
|
||||
usersTreeViewer.setContentProvider(new UsersTreeContentProvider());
|
||||
usersTreeViewer.setLabelProvider(new UsersTreeLabelProvider());
|
||||
usersTreeViewer.setSorter(new UsersTreeViewerSorter());
|
||||
ColumnViewerToolTipSupport.enableFor(usersTreeViewer, ToolTip.RECREATE);
|
||||
usersTreeViewer.getViewer().setContentProvider(
|
||||
new UsersTreeContentProvider());
|
||||
usersTreeViewer.getViewer().setLabelProvider(
|
||||
new UsersTreeLabelProvider());
|
||||
usersTreeViewer.getViewer().setSorter(new UsersTreeViewerSorter());
|
||||
ColumnViewerToolTipSupport.enableFor(usersTreeViewer.getViewer(),
|
||||
ToolTip.RECREATE);
|
||||
topLevel = new CollaborationGroupContainer();
|
||||
usersTreeViewer.setInput(topLevel);
|
||||
usersTreeViewer.getViewer().setInput(topLevel);
|
||||
|
||||
treeEditor = new TreeEditor(usersTreeViewer.getTree());
|
||||
treeEditor = new TreeEditor(usersTreeViewer.getViewer().getTree());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1280,7 +1243,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
private Set<IRosterEntry> getSelectedUsers() {
|
||||
Set<IRosterEntry> selectedUsers = new HashSet<IRosterEntry>();
|
||||
IStructuredSelection selection = (IStructuredSelection) usersTreeViewer
|
||||
.getSelection();
|
||||
.getViewer().getSelection();
|
||||
Object[] nodes = selection.toArray();
|
||||
|
||||
for (Object node : nodes) {
|
||||
|
@ -1323,7 +1286,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
for (Object child : group.getEntries()) {
|
||||
if (child instanceof IRosterEntry) {
|
||||
if (userId.equals(((IRosterEntry) child).getUser())) {
|
||||
usersTreeViewer.refresh(child, true);
|
||||
usersTreeViewer.getViewer().refresh(child, true);
|
||||
}
|
||||
} else if (child instanceof IRosterGroup) {
|
||||
refreshUser(userId, (IRosterGroup) child);
|
||||
|
@ -1380,7 +1343,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
usersTreeViewer.refresh(rosterItem);
|
||||
usersTreeViewer.getViewer().refresh(rosterItem);
|
||||
}
|
||||
});
|
||||
} else if (rosterItem instanceof IRosterGroup) {
|
||||
|
@ -1399,7 +1362,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
usersTreeViewer.refresh(topLevel);
|
||||
usersTreeViewer.getViewer().refresh(topLevel);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1429,7 +1392,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
usersTreeViewer.refresh(ob);
|
||||
usersTreeViewer.getViewer().refresh(ob);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1444,7 +1407,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
usersTreeViewer.refresh(ob);
|
||||
usersTreeViewer.getViewer().refresh(ob);
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
@ -1542,7 +1505,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
activeSessionGroup.addObject(session);
|
||||
// register here because we unregister in part closed
|
||||
session.registerEventHandler(sessionView);
|
||||
usersTreeViewer.refresh(activeSessionGroup);
|
||||
usersTreeViewer.getViewer().refresh(activeSessionGroup);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1571,7 +1534,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
|||
// active sessions
|
||||
if (sessionId.equals(group.getSessionId())) {
|
||||
activeSessionGroup.removeObject(node);
|
||||
usersTreeViewer.refresh(activeSessionGroup);
|
||||
usersTreeViewer.getViewer().refresh(activeSessionGroup);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.collaboration.ui;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManager;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.viz.collaboration.ui.role.UserInformation;
|
||||
|
||||
/**
|
||||
* Parse a file to grab attributes about a user
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 12, 2012 mnash Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mnash
|
||||
* @version 1.0
|
||||
*/
|
||||
public class UserInformationParser {
|
||||
|
||||
/**
|
||||
* Go to the userinformation.xml file and grab the user information, for use
|
||||
* in determining what kind of user you are in collaboration
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static UserInformation parseUserInformation() {
|
||||
PathManager pm = (PathManager) PathManagerFactory.getPathManager();
|
||||
Map<LocalizationLevel, LocalizationFile> files = pm
|
||||
.getTieredLocalizationFile(LocalizationType.CAVE_STATIC,
|
||||
"collaboration" + File.separator
|
||||
+ "userInformation.xml");
|
||||
|
||||
LocalizationFile lFile = null;
|
||||
for (LocalizationFile file : files.values()) {
|
||||
// this is not something that the user should define
|
||||
if (file.getContext().getLocalizationLevel().isSystemLevel()
|
||||
|| file.getContext().getLocalizationLevel() == LocalizationLevel.SITE) {
|
||||
lFile = file;
|
||||
}
|
||||
}
|
||||
|
||||
File toFile = lFile.getFile();
|
||||
try {
|
||||
JAXBContext context = JAXBContext
|
||||
.newInstance(UserInformation.class);
|
||||
Unmarshaller unmarshaller = context.createUnmarshaller();
|
||||
UserInformation info = (UserInformation) unmarshaller
|
||||
.unmarshal(toFile);
|
||||
return info;
|
||||
} catch (JAXBException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.collaboration.ui;
|
||||
|
||||
import java.text.BreakIterator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.ui.dialogs.PatternFilter;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 13, 2012 mnash Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mnash
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class UsersTreeFilter extends PatternFilter {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public UsersTreeFilter() {
|
||||
// TODO Auto-generated constructor stub
|
||||
setIncludeLeadingWildcard(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPattern(String patternString) {
|
||||
super.setPattern(patternString);
|
||||
// String[] words = getWords(patternString);
|
||||
// StringBuilder builder = new StringBuilder();
|
||||
// for (String word : words) {
|
||||
// builder.append("(?=").append(word).append(")");
|
||||
// }
|
||||
// super.setPattern(builder.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Taken from PatternFilter
|
||||
*
|
||||
* @param text
|
||||
* @return
|
||||
*/
|
||||
private String[] getWords(String text) {
|
||||
List words = new ArrayList();
|
||||
// Break the text up into words, separating based on whitespace and
|
||||
// common punctuation.
|
||||
// Previously used String.split(..., "\\W"), where "\W" is a regular
|
||||
// expression (see the Javadoc for class Pattern).
|
||||
// Need to avoid both String.split and regular expressions, in order to
|
||||
// compile against JCL Foundation (bug 80053).
|
||||
// Also need to do this in an NL-sensitive way. The use of BreakIterator
|
||||
// was suggested in bug 90579.
|
||||
BreakIterator iter = BreakIterator.getWordInstance();
|
||||
iter.setText(text);
|
||||
int i = iter.first();
|
||||
while (i != java.text.BreakIterator.DONE && i < text.length()) {
|
||||
int j = iter.following(i);
|
||||
if (j == java.text.BreakIterator.DONE) {
|
||||
j = text.length();
|
||||
}
|
||||
// match the word
|
||||
if (Character.isLetterOrDigit(text.charAt(i))) {
|
||||
String word = text.substring(i, j);
|
||||
words.add(word);
|
||||
}
|
||||
i = j;
|
||||
}
|
||||
return (String[]) words.toArray(new String[words.size()]);
|
||||
}
|
||||
}
|
|
@ -119,7 +119,21 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
|
|||
return id.getAlias();
|
||||
} else if (entry.getUser().getName() != null
|
||||
&& !entry.getUser().getName().isEmpty()) {
|
||||
return entry.getUser().getName();
|
||||
IPresence presence = entry.getPresence();
|
||||
String returnVal = entry.getUser().getName();
|
||||
if (presence != null) {
|
||||
if (presence.getProperties() != null) {
|
||||
if (presence.getProperties().get("site") != null) {
|
||||
returnVal += " - "
|
||||
+ presence.getProperties().get("site");
|
||||
}
|
||||
if (presence.getProperties().get("role") != null) {
|
||||
returnVal += " - "
|
||||
+ presence.getProperties().get("role");
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnVal;
|
||||
} else {
|
||||
return id.getName();
|
||||
}
|
||||
|
@ -128,7 +142,11 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
|
|||
} else if (element instanceof SessionGroupContainer) {
|
||||
return "Active Sessions";
|
||||
} else if (element instanceof UserId) {
|
||||
IPresence presence = CollaborationConnection.getConnection()
|
||||
.getPresence();
|
||||
return ((UserId) element).getName() + " - "
|
||||
+ presence.getProperties().get("site") + " - "
|
||||
+ presence.getProperties().get("role") + " - "
|
||||
+ ((UserId) element).getHost();
|
||||
} else if (element instanceof IVenueSession) {
|
||||
if (((IVenueSession) element).getVenue() == null) {
|
||||
|
@ -174,14 +192,17 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
|
|||
builder.append(CollaborationUtils.formatMode(user.getPresence()
|
||||
.getMode()));
|
||||
|
||||
// builder.append("Type: ").append(user.getType())
|
||||
// .append("\n");
|
||||
String message = user.getPresence().getStatus();
|
||||
if (message != null && message.length() > 0) {
|
||||
builder.append("\n");
|
||||
builder.append("Message: \"").append(
|
||||
user.getPresence().getStatus() + "\"");
|
||||
}
|
||||
|
||||
for (Object ob : user.getPresence().getProperties().keySet()) {
|
||||
builder.append("\n").append(ob.toString()).append(" : ")
|
||||
.append(user.getPresence().getProperties().get(ob));
|
||||
}
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,9 @@ package com.raytheon.uf.viz.collaboration.ui.login;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
|
@ -55,7 +57,9 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
|||
import com.raytheon.uf.viz.collaboration.ui.Activator;
|
||||
import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils;
|
||||
import com.raytheon.uf.viz.collaboration.ui.ConnectionSubscriber;
|
||||
import com.raytheon.uf.viz.collaboration.ui.UserInformationParser;
|
||||
import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants;
|
||||
import com.raytheon.uf.viz.collaboration.ui.role.UserInformation;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
|
||||
|
@ -90,6 +94,8 @@ public class LoginDialog extends CaveSWTDialog {
|
|||
|
||||
private Combo statusCombo;
|
||||
|
||||
private List<Control> combos;
|
||||
|
||||
private Text messageTF;
|
||||
|
||||
private Button logOnButton;
|
||||
|
@ -233,6 +239,53 @@ public class LoginDialog extends CaveSWTDialog {
|
|||
gd.horizontalSpan = 2;
|
||||
messageTF.setLayoutData(gd);
|
||||
|
||||
Composite comp = new Composite(body, SWT.NONE);
|
||||
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
gd.horizontalSpan = 3;
|
||||
GridLayout layout = new GridLayout(4, false);
|
||||
layout.marginHeight = 0;
|
||||
layout.marginWidth = 0;
|
||||
comp.setLayout(layout);
|
||||
comp.setLayoutData(gd);
|
||||
|
||||
UserInformation information = UserInformationParser
|
||||
.parseUserInformation();
|
||||
combos = new ArrayList<Control>();
|
||||
for (UserInformation.Info info : information.getInfo()) {
|
||||
Label comboLabel = new Label(comp, SWT.NONE);
|
||||
gd = new GridData(SWT.NONE, SWT.FILL, false, true);
|
||||
comboLabel.setLayoutData(gd);
|
||||
String name = info.getName();
|
||||
final StringBuilder result = new StringBuilder(name.length());
|
||||
String[] words = name.split("\\s");
|
||||
for (int i = 0, l = words.length; i < l; ++i) {
|
||||
if (i > 0)
|
||||
result.append(" ");
|
||||
result.append(Character.toUpperCase(words[i].charAt(0)))
|
||||
.append(words[i].substring(1));
|
||||
}
|
||||
;
|
||||
comboLabel.setText(result.toString() + " :");
|
||||
if (info.isAllowMultiple()) {
|
||||
org.eclipse.swt.widgets.List list = new org.eclipse.swt.widgets.List(
|
||||
comp, SWT.MULTI);
|
||||
list.setData(info.getName());
|
||||
list.setItems(info.getAttibuteOptions());
|
||||
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
list.setLayoutData(gd);
|
||||
list.select(0);
|
||||
combos.add(list);
|
||||
} else {
|
||||
Combo combo = new Combo(comp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
||||
combo.setData(info.getName());
|
||||
combo.setItems(info.getAttibuteOptions());
|
||||
gd = new GridData(SWT.FILL, SWT.NONE, true, true);
|
||||
combo.setLayoutData(gd);
|
||||
combo.select(0);
|
||||
combos.add(combo);
|
||||
}
|
||||
}
|
||||
|
||||
noServerList = new Control[] { userTF, passwordTF, statusCombo,
|
||||
messageTF, serverButton };
|
||||
withServerList = new Control[] { userTF, serverTF, serverButton,
|
||||
|
@ -358,11 +411,35 @@ public class LoginDialog extends CaveSWTDialog {
|
|||
final String usr = user;
|
||||
final String passwd = password;
|
||||
final IPresence pres = initialPres;
|
||||
final Map<String, String> nameToText = new HashMap<String, String>();
|
||||
for (Control control : combos) {
|
||||
if (control instanceof Combo) {
|
||||
Combo combo = (Combo) control;
|
||||
nameToText.put(combo.getData().toString(),
|
||||
combo.getText());
|
||||
} else if (control instanceof org.eclipse.swt.widgets.List) {
|
||||
org.eclipse.swt.widgets.List list = (org.eclipse.swt.widgets.List) control;
|
||||
String result = "";
|
||||
for (String string : list.getSelection()) {
|
||||
result += string + "/";
|
||||
}
|
||||
result = result.substring(0,
|
||||
result.length() - 1);
|
||||
nameToText.put(list.getData().toString(),
|
||||
result);
|
||||
}
|
||||
}
|
||||
Job job = new Job(
|
||||
"Creating the server connection...") {
|
||||
protected org.eclipse.core.runtime.IStatus run(
|
||||
org.eclipse.core.runtime.IProgressMonitor monitor) {
|
||||
try {
|
||||
// add all the values from the combo
|
||||
// boxes into the presence
|
||||
for (String name : nameToText.keySet()) {
|
||||
pres.getProperties().put(name,
|
||||
nameToText.get(name));
|
||||
}
|
||||
CollaborationConnection connection = CollaborationConnection
|
||||
.connect(new UserId(usr, srvr),
|
||||
passwd, pres);
|
||||
|
@ -434,5 +511,4 @@ public class LoginDialog extends CaveSWTDialog {
|
|||
}
|
||||
return button;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.collaboration.ui.prefs;
|
||||
|
||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 7, 2012 mnash Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mnash
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class CollaborationSubscribeListPreferences extends
|
||||
FieldEditorPreferencePage {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public CollaborationSubscribeListPreferences() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param style
|
||||
*/
|
||||
public CollaborationSubscribeListPreferences(int style) {
|
||||
super(GRID);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
protected void createFieldEditors() {
|
||||
// // TODO Auto-generated method stub
|
||||
// CollaborationConnection.getConnection().getRosterManager().get
|
||||
}
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.collaboration.ui.role;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 12, 2012 mnash Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mnash
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class UserInformation {
|
||||
@XmlElement
|
||||
private List<Info> info;
|
||||
|
||||
/**
|
||||
* @return the infos
|
||||
*/
|
||||
public List<Info> getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param infos
|
||||
* the infos to set
|
||||
*/
|
||||
public void setInfo(List<Info> info) {
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public static class Info {
|
||||
|
||||
@XmlAttribute
|
||||
private String name;
|
||||
|
||||
@XmlElement
|
||||
private String[] attibuteOptions;
|
||||
|
||||
@XmlAttribute
|
||||
private boolean allowMultiple;
|
||||
|
||||
/**
|
||||
* @return the name
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name
|
||||
* the name to set
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the attibuteOptions
|
||||
*/
|
||||
public String[] getAttibuteOptions() {
|
||||
return attibuteOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param attibuteOptions
|
||||
* the attibuteOptions to set
|
||||
*/
|
||||
public void setAttibuteOptions(String[] attibuteOptions) {
|
||||
this.attibuteOptions = attibuteOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param allowMultiple
|
||||
* the allowMultiple to set
|
||||
*/
|
||||
public void setAllowMultiple(boolean allowMultiple) {
|
||||
this.allowMultiple = allowMultiple;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the allowMultiple
|
||||
*/
|
||||
public boolean isAllowMultiple() {
|
||||
return allowMultiple;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -96,7 +96,8 @@ public class SessionFeedView extends SessionView {
|
|||
private List<String> readEnabledUsers() {
|
||||
LocalizationFile file = getLocalizationFile();
|
||||
if (file.exists()) {
|
||||
SubscribeList list = JAXB.unmarshal(file.getFile(), SubscribeList.class);
|
||||
SubscribeList list = JAXB.unmarshal(file.getFile(),
|
||||
SubscribeList.class);
|
||||
return list.getEnabledUsers();
|
||||
}
|
||||
return new ArrayList<String>();
|
||||
|
@ -233,6 +234,7 @@ public class SessionFeedView extends SessionView {
|
|||
*/
|
||||
@Override
|
||||
protected void setParticipantValues(ParticipantsLabelProvider labelProvider) {
|
||||
participantsLabel.setText("Subscribed");
|
||||
super.setParticipantValues(labelProvider);
|
||||
labelProvider.setEnabledUsers(enabledUsers);
|
||||
}
|
||||
|
|
|
@ -102,6 +102,8 @@ public class SessionView extends AbstractSessionView {
|
|||
|
||||
protected TableViewer usersTable;
|
||||
|
||||
protected CLabel participantsLabel;
|
||||
|
||||
protected String sessionId;
|
||||
|
||||
protected IVenueSession session;
|
||||
|
@ -250,7 +252,7 @@ public class SessionView extends AbstractSessionView {
|
|||
comp.setLayout(layout);
|
||||
comp.setLayoutData(data);
|
||||
|
||||
final CLabel participantsLabel = new CLabel(comp, SWT.NONE);
|
||||
participantsLabel = new CLabel(comp, SWT.NONE);
|
||||
layout = new GridLayout(1, false);
|
||||
data = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
participantsLabel.setLayout(layout);
|
||||
|
|
Loading…
Add table
Reference in a new issue