Omaha #3933 added more checks for editor shareability in collaboration
Change-Id: If1c266c6d165c1dba3fbb781e286140edc88e742 Former-commit-id: 48603783d167be43d6e62d9e1579d695f627a0c7
This commit is contained in:
parent
b3bbb2f5cc
commit
b6fc6425df
5 changed files with 27 additions and 17 deletions
|
@ -20,7 +20,8 @@ Require-Bundle: org.eclipse.core.runtime,
|
|||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.util,
|
||||
com.raytheon.viz.core,
|
||||
com.raytheon.uf.common.http
|
||||
com.raytheon.uf.common.http,
|
||||
com.raytheon.uf.viz.core.maps;bundle-version="1.14.1"
|
||||
Export-Package: com.raytheon.uf.viz.collaboration.display,
|
||||
com.raytheon.uf.viz.collaboration.display.data,
|
||||
com.raytheon.uf.viz.collaboration.display.editor,
|
||||
|
|
|
@ -56,6 +56,7 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
|||
* Feb 13, 2014 2751 bclement VenueParticipant refactor
|
||||
* Feb 13, 2014 2751 njensen Renamed container to displayContainer
|
||||
* Mar 06, 2014 2848 bclement removed check for self from participantChanged
|
||||
* Jan 06, 2014 3933 bclement added check for ability to share editor on startup
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -125,7 +126,7 @@ public class DataProviderEventController extends
|
|||
super.startup();
|
||||
AbstractEditor active = EditorUtil
|
||||
.getActiveEditorAs(AbstractEditor.class);
|
||||
if (active != null
|
||||
if (active != null && SharedEditorsManager.canBeShared(active)
|
||||
&& SharedEditorsManager.isBeingShared(active) == false) {
|
||||
try {
|
||||
displayContainer.shareEditor(active);
|
||||
|
|
|
@ -58,6 +58,7 @@ import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
|
|||
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.maps.display.MapRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceList.AddListener;
|
||||
|
@ -66,6 +67,7 @@ import com.raytheon.uf.viz.remote.graphics.DispatcherFactory;
|
|||
import com.raytheon.uf.viz.remote.graphics.DispatchingGraphicsFactory;
|
||||
import com.raytheon.viz.ui.EditorUtil;
|
||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
|
||||
|
||||
/**
|
||||
* Manager class for managing the sharing of editors in an
|
||||
|
@ -82,6 +84,7 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
|||
* Feb 13, 2014 2751 bclement VenueParticipant refactor
|
||||
* Mar 06, 2014 2848 bclement only send to venue if non empty
|
||||
* May 14, 2014 2697 bsteffen Do not use local maps by default.
|
||||
* Jan 06, 2014 3933 bclement added canBeShared()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -418,6 +421,20 @@ public class SharedEditorsManager implements IRemoteDisplayContainer {
|
|||
return allSharedEditors.contains(editor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ed
|
||||
* @return true if the editor can be shared in a session
|
||||
*/
|
||||
public static boolean canBeShared(AbstractEditor ed) {
|
||||
IDisplayPane pane = ed.getActiveDisplayPane();
|
||||
IRenderableDisplay display = pane.getRenderableDisplay();
|
||||
IDisplayPaneContainer container = display.getContainer();
|
||||
boolean isMapDisplay = display instanceof MapRenderableDisplay;
|
||||
boolean hasMultiplePanes = container instanceof IMultiPaneEditor
|
||||
&& ((IMultiPaneEditor) container).getNumberofPanes() > 1;
|
||||
return (isMapDisplay && !hasMultiplePanes);
|
||||
}
|
||||
|
||||
public static boolean isBeingShared(IRenderableDisplay display) {
|
||||
return getSharedDisplayId(display) != -1;
|
||||
}
|
||||
|
|
|
@ -68,14 +68,9 @@ import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.SharedEditor
|
|||
import com.raytheon.uf.viz.collaboration.ui.editor.CollaborationEditor;
|
||||
import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants;
|
||||
import com.raytheon.uf.viz.collaboration.ui.prefs.HandleUtil;
|
||||
import com.raytheon.uf.viz.core.IDisplayPane;
|
||||
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.maps.display.MapRenderableDisplay;
|
||||
import com.raytheon.viz.ui.EditorUtil;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.editor.AbstractEditor;
|
||||
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
|
||||
|
||||
/**
|
||||
* Collaboration creation dialog for sessions.
|
||||
|
@ -97,6 +92,7 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
|
|||
* Apr 16, 2014 3021 bclement increased width of dialog
|
||||
* Apr 22, 2014 3056 bclement made room name lowercase to match xmpp server
|
||||
* Jun 16, 2014 3288 bclement added call to get full venue ID for chosen name
|
||||
* Jan 06, 2014 3933 bclement moved logic to check for editor shareability to SharedEditorsmanager
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -287,17 +283,11 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
private static boolean isShareable(IWorkbenchPart part) {
|
||||
boolean rval = false;
|
||||
if (part instanceof AbstractEditor) {
|
||||
AbstractEditor ed = (AbstractEditor) part;
|
||||
IDisplayPane pane = ed.getActiveDisplayPane();
|
||||
IRenderableDisplay display = pane.getRenderableDisplay();
|
||||
IDisplayPaneContainer container = display.getContainer();
|
||||
boolean isMapDisplay = display instanceof MapRenderableDisplay;
|
||||
boolean hasMultiplePanes = container instanceof IMultiPaneEditor
|
||||
&& ((IMultiPaneEditor) container).getNumberofPanes() > 1;
|
||||
return (isMapDisplay && !hasMultiplePanes);
|
||||
rval = SharedEditorsManager.canBeShared((AbstractEditor) part);
|
||||
}
|
||||
return false;
|
||||
return rval;
|
||||
}
|
||||
|
||||
private void updateSharedSessionDisplay() {
|
||||
|
|
|
@ -54,6 +54,7 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
|||
* Jan 28, 2014 2698 bclement removed venue info
|
||||
* Feb 11, 2014 2751 njensen Fixed scary ==
|
||||
* Mar 06, 2014 2848 bclement get venueName directly from session
|
||||
* Jan 06, 2014 3933 bclement added check for ability to share editor
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -167,7 +168,7 @@ public class ShareEditorAction extends ContributedEditorMenuAction implements
|
|||
private AbstractEditor getActiveSharableEditor() {
|
||||
AbstractEditor editor = EditorUtil
|
||||
.getActiveEditorAs(AbstractEditor.class);
|
||||
if (editor != null
|
||||
if (editor != null && SharedEditorsManager.canBeShared(editor)
|
||||
&& SharedEditorsManager.isBeingShared(editor) == false) {
|
||||
return editor;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue