Java 类org.eclipse.ui.cheatsheets.ICheatSheetManager 实例源码

项目:SPLevo    文件:StartCASLicenseHandlerRefactoringAction.java   
/**
 * Main-method to start the refactoring.
 * @param params
 *          is not used in this context.
 * @param manager
 *          is not used in this context.
 */
@Override
public void run(String[] params, ICheatSheetManager manager) {
    CASLicenseHandlerConfiguration config = CASLicenseHandlerConfiguration.getInstance();       
    VariationPoint variationPoint = config.getVariationPoint();
    VariationPointModel vpm = config.getVariationPointModel();
    Map<String, Object> refactoringConfigurations = config.getRefactoringConfigurations();

    ConcreteClassifier validator = config.getLicenseValidatorClassifier();

    VariabilityRefactoring refactoring = new SemiAutomatedIfStaticConfigClassOPTXOR(validator, 
                                                                                    config.getVariantToLicenseMap());

    VariabilityRefactoringService refactoringService = new VariabilityRefactoringService();
    try {
           refactoringService.refactorFullyAutomated(refactoring, vpm, variationPoint, refactoringConfigurations);
       } catch (VariabilityRefactoringFailedException e) {
           LOGGER.error("The IfElseRefactoring failed.", e);
           // TODO inform user about failed refactoring
       }
    // TODO add finish action to the cheat sheet and move the following call into this action
    CASLicenseHandlerConfiguration.getInstance().refactoringFinished();
}
项目:SPLevo    文件:OpenTypeDialogAction.java   
/**
 * Main-method to start the dialog.
 * 
 * @param params
 *            is not used in this context.
 * @param manager
 *            is not used in this context.
 */
@Override
public void run(String[] params, ICheatSheetManager manager) {
    FilteredItemsSelectionDialog typeSelectionDialog = initTypeDialog(dialogTitle);

    int dialogResult = typeSelectionDialog.open();
    if (dialogResult != Window.OK) {
        notifyResult(false);
    } else {
        IType type = (IType) typeSelectionDialog.getResult()[0];
        Optional<ConcreteClassifier> classifier = JaMoPPRoutines.getConcreteClassifierOf(type);
        if (classifier.isPresent()) {
            processFoundClassifier(classifier.get());
            notifyResult(true);
        } else {
            openErrorMessage();
            notifyResult(false);
        }
    }
}
项目:SPLevo    文件:VariantToLicenseMappingAction.java   
/**
 * Main-method to start the dialog.
 * 
 * @param params
 *            is not used in this context.
 * @param manager
 *            is not used in this context.
 */
@Override
public void run(String[] params, ICheatSheetManager manager) {
    MappingDialog dialog = new MappingDialog(Display.getCurrent().getActiveShell());
    int returnCode = dialog.open();

    if (returnCode == MappingDialog.OK) {
        notifyResult(true);
        return;
    }

    if (returnCode == MappingDialog.DATA_INCOMPLETE) {
        MessageDialog.openWarning(Display.getCurrent().getActiveShell(), "Incomplete Mapping Information",
                "You did not provide all necessary mapping information. Please repeat this step.");
    }
    notifyResult(false);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:OpenNewMRClassWizardAction.java   
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);
    }
  }
项目:hadoop-EAR    文件:OpenNewMRClassWizardAction.java   
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);
    }
  }
项目:hadoop-on-lustre    文件:OpenNewMRClassWizardAction.java   
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);
    }
  }
项目:birt    文件:TemplateBaseAction.java   
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( );
    }
}
项目:birt    文件:OpenDocAction.java   
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] );
}
项目:RDFS    文件:OpenNewMRClassWizardAction.java   
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);
    }
  }
项目:hadoop-0.20    文件:OpenNewMRClassWizardAction.java   
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);
    }
  }
项目:hanoi-hadoop-2.0.0-cdh    文件:OpenNewMRClassWizardAction.java   
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);
    }
  }
项目:mapreduce-fork    文件:OpenNewMRClassWizardAction.java   
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);
    }
  }
项目:hortonworks-extension    文件:OpenNewMRClassWizardAction.java   
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);
    }
  }
项目:hortonworks-extension    文件:OpenNewMRClassWizardAction.java   
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);
    }
  }
项目:hadoop-gpu    文件:OpenNewMRClassWizardAction.java   
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);
    }
  }
项目:gw4e.project    文件:ProjectImport.java   
@Override
public void run(String[] params, ICheatSheetManager manager) {

    if (params == null || params[0] == null) {
        return;
    }
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    String projectName = params[0];
    String zipName = params[1];
    IProjectDescription newProjectDescription = workspace.newProjectDescription(projectName);
    IProject newProject = workspace.getRoot().getProject(projectName);
    try {
        newProject.create(newProjectDescription, null);
        newProject.open(null);

        URL url = this.getClass().getClassLoader().getResource(zipName);
        File f = new File(FileLocator.toFileURL(url).getPath());

        IOverwriteQuery overwriteQuery = new IOverwriteQuery() {
            public String queryOverwrite(String file) {
                System.out.println(file);
                return ALL;
            }
        };

        FileSystemStructureProvider provider = FileSystemStructureProvider.INSTANCE;

        File root = createTempDirectory();

        unzip(f.getAbsolutePath(), root.getAbsolutePath());

        List<File> files = readFiles(root.getAbsolutePath());
        ImportOperation importOperation = new ImportOperation(newProject.getFullPath(), root, provider,
                overwriteQuery, files);
        importOperation.setCreateContainerStructure(false);
        importOperation.run(new NullProgressMonitor());
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
项目:PDFReporter-Studio    文件:CreateServerAction.java   
public void run(String[] params, ICheatSheetManager manager) {
    run();
    notifyResult(true);
}
项目:PDFReporter-Studio    文件:CreateDataAdapterAction.java   
public void run(String[] params, ICheatSheetManager manager) {
    run();
    notifyResult(true);
}
项目:birt    文件:IOpenDocActionHelper.java   
void run(String[] params, ICheatSheetManager manager);