use of org.eclipse.ui.navigator.CommonViewer in project translationstudio8 by heartsome.
the class GoIntoActionProvider method init.
public void init(ICommonActionExtensionSite anActionSite) {
anActionSite.getViewSite().getShell();
CommonViewer viewer = (CommonViewer) anActionSite.getStructuredViewer();
goIntoAction = new GoIntoAction(viewer.getFrameList());
}
use of org.eclipse.ui.navigator.CommonViewer in project linuxtools by eclipse.
the class DockerExplorerView method createCommonViewer.
@Override
protected CommonViewer createCommonViewer(final Composite parent) {
final CommonViewer viewer = super.createCommonViewer(parent);
setLinkingEnabled(false);
return viewer;
}
use of org.eclipse.ui.navigator.CommonViewer in project linuxtools by eclipse.
the class RemoveConnectionCommandHandler method execute.
@Override
public Object execute(ExecutionEvent event) {
final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
if (activePart instanceof CommonNavigator) {
final CommonViewer viewer = ((CommonNavigator) activePart).getCommonViewer();
final ITreeSelection selection = (ITreeSelection) viewer.getSelection();
Stream.of(selection.getPaths()).forEach(p -> DockerConnectionManager.getInstance().removeConnection((IDockerConnection) p.getLastSegment()));
}
return null;
}
use of org.eclipse.ui.navigator.CommonViewer in project linuxtools by eclipse.
the class DockerImageHierarchyView method createCommonViewer.
@Override
protected CommonViewer createCommonViewer(final Composite parent) {
final CommonViewer viewer = super.createCommonViewer(parent);
setLinkingEnabled(false);
return viewer;
}
use of org.eclipse.ui.navigator.CommonViewer in project linuxtools by eclipse.
the class EnableConnectionCommandHandler method execute.
@Override
public Object execute(ExecutionEvent event) {
final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
if (activePart instanceof CommonNavigator) {
final CommonViewer viewer = ((CommonNavigator) activePart).getCommonViewer();
final ITreeSelection selection = (ITreeSelection) viewer.getSelection();
for (TreePath treePath : selection.getPaths()) {
final IDockerConnection conn = (IDockerConnection) treePath.getLastSegment();
if (!conn.isOpen()) {
final Job openConnectionJob = new Job(CommandMessages.getFormattedString(// $NON-NLS-1$
"command.enableconnection", conn.getUri())) {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
conn.open(true);
Display.getDefault().asyncExec(() -> viewer.refresh(conn));
} catch (DockerException e) {
Activator.logErrorMessage(CommandMessages.getString(// $NON-NLS-1$
"command.enableconnection.failure"), e);
return Status.CANCEL_STATUS;
}
return Status.OK_STATUS;
}
};
openConnectionJob.schedule();
}
}
}
return null;
}
Aggregations