List of usage examples for org.eclipse.jface.viewers StructuredSelection StructuredSelection
public StructuredSelection(List elements)
List
. From source file:com.aptana.ide.syncing.ui.dialogs.SiteConnectionsEditorDialog.java
License:Open Source License
@Override protected Control createContents(Composite parent) { try {// w ww . j a v a 2s .c om return super.createContents(parent); } finally { if (initialSelection != null) { sitesViewer.setSelection(new StructuredSelection(initialSelection), true); } } }
From source file:com.aptana.ide.syncing.ui.dialogs.SiteConnectionsEditorDialog.java
License:Open Source License
protected void createActions(IMenuManager menuManager) { menuManager.add(new Action(Messages.SiteConnectionsEditorDialog_LBL_Duplicate) { @Override/*from w w w. java 2 s . c om*/ public void run() { ISiteConnection siteConnection = (ISiteConnection) ((IStructuredSelection) sitesViewer .getSelection()).getFirstElement(); if (siteConnection != null && doSelectionChange()) { try { ISiteConnection newSite = SyncingPlugin.getSiteConnectionManager() .cloneSiteConnection(siteConnection); newSite.setName(MessageFormat.format("Copy of {0}", siteConnection.getName())); //$NON-NLS-1$ sites.add(newSite); sitesViewer.refresh(); sitesViewer.setSelection(new StructuredSelection(newSite), true); } catch (CoreException e) { UIUtils.showErrorMessage(Messages.SiteConnectionsEditorDialog_ERR_Duplicate, e); } } } }); }
From source file:com.aptana.ide.syncing.ui.dialogs.SiteConnectionsEditorDialog.java
License:Open Source License
public void setSelection(ISiteConnection selection) { this.initialSelection = selection; if (sitesViewer != null) { sitesViewer.setSelection(new StructuredSelection(selection), true); }//from w ww. j a v a 2s .c o m }
From source file:com.aptana.ide.syncing.ui.handlers.CloakHandler.java
License:Open Source License
public Object execute(ExecutionEvent event) throws ExecutionException { CloakAction action = new CloakAction(); action.setActivePart(null, HandlerUtil.getActivePart(event)); action.setSelection(new StructuredSelection(getSelectedFiles())); action.run(null);/* w w w .j a v a 2 s. c o m*/ return null; }
From source file:com.aptana.ide.syncing.ui.handlers.ConnectionManagerHandler.java
License:Open Source License
public Object execute(ExecutionEvent event) throws ExecutionException { ConnectionManagerAction action = new ConnectionManagerAction(); action.setActivePart(null, HandlerUtil.getActivePart(event)); action.setSelection(new StructuredSelection(getSelectedResources())); action.run(null);/*from w ww.j a va2 s .c om*/ return null; }
From source file:com.aptana.ide.syncing.ui.handlers.DownloadHandler.java
License:Open Source License
public Object execute(ExecutionEvent event) throws ExecutionException { DownloadAction action = new DownloadAction(); action.setActivePart(null, HandlerUtil.getActivePart(event)); action.setSelection(new StructuredSelection(getSelectedResources()), isSelectionFromSource()); action.run(null);/*from w w w. j a va 2s . c o m*/ return null; }
From source file:com.aptana.ide.syncing.ui.handlers.NewSiteHandler.java
License:Open Source License
public Object execute(ExecutionEvent event) throws ExecutionException { NewSiteAction action = new NewSiteAction(); action.setActivePart(null, HandlerUtil.getActivePart(event)); action.setSelection(new StructuredSelection(getSelectedResources())); action.run(null);/*www . ja v a2s. c om*/ return null; }
From source file:com.aptana.ide.syncing.ui.handlers.SynchronizeFilesHandler.java
License:Open Source License
public Object execute(ExecutionEvent event) throws ExecutionException { SynchronizeFilesAction action = new SynchronizeFilesAction(); action.setActivePart(null, HandlerUtil.getActivePart(event)); action.setSelection(new StructuredSelection(getSelectedResources()), isSelectionFromSource()); action.run(null);/*from www .ja v a 2 s.c o m*/ return null; }
From source file:com.aptana.ide.syncing.ui.handlers.SynchronizeHandler.java
License:Open Source License
public Object execute(ExecutionEvent event) throws ExecutionException { SynchronizeAction action = new SynchronizeAction(); action.setActivePart(null, HandlerUtil.getActivePart(event)); action.setSelection(new StructuredSelection(getSelectedResources()), isSelectionFromSource()); action.run(null);/* www . j a va 2 s . co m*/ return null; }
From source file:com.aptana.ide.syncing.ui.handlers.SynchronizeProjectHandler.java
License:Open Source License
public Object execute(ExecutionEvent event) throws ExecutionException { SynchronizeProjectAction action = new SynchronizeProjectAction(); action.setActivePart(null, HandlerUtil.getActivePart(event)); action.setSelection(new StructuredSelection(getSelectedResources()), isSelectionFromSource()); action.run(null);/*from w w w. j av a 2 s . c om*/ return null; }