Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2005-02-01 06:12:19 +0000
committerslewis2005-02-01 06:12:19 +0000
commite62390d6c7ac9e69bde74d20c1da915297910539 (patch)
tree6fc6a162730c7759eaeb3b3d2fd987ce70e61430
parent812ae9eedcbbfb1d9c14a4abe097837de8c0d60d (diff)
downloadorg.eclipse.ecf-e62390d6c7ac9e69bde74d20c1da915297910539.tar.gz
org.eclipse.ecf-e62390d6c7ac9e69bde74d20c1da915297910539.tar.xz
org.eclipse.ecf-e62390d6c7ac9e69bde74d20c1da915297910539.zip
Added Ken's additions to enable view context menu. Also changes name of ECF Project Collab view. Fixed wording in file receive message
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/plugin.xml2
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java4
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/ChatComposite.java5
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/LineChatView.java52
4 files changed, 53 insertions, 10 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml b/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml
index 98238114f..b0c81f823 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml
+++ b/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml
@@ -7,7 +7,7 @@
icon="icons/person.gif"
class="org.eclipse.ecf.example.collab.ui.LineChatView"
category="org.eclipse.ecf.client.category"
- name="ECF Collaboration"
+ name="ECF Project Collab"
id="org.eclipse.ecf.example.collab.ui.LineChatView"/>
<category
name="ECF"
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java
index 82bc09865..cac281cbd 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java
@@ -986,8 +986,8 @@ public class EclipseCollabSharedObject extends GenericSharedObject implements
if (user != null) {
nick = user.getNickname();
}
- showRawLine(from, "\t'" + aFile.getName() + "' from " + nick
- + " has completed and placed in directory: "+getLocalFullDownloadPath());
+ showRawLine(from, "\t'" + aFile.getName() + "' received from " + nick
+ + ". Stored in: "+getLocalFullDownloadPath());
refreshProject();
}
};
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/ChatComposite.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/ChatComposite.java
index ff394a181..de7c60cef 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/ChatComposite.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/ChatComposite.java
@@ -167,6 +167,7 @@ public class ChatComposite extends Composite {
// make actions
makeActions();
hookContextMenu();
+ contributeToActionBars();
initializeDropTargets();
}
@@ -194,7 +195,9 @@ public class ChatComposite extends Composite {
private void contributeToActionBars() {
IActionBars bars = this.view.view.getViewSite().getActionBars();
fillLocalPullDown(bars.getMenuManager());
- fillLocalToolBar(bars.getToolBarManager());
+ //fillLocalToolBar(bars.getToolBarManager());
+ //bars.getToolBarManager().markDirty();
+
}
protected void copyFileLocally(String inputFile, String outputFile)
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/LineChatView.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/LineChatView.java
index d5036127d..e1a69f541 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/LineChatView.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/ui/LineChatView.java
@@ -22,6 +22,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.ui.IActionBars;
@@ -33,12 +34,17 @@ import org.eclipse.ui.part.ViewPart;
public class LineChatView extends ViewPart {
// The single view
+ private static final String COLLABORATION_PROJECTS_ARE_NOT_AVAILABLE_ = "No project collaboration sessions joined\n\nTo join a project collaboration session, select a project in either the Navigator or Package Explorer view,\nright-click to open context menu for project, choose ECF menu, and choose 'Join ECF Collaboration...'";
static protected LineChatView singleton = null;
static protected Hashtable clientViews = new Hashtable();
TabFolder tabFolder = null;
+ Composite parentComposite = null;
+
+ Label inactiveLabel = null;
+
/*
protected static ID appShare = null;
protected static EclipseAppShareServer appShareServer = null;
@@ -74,15 +80,17 @@ public class LineChatView extends ViewPart {
}
protected void removeClientView(LineChatClientView cv) {
final TabItem ti = (TabItem) clientViews.remove(cv);
+
+
// Clean up app share
- /*
- final ID appShareID = cv.getAppShareID();
+
+/* final ID appShareID = cv.getAppShareID();
if (appShareID != null) {
if (appShareID.equals(appShare)) {
appShareServer.destroySelf();
}
- }
- */
+ }*/
+
Display.getDefault().syncExec(new Runnable() {
public void run() {
/*
@@ -93,8 +101,22 @@ public class LineChatView extends ViewPart {
}
*/
if (ti != null) ti.dispose();
+
+ if (clientViews.isEmpty()) {
+ singleton.tabFolder.dispose();
+ singleton.tabFolder = null;
+
+ createInactiveComposite(singleton.parentComposite);
+ actionBars.getToolBarManager().removeAll();
+ actionBars.getMenuManager().removeAll();
+ actionBars.updateActionBars();
+ singleton.parentComposite.layout();
+ }
}
});
+
+
+
//if (clientViews.size()==0) {
// this.hideView();
//}
@@ -118,18 +140,29 @@ public class LineChatView extends ViewPart {
LineChatClientView newView = null;
synchronized (clientViews) {
if (singleton == null) throw new InstantiationException("View not initialized");
+
+ if (singleton.inactiveLabel != null) {
+ singleton.inactiveLabel.dispose();
+ }
+
+ if (singleton.tabFolder == null) {
+ singleton.tabFolder = new TabFolder(singleton.parentComposite, SWT.NORMAL);
+ }
+
newView = new LineChatClientView(lch,singleton,name,initText,downloaddir);
TabItem ti = new TabItem(singleton.tabFolder,SWT.NULL);
ti.setControl(newView.getTeamChat());
ti.setText(newView.name);
singleton.addClientView(newView,ti);
+ actionBars.updateActionBars();
+ singleton.parentComposite.layout();
}
return newView;
}
public void setFocus() {
synchronized (clientViews) {
- singleton.tabFolder.setFocus();
+ singleton.parentComposite.setFocus();
}
}
@@ -196,8 +229,15 @@ public class LineChatView extends ViewPart {
IViewSite viewSite = this.getViewSite();
actionBars = viewSite.getActionBars();
toolbarManager = actionBars.getToolBarManager();
- singleton.tabFolder = new TabFolder(parent,SWT.NORMAL);
+ parentComposite = parent;
+ createInactiveComposite(parent);
+ }
+
+ private void createInactiveComposite(Composite parent) {
+ inactiveLabel = new Label(parent, SWT.NONE);
+ inactiveLabel.setText(COLLABORATION_PROJECTS_ARE_NOT_AVAILABLE_);
}
+
protected void disposeClient(LineChatClientView lccv) {
if (singleton != null) singleton.removeClientView(lccv);
}

Back to the top