Java 类org.eclipse.ui.cheatsheets.OpenCheatSheetAction 实例源码
项目:thym
文件:MissingRequirementsDialog.java
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
Link messageLnk = new Link(composite,SWT.NONE);
messageLnk.setText(this.message);
messageLnk.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
OpenCheatSheetAction ch = new OpenCheatSheetAction("org.eclipse.thym.ui.requirements.cordova");
ch.run();
}
});
return composite;
}
项目:SPLevo
文件:CASLicenseHandlerVariabilityRefactoring.java
@Override
public List<Resource> startManualRefactoringInternal(VariationPoint variationPoint,
Map<String, Object> refactoringConfigurations) throws VariabilityRefactoringFailedException {
CASLicenseHandlerConfiguration config = CASLicenseHandlerConfiguration.getInstance();
config.setConsolidationProject((SPLevoProject) refactoringConfigurations
.get(VariabilityRefactoringService.SPLEVO_PROJECT));
config.setRefactoringConfigurations(refactoringConfigurations);
config.setVariationPoint(variationPoint);
config.refactoringStarted();
final OpenCheatSheetAction action = new OpenCheatSheetAction(
CASLicenseHandlerMetaInf.CAS_LICENSE_HANDLER_CHEAT_SHEET_ID);
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
// TODO Usage of internal classes for cheatsheet resetting should be avoided.
CheatSheetView view = ViewUtilities.showCheatSheetView();
action.run();
view.getCheatSheetViewer().reset(null);
}
});
try {
config.waitForRefactoringToBeFinished();
} catch (InterruptedException e) {
throw new VariabilityRefactoringFailedException(
"The refactoring has been aborted before it has been finished.", e);
}
return Lists.newArrayList();
}