org.eclipse.ui.navigator.ICommonActionConstants Java Examples

The following examples show how to use org.eclipse.ui.navigator.ICommonActionConstants. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ActionProvider.java    From hadoop-gpu with Apache License 2.0 6 votes vote down vote up
@Override
public void fillActionBars(IActionBars actionBars) {
  actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),
      new DFSAction(DFSActions.DELETE));
  actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(),
      new DFSAction(DFSActions.REFRESH));

  if (site == null)
    return;

  if ((site.getStructuredViewer().getSelection() instanceof IStructuredSelection)
      && (((IStructuredSelection) site.getStructuredViewer()
          .getSelection()).size() == 1)
      && (((IStructuredSelection) site.getStructuredViewer()
          .getSelection()).getFirstElement() instanceof DFSFile)) {

    actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN,
        new DFSAction(DFSActions.OPEN));
  }

  actionBars.updateActionBars();
}
 
Example #2
Source File: CustomOpenActionProvider.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void fillActionBars(IActionBars theActionBars) {
    if (!contribute) {
        return;
    }
    openFileAction.setContext(getContext());

    OpenAction customOpenAction = createCustomOpenAction();
    if (openFileAction.getOpenAction().isEnabled()) {
        theActionBars.setGlobalActionHandler(ICommonActionConstants.OPEN,
                customOpenAction);
    } else if (UIDArtifactFilters
            .isUIDArtifact(((IStructuredSelection) getContext().getSelection()).getFirstElement())) {
        theActionBars.setGlobalActionHandler(ICommonActionConstants.OPEN,
                customOpenAction);
    }
}
 
Example #3
Source File: PythonActionProvider.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void fillActionBars(IActionBars actionBars) {
    if (openResourceAction.isEnabled()) {
        actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openResourceAction);
    }
    if (copyResourceAction.isEnabled()) {
        actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyResourceAction);
    }
    if (pasteAction.isEnabled()) {
        actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
    }
    if (deleteResourceAction.isEnabled()) {
        actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteResourceAction);
    }
    if (moveResourceAction.isEnabled()) {
        actionBars.setGlobalActionHandler(ActionFactory.MOVE.getId(), moveResourceAction);
    }
}
 
Example #4
Source File: ActionProvider.java    From RDFS with Apache License 2.0 6 votes vote down vote up
@Override
public void fillActionBars(IActionBars actionBars) {
  actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),
      new DFSAction(DFSActions.DELETE));
  actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(),
      new DFSAction(DFSActions.REFRESH));

  if (site == null)
    return;

  if ((site.getStructuredViewer().getSelection() instanceof IStructuredSelection)
      && (((IStructuredSelection) site.getStructuredViewer()
          .getSelection()).size() == 1)
      && (((IStructuredSelection) site.getStructuredViewer()
          .getSelection()).getFirstElement() instanceof DFSFile)) {

    actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN,
        new DFSAction(DFSActions.OPEN));
  }

  actionBars.updateActionBars();
}
 
Example #5
Source File: NavigatorActionProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public void fillActionBars(IActionBars actionBars) {
	if (!myContribute) {
		return;
	}
	IStructuredSelection selection = (IStructuredSelection) getContext()
			.getSelection();
	myOpenDiagramAction.selectionChanged(selection);
	if (myOpenDiagramAction.isEnabled()) {
		actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN,
				myOpenDiagramAction);
	}
}
 
Example #6
Source File: ProcessNavigatorActionProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public void fillActionBars(IActionBars actionBars) {
	if (!myContribute) {
		return;
	}
	IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
	myOpenDiagramAction.selectionChanged(selection);
	if (myOpenDiagramAction.isEnabled()) {
		actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, myOpenDiagramAction);
	}
}
 
Example #7
Source File: GoNavigatorActionProvider.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void fillActionBars(IActionBars actionBars) {
	super.fillActionBars(actionBars);
	
	if(navigatorOpenAction.isEnabled()) {
		actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, navigatorOpenAction);
	}
}
 
Example #8
Source File: OpenActionProvider.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
public void fillActionBars(IActionBars theActionBars) {
	if (!contribute) {
		return;
	}
	IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
	if (selection.size() == 1 && selection.getFirstElement() instanceof IFile) {
		openFileAction.selectionChanged(selection);
		theActionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openFileAction);
	}

}
 
Example #9
Source File: OpenActionProvider.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
public void fillActionBars(IActionBars theActionBars) {
	if (!contribute) {
		return;
	}
	IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
	if (selection.size() == 1 && selection.getFirstElement() instanceof IFile) {
		openFileAction.selectionChanged(selection);
		theActionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openFileAction);
	}

}
 
