本文整理汇总了Java中org.eclipse.ui.actions.RetargetAction.setToolTipText方法的典型用法代码示例。如果您正苦于以下问题:Java RetargetAction.setToolTipText方法的具体用法?Java RetargetAction.setToolTipText怎么用?Java RetargetAction.setToolTipText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.actions.RetargetAction
的用法示例。
在下文中一共展示了RetargetAction.setToolTipText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.eclipse.ui.actions.RetargetAction; //导入方法依赖的package包/类
@Override
public IWorkbenchAction create(IWorkbenchWindow window) {
if (window == null) {
throw new IllegalArgumentException();
}
String string = "Add " + EPlanUtils.getActivityGroupDisplayName();
String description = "This action will add a new "
+ EPlanUtils.getActivityGroupDisplayName()
+ " to the plan.";
RetargetAction action = new RetargetAction(getId(), string);
action.setToolTipText(string);
action.setDescription(description);
window.getPartService().addPartListener(action);
action.setActionDefinitionId("gov.nasa.ensemble.core.plan.editor.newActivityGroupAction"); //$NON-NLS-1$
action.setImageDescriptor(new ImageDescriptor() {
@Override
public ImageData getImageData() {
return ADD_GROUP_ICON;
}
});
return action;
}
示例2: buildActions
import org.eclipse.ui.actions.RetargetAction; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected void buildActions() {
addRetargetAction(new UndoRetargetAction());
addRetargetAction(new RedoRetargetAction());
addRetargetAction(new DeleteRetargetAction());
// add grid icon to grid action
final RetargetAction gridAction =
new RetargetAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY, "", IAction.AS_CHECK_BOX);
gridAction.setImageDescriptor(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
"icons/grid.png"));
gridAction.setToolTipText(TOGGLE_GRID_LABEL);
addRetargetAction(gridAction);
final RetargetAction snapAction =
new RetargetAction(GEFActionConstants.TOGGLE_SNAP_TO_GEOMETRY, "", IAction.AS_CHECK_BOX);
snapAction.setImageDescriptor(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
"icons/grid-snap.png"));
snapAction.setToolTipText(TOGGLE_SNAP_TO_GERMETRY_LABEL);
addRetargetAction(snapAction);
}