本文整理汇总了Java中org.eclipse.ui.cheatsheets.ICheatSheetManager类的典型用法代码示例。如果您正苦于以下问题:Java ICheatSheetManager类的具体用法?Java ICheatSheetManager怎么用?Java ICheatSheetManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ICheatSheetManager类属于org.eclipse.ui.cheatsheets包,在下文中一共展示了ICheatSheetManager类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.eclipse.ui.cheatsheets.ICheatSheetManager; //导入依赖的package包/类
/**
* 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();
}
示例2: run
import org.eclipse.ui.cheatsheets.ICheatSheetManager; //导入依赖的package包/类
/**
* 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);
}
}
}
示例3: run
import org.eclipse.ui.cheatsheets.ICheatSheetManager; //导入依赖的package包/类
/**
* 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);
}
示例4: run
import org.eclipse.ui.cheatsheets.ICheatSheetManager; //导入依赖的package包/类
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);
}
}
示例5: run
import org.eclipse.ui.cheatsheets.ICheatSheetManager; //导入依赖的package包/类
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( );
}
}
示例6: run
import org.eclipse.ui.cheatsheets.ICheatSheetManager; //导入依赖的package包/类
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] );
}
示例7: run
import org.eclipse.ui.cheatsheets.ICheatSheetManager; //导入依赖的package包/类
@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();
}
}
示例8: run
import org.eclipse.ui.cheatsheets.ICheatSheetManager; //导入依赖的package包/类
public void run(String[] params, ICheatSheetManager manager) {
run();
notifyResult(true);
}
示例9: run
import org.eclipse.ui.cheatsheets.ICheatSheetManager; //导入依赖的package包/类
void run(String[] params, ICheatSheetManager manager);