Example #10
Source File: PackageExplorerOpenActionProvider.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void fillActionBars(IActionBars actionBars) {
	if (fInViewPart) {
		fOpenGroup.fillActionBars(actionBars);

		if (fOpenAndExpand == null && fOpenGroup.getOpenAction().isEnabled()) // TODO: is not updated!
			actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, fOpenGroup.getOpenAction());
		else if (fOpenAndExpand != null && fOpenAndExpand.isEnabled())
			actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, fOpenAndExpand);
	}

}
 
Example #11
Source File: OpenActionProvider.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void fillActionBars(final IActionBars theActionBars) {
	if (!contribute) { return; }
	final IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
	if (selection.size() == 1 && selection.getFirstElement() instanceof WrappedFile) {
		openFileAction.selectionChanged(selection);
		theActionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openFileAction);
	}

}
 
Example #12
Source File: ProjectExplorerOpenActionProvider.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
@Override
  public void fillActionBars(IActionBars actionBars) {
  	if (fInViewPart) {
	fOpenGroup.fillActionBars(actionBars);

	if (fOpenAndExpand == null && fOpenGroup.getOpenAction().isEnabled())
		actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, fOpenGroup.getOpenAction());
	else if (fOpenAndExpand != null && fOpenAndExpand.isEnabled())
		actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, fOpenAndExpand);
}
  }
 
Example #13
Source File: CrossflowNavigatorActionProvider.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
public void fillActionBars(IActionBars actionBars) {
	if (!myContribute) {
		return;
	}
	IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
	myOpenDiagramAction.selectionChanged(selection);
	if (myOpenDiagramAction.isEnabled()) {
		actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, myOpenDiagramAction);
	}
}
 
Example #14
Source File: CommonActionProvider.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void fillActionBars ( final IActionBars actionBars )
{
    if ( this.openAction.isEnabled () )
    {
        actionBars.setGlobalActionHandler ( ICommonActionConstants.OPEN, this.openAction );
    }
}
 
Example #15
Source File: CommonActionProvider.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void fillActionBars ( final IActionBars actionBars )
{
    if ( this.openAction.isEnabled () )
    {
        actionBars.setGlobalActionHandler ( ICommonActionConstants.OPEN, this.openAction );
    }
}
 
Example #16
Source File: N4JSOpenActions.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void fillActionBars(final IActionBars actionBars) {
	if (inViewPart && canEnableOpenAction()) {
		openGroup.fillActionBars(actionBars);
		if (openAndExpandAction == null && openGroup.getOpenAction().isEnabled()) {
			actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openGroup.getOpenAction());
		} else if (openAndExpandAction != null && openAndExpandAction.isEnabled()) {
			actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openAndExpandAction);
		}
	}
}
 
Example #17
Source File: LocalConnectionActionProvider.java    From codewind-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void fillActionBars(IActionBars actionBars) {
	super.fillActionBars(actionBars);
	actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, doubleClickAction);
}
 
Example #18
Source File: TmfActionProvider.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void fillActionBars(IActionBars actionBars) {
    if (openAction.isEnabled()) {
        actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openAction);
    }
}
 
Example #19
Source File: OpenEditorActionGroup.java    From xds-ide with Eclipse Public License 1.0 4 votes vote down vote up
private void setGlobalActionHandlers(IActionBars actionBars) {
	actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, fOpen);
}
 
Example #20
Source File: AppEngineActionProvider.java    From google-cloud-eclipse with Apache License 2.0 4 votes vote down vote up
@Override
public void fillActionBars(IActionBars actionBars) {
  if (openFileAction.isEnabled()) {
    actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openFileAction);
  }
}
 
Example #21
Source File: BuildTargetsActionGroup.java    From goclipse with Eclipse Public License 1.0 4 votes vote down vote up
protected void fillActionBars(IActionBars actionBars, BuildTargetElement buildTargetElement) {
	actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, new BuildSingleTargetAction(buildTargetElement));
}
 
Example #22
Source File: CodewindApplicationActionProvider.java    From codewind-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void fillActionBars(IActionBars actionBars) {
	super.fillActionBars(actionBars);
	actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openAppDoubleClickAction);
}
 
Example #23
Source File: RemoteConnectionActionProvider.java    From codewind-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void fillActionBars(IActionBars actionBars) {
	super.fillActionBars(actionBars);
	actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, remoteDoubleClickAction);
}