Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2009-02-12 19:07:06 +0000
committerslewis2009-02-12 19:07:06 +0000
commit6b5dc02893ec0d8ee147bb59cb37e4cd30633171 (patch)
tree40689362987cd7d2c60a44cb9a2effa0314544a4 /examples/bundles/org.eclipse.ecf.example.collab/src/org
parent9979c3eb83e4cdd3236991829ff6ce78b83248f5 (diff)
downloadorg.eclipse.ecf-6b5dc02893ec0d8ee147bb59cb37e4cd30633171.tar.gz
org.eclipse.ecf-6b5dc02893ec0d8ee147bb59cb37e4cd30633171.tar.xz
org.eclipse.ecf-6b5dc02893ec0d8ee147bb59cb37e4cd30633171.zip
Changes to settings and code to reduce warnings
Diffstat (limited to 'examples/bundles/org.eclipse.ecf.example.collab/src/org')
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java6
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/EclipseFileTransfer.java12
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/FileReceiverUI.java (renamed from examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/FileReceiverUI.java)6
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/FileSenderUI.java (renamed from examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/FileSenderUI.java)5
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/FileTransferSharedObject.java25
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/url/StartProgramSharedObject.java35
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ClientPlugin.java2
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java2
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatWindow.java17
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/LineChatClientView.java2
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/SharedObjectContainerUI.java4
11 files changed, 48 insertions, 68 deletions
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 84aafaa4b..a5c45f293 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
@@ -19,8 +19,7 @@ import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.identity.IDFactory;
import org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription;
import org.eclipse.ecf.core.user.IUser;
-import org.eclipse.ecf.example.collab.share.io.EclipseFileTransfer;
-import org.eclipse.ecf.example.collab.share.io.FileTransferParams;
+import org.eclipse.ecf.example.collab.share.io.*;
import org.eclipse.ecf.internal.example.collab.ClientPlugin;
import org.eclipse.ecf.internal.example.collab.Messages;
import org.eclipse.ecf.internal.example.collab.presence.PresenceContainer;
@@ -1069,6 +1068,9 @@ public class EclipseCollabSharedObject extends GenericSharedObject {
return wp.showView(id);
}
+ /**
+ * @since 2.0
+ */
public FileReceiverUI getFileReceiverUI(EclipseFileTransfer transfer, FileTransferParams params) {
return new FileReceiverUI() {
public void receiveStart(ID from, File aFile, long length, float rate) {
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/EclipseFileTransfer.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/EclipseFileTransfer.java
index 63474c50d..bf7d1ff43 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/EclipseFileTransfer.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/EclipseFileTransfer.java
@@ -15,18 +15,11 @@ import java.io.File;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
-
import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.core.sharedobject.ISharedObjectConfig;
-import org.eclipse.ecf.core.sharedobject.ISharedObjectContainerTransaction;
-import org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription;
-import org.eclipse.ecf.core.sharedobject.SharedObjectAddAbortException;
-import org.eclipse.ecf.core.sharedobject.SharedObjectInitException;
+import org.eclipse.ecf.core.sharedobject.*;
import org.eclipse.ecf.example.collab.share.EclipseCollabSharedObject;
import org.eclipse.ecf.internal.example.collab.ClientPlugin;
import org.eclipse.ecf.internal.example.collab.Messages;
-import org.eclipse.ecf.internal.example.collab.ui.FileReceiverUI;
-import org.eclipse.ecf.internal.example.collab.ui.FileSenderUI;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
@@ -40,6 +33,9 @@ public class EclipseFileTransfer extends FileTransferSharedObject implements Fil
protected FileReceiverUI receiverUI = null;
protected EclipseCollabSharedObject receiver = null;
+ /**
+ * @since 2.0
+ */
public EclipseFileTransfer(FileSenderUI view, ID target, InputStream ins, FileTransferParams params, ID sharedObjectID) {
super(target, ins, params);
this.senderUI = view;
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/FileReceiverUI.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/FileReceiverUI.java
index 3b79156af..88d61d252 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/FileReceiverUI.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/FileReceiverUI.java
@@ -9,12 +9,14 @@
* Composent, Inc. - initial API and implementation
*****************************************************************************/
-package org.eclipse.ecf.internal.example.collab.ui;
+package org.eclipse.ecf.example.collab.share.io;
import java.io.File;
-
import org.eclipse.ecf.core.identity.ID;
+/**
+ * @since 2.0
+ */
public interface FileReceiverUI {
public void receiveStart(ID from, File aFile, long length, float rate);
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/FileSenderUI.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/FileSenderUI.java
index f20f34042..ef16c188b 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/FileSenderUI.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/FileSenderUI.java
@@ -9,10 +9,13 @@
* Composent, Inc. - initial API and implementation
*****************************************************************************/
-package org.eclipse.ecf.internal.example.collab.ui;
+package org.eclipse.ecf.example.collab.share.io;
import java.io.File;
+/**
+ * @since 2.0
+ */
public interface FileSenderUI {
public void sendStart(File aFile, long length, float rate);
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/FileTransferSharedObject.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/FileTransferSharedObject.java
index abf262b4a..ae30cc7b4 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/FileTransferSharedObject.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/io/FileTransferSharedObject.java
@@ -11,21 +11,11 @@
package org.eclipse.ecf.example.collab.share.io;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
+import java.io.*;
+import java.util.*;
import org.eclipse.core.runtime.Assert;
import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.core.sharedobject.ISharedObjectConfig;
-import org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription;
-import org.eclipse.ecf.core.sharedobject.SharedObjectInitException;
+import org.eclipse.ecf.core.sharedobject.*;
import org.eclipse.ecf.example.collab.share.SharedObjectMsg;
import org.eclipse.ecf.example.collab.share.TransactionSharedObject;
import org.eclipse.ecf.internal.example.collab.Messages;
@@ -150,8 +140,10 @@ public class FileTransferSharedObject extends TransactionSharedObject {
try {
final String parent = aFile.getParent();
- if (parent != null && new File(parent).mkdirs())
- /**/;
+ if (parent != null) {
+ new File(parent).mkdirs();
+ }
+
} catch (final Exception ex) {
// Log this exception.
log(NLS.bind("Exception creating local directory for ", aFile), //$NON-NLS-1$
@@ -389,6 +381,9 @@ public class FileTransferSharedObject extends TransactionSharedObject {
}
}
+ /**
+ * @throws IOException
+ */
protected void hardClose() throws IOException {
if (inputStream != null) {
try {
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/url/StartProgramSharedObject.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/url/StartProgramSharedObject.java
index 5ab287881..e6d8d4ea0 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/url/StartProgramSharedObject.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/url/StartProgramSharedObject.java
@@ -15,14 +15,12 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.core.sharedobject.ISharedObjectConfig;
-import org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription;
-import org.eclipse.ecf.core.sharedobject.SharedObjectInitException;
+import org.eclipse.ecf.core.sharedobject.*;
import org.eclipse.ecf.example.collab.share.GenericSharedObject;
import org.eclipse.ecf.internal.example.collab.Trace;
public class StartProgramSharedObject extends GenericSharedObject {
- public static Trace myDebug = Trace.create("progsharedobject"); //$NON-NLS-1$
+ private static Trace myDebug = Trace.create("progsharedobject"); //$NON-NLS-1$
public static final Boolean DEFAULT_INCLUDE_SERVER = Boolean.FALSE;
// Host values
protected String[] cmds;
@@ -40,8 +38,7 @@ public class StartProgramSharedObject extends GenericSharedObject {
}
- public StartProgramSharedObject(ID rcvr, String cmds[], String env[],
- Boolean includeHost, Boolean includeServer) throws Exception {
+ public StartProgramSharedObject(ID rcvr, String cmds[], String env[], Boolean includeHost, Boolean includeServer) throws Exception {
receiver = rcvr;
this.cmds = cmds;
this.env = ((env == null) ? new String[0] : env);
@@ -64,16 +61,13 @@ public class StartProgramSharedObject extends GenericSharedObject {
}
}
- public StartProgramSharedObject(ID rcvr, String hostCmds[],
- String hostEnv[], String replicaCmds[], String replicaEnv[],
- Boolean includeHost, Boolean includeServer) throws Exception {
+ public StartProgramSharedObject(ID rcvr, String hostCmds[], String hostEnv[], String replicaCmds[], String replicaEnv[], Boolean includeHost, Boolean includeServer) throws Exception {
this(rcvr, hostCmds, hostEnv, includeHost, includeServer);
this.replicaCmds = replicaCmds;
this.replicaEnv = replicaEnv;
}
- public StartProgramSharedObject(ID rcvr, String cmds[], String env[])
- throws Exception {
+ public StartProgramSharedObject(ID rcvr, String cmds[], String env[]) throws Exception {
this(rcvr, cmds, env, Boolean.FALSE, null);
}
@@ -101,8 +95,7 @@ public class StartProgramSharedObject extends GenericSharedObject {
}
}
- public void init(ISharedObjectConfig config)
- throws SharedObjectInitException {
+ public void init(ISharedObjectConfig config) throws SharedObjectInitException {
super.init(config);
Map props = config.getProperties();
debug("props is " + props); //$NON-NLS-1$
@@ -118,22 +111,17 @@ public class StartProgramSharedObject extends GenericSharedObject {
}
- protected ReplicaSharedObjectDescription getReplicaDescription(
- ID remoteMember) {
- Object args[] = { receiver, (replicaCmds == null) ? cmds : replicaCmds,
- (replicaEnv == null) ? env : replicaEnv, includeHost,
- includeServer };
+ protected ReplicaSharedObjectDescription getReplicaDescription(ID remoteMember) {
+ Object args[] = {receiver, (replicaCmds == null) ? cmds : replicaCmds, (replicaEnv == null) ? env : replicaEnv, includeHost, includeServer};
HashMap map = new HashMap();
map.put("args", args); //$NON-NLS-1$
- return new ReplicaSharedObjectDescription(getClass(), getID(),
- getHomeContainerID(), map, getNextReplicateID());
+ return new ReplicaSharedObjectDescription(getClass(), getID(), getHomeContainerID(), map, getNextReplicateID());
}
public void activated(ID[] others) {
debug("activated()"); //$NON-NLS-1$
try {
- if (!getContext().isGroupManager()
- || includeServer.equals(Boolean.TRUE)) {
+ if (!getContext().isGroupManager() || includeServer.equals(Boolean.TRUE)) {
startup();
} else {
debug("Not executing commands because is server"); //$NON-NLS-1$
@@ -181,8 +169,7 @@ public class StartProgramSharedObject extends GenericSharedObject {
} else
proc = Runtime.getRuntime().exec(cmds);
} else {
- proc = Runtime.getRuntime().exec(cmds,
- (env.length == 0) ? null : env);
+ proc = Runtime.getRuntime().exec(cmds, (env.length == 0) ? null : env);
}
}
}
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ClientPlugin.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ClientPlugin.java
index 0ee62dc02..da12dca0a 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ClientPlugin.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ClientPlugin.java
@@ -24,7 +24,7 @@ import org.osgi.framework.BundleContext;
public class ClientPlugin extends AbstractUIPlugin implements ClientPluginConstants {
public static final String PLUGIN_ID = "org.eclipse.ecf.example.collab"; //$NON-NLS-1$
- public static final String COLLABORATION_IMAGE = "collaboration";
+ public static final String COLLABORATION_IMAGE = "collaboration"; //$NON-NLS-1$
// The shared instance.
private static ClientPlugin plugin;
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java
index 451f71cf0..b0374e28e 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java
@@ -12,6 +12,8 @@
package org.eclipse.ecf.internal.example.collab.ui;
+import org.eclipse.ecf.example.collab.share.io.FileSenderUI;
+
import java.io.File;
import java.io.IOException;
import java.util.*;
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatWindow.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatWindow.java
index 026a042e9..937636823 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatWindow.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatWindow.java
@@ -16,19 +16,10 @@ import org.eclipse.ecf.ui.SharedImages;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.PaletteData;
-import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.*;
public class ChatWindow extends ApplicationWindow {
@@ -218,5 +209,5 @@ public class ChatWindow extends ApplicationWindow {
}
}
}
- };
+ }
} \ No newline at end of file
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/LineChatClientView.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/LineChatClientView.java
index f2403bec7..7051c7db2 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/LineChatClientView.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/LineChatClientView.java
@@ -11,6 +11,8 @@
package org.eclipse.ecf.internal.example.collab.ui;
+import org.eclipse.ecf.example.collab.share.io.FileSenderUI;
+
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/SharedObjectContainerUI.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/SharedObjectContainerUI.java
index 6c6ed33fe..639631940 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/SharedObjectContainerUI.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/SharedObjectContainerUI.java
@@ -65,11 +65,11 @@ public class SharedObjectContainerUI {
} catch (final Exception e) {
}
try {
- topElements.put("Username", System.getProperty("user.name"));
+ topElements.put("Username", System.getProperty("user.name")); //$NON-NLS-1$ //$NON-NLS-2$
} catch (final Exception e) {
}
try {
- topElements.put("Hostname/IP", InetAddress.getLocalHost().toString());
+ topElements.put("Hostname/IP", InetAddress.getLocalHost().toString()); //$NON-NLS-1$
} catch (final Exception e) {
}
return new User(clientID, usernick, usernick, topElements);

Back to the top