org.eclipse.ui.cheatsheets.ICheatSheetManager Java Examples

The following examples show how to use org.eclipse.ui.cheatsheets.ICheatSheetManager. 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: TemplateBaseAction.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void run( String[] params, ICheatSheetManager manager )
{
	this.params = params;
	IEditorPart editor = UIUtil.getActiveReportEditor( );
	if ( editor instanceof MultiPageReportEditor )
	{
		// switch to Design Page
		( (MultiPageReportEditor) editor ).setActivePage( ReportLayoutEditorFormPage.ID);

		// init some variables
		ReportLayoutEditor reportDesigner = (ReportLayoutEditor) ( (MultiPageReportEditor) editor )
				.getActivePageInstance( );
		AbstractEditPartViewer viewer = (AbstractEditPartViewer) reportDesigner
				.getGraphicalViewer( );

		// tries to select the EditPart for the item name
		selectEditPartForItemName( params[0], (MultiPageReportEditor) editor, viewer );

		// if the viewer selection contains a match for the class, proceed
		selection = matchSelectionType( viewer );
		if ( selection != null )
		{
			IAction action = getAction( reportDesigner );
			if ( action != null && action.isEnabled( ) )
			{
				action.run( );
			}
		}
		else
		{
			// show an error dialog asking to select the right element
			showErrorWrongElementSelection( );
		}
	}
	else
	{
		// show an error asking to select the right editor
		showErrorWrongEditor( );
	}
}
 
Example #2
Source File: OpenDocAction.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void run( String[] params, ICheatSheetManager manager )
{
	if ( this.helper != null )
	{
		this.helper.run( params, manager );
		return;
	}
	if ( params.length < 1 )
		throw new IllegalArgumentException( );
	PlatformUI.getWorkbench( )
			.getHelpSystem( )
			.displayHelpResource( params[0] );
}
 
Example #3
Source File: OpenNewMRClassWizardAction.java    From RDFS with Apache License 2.0 5 votes vote down vote up
public void run(String[] params, ICheatSheetManager manager) {

    if ((params != null) && (params.length > 0)) {
      IWorkbench workbench = PlatformUI.getWorkbench();
      INewWizard wizard = getWizard(params[0]);
      wizard.init(workbench, new StructuredSelection());
      WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow().getShell(), wizard);
      dialog.create();
      dialog.open();

      // did the wizard succeed ?
      notifyResult(dialog.getReturnCode() == Window.OK);
    }
  }
 
Example #4
Source File: OpenNewMRClassWizardAction.java    From hadoop-gpu with Apache License 2.0 5 votes vote down vote up
public void run(String[] params, ICheatSheetManager manager) {

    if ((params != null) && (params.length > 0)) {
      IWorkbench workbench = PlatformUI.getWorkbench();
      INewWizard wizard = getWizard(params[0]);
      wizard.init(workbench, new StructuredSelection());
      WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow().getShell(), wizard);
      dialog.create();
      dialog.open();

      // did the wizard succeed ?
      notifyResult(dialog.getReturnCode() == Window.OK);
    }
  }
 
Example #5
Source File: IOpenDocActionHelper.java    From birt with Eclipse Public License 1.0 votes vote down vote up
void run(String[] params, ICheatSheetManager manager);