use of org.eclipse.ecf.internal.example.collab.ClientEntry in project ecf by eclipse.
the class JoinGroupWizardAction method isConnected.
private ClientEntry isConnected(IResource res) {
if (res == null)
return null;
CollabClient client = CollabClient.getDefault();
ClientEntry entry = client.isConnected(res, CollabClient.GENERIC_CONTAINER_CLIENT_NAME);
return entry;
}
use of org.eclipse.ecf.internal.example.collab.ClientEntry in project ecf by eclipse.
the class OpenSharedEditorAction method run.
public void run(IAction action) {
if (file == null) {
return;
}
final IProject project = file.getProject();
final ClientEntry entry = isConnected(project);
if (entry == null) {
MessageDialog.openInformation(targetPart.getSite().getWorkbenchWindow().getShell(), Messages.OpenSharedEditorAction_DIALOG_NOT_CONNECTED_TITLE, NLS.bind(Messages.OpenSharedEditorAction_DIALOG_NOT_CONNECTED_TEXT, project.getName()));
return;
}
final EclipseCollabSharedObject collabsharedobject = entry.getSharedObject();
if (collabsharedobject != null) {
collabsharedobject.sendLaunchEditorForFile(null, file.getProjectRelativePath().toString());
}
}
use of org.eclipse.ecf.internal.example.collab.ClientEntry in project ecf by eclipse.
the class OpenSharedEditorAction method isConnected.
protected ClientEntry isConnected(IResource res) {
if (res == null)
return null;
final CollabClient client = CollabClient.getDefault();
final ClientEntry entry = client.isConnected(res, CollabClient.GENERIC_CONTAINER_CLIENT_NAME);
return entry;
}
use of org.eclipse.ecf.internal.example.collab.ClientEntry in project ecf by eclipse.
the class SetSharedEditorSelectionAction method run.
public void run(IAction action) {
if (editor == null)
return;
final ISelection s = editor.getSelectionProvider().getSelection();
ITextSelection textSelection = null;
if (s instanceof ITextSelection) {
textSelection = (ITextSelection) s;
}
if (textSelection == null)
return;
final IFile file = getFileForPart(editor);
if (file == null)
return;
final IProject project = file.getProject();
final ClientEntry entry = isConnected(project.getWorkspace().getRoot());
if (entry == null) {
MessageDialog.openInformation(getWorkbench().getDisplay().getActiveShell(), Messages.SetSharedEditorSelectionAction_DIALOG_NOT_CONNECTED_TITLE, Messages.SetSharedEditorSelectionAction_DIALOG_NOT_CONNECTED_TEXT);
return;
}
final EclipseCollabSharedObject collabsharedobject = entry.getSharedObject();
if (collabsharedobject != null) {
// $NON-NLS-1$
collabsharedobject.sendOpenAndSelectForFile(null, project.getName() + "/" + file.getProjectRelativePath().toString(), textSelection.getOffset(), textSelection.getLength());
}
}
use of org.eclipse.ecf.internal.example.collab.ClientEntry in project ecf by eclipse.
the class JoinGroupWizardAction method run.
public void run(IAction action) {
if (!connected) {
JoinGroupWizard wizard = new JoinGroupWizard(resource, PlatformUI.getWorkbench(), connectID);
Shell shell = null;
if (targetPart == null) {
shell = (window == null) ? null : window.getShell();
} else {
shell = targetPart.getSite().getShell();
}
// Create the wizard dialog
WizardDialog dialog = new WizardDialog(shell, wizard);
// Open the wizard dialog
dialog.open();
} else {
ClientEntry client = isConnected(resource);
if (client == null) {
connected = false;
action.setText(CONNECT_PROJECT_MENU_TEXT);
} else {
EclipseCollabSharedObject collab = client.getSharedObject();
if (collab != null) {
collab.chatGUIDestroy();
}
}
}
}
Aggregations