本文整理汇总了Java中org.eclipse.jface.action.Action.setImageDescriptor方法的典型用法代码示例。如果您正苦于以下问题:Java Action.setImageDescriptor方法的具体用法?Java Action.setImageDescriptor怎么用?Java Action.setImageDescriptor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.action.Action
的用法示例。
在下文中一共展示了Action.setImageDescriptor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createActions
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void createActions() {
newNodeAction = new NewNodeAction(this);
renameNodeAction = new RenameNodeAction(this);
deleteNodeAction = new DeleteNodeAction(this);
moveUpNodeAction = new MoveUpNodeAction(this);
moveDownNodeAction = new MoveDownNodeAction(this);
promoteNodeAction = new PromoteNodeAction(this);
demoteNodeAction = new DemoteNodeAction(this);
refreshAction = new Action() {
@Override
public void run() {
refresh();
}
};
refreshAction.setText(Messages.getString("CommonStructureControl.RefreshActionText")); //$NON-NLS-1$
refreshAction.setImageDescriptor(
AbstractUIPlugin.imageDescriptorFromPlugin(TFSCommonUIClientPlugin.PLUGIN_ID, "icons/Refresh.gif")); //$NON-NLS-1$
}
示例2: createTerminateAction
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private Action createTerminateAction() {
Action terminate = new Action(Messages.getString("action.stop")) {
@Override
public void run() {
DeployJob job = console.getJob();
if (job != null) {
job.cancel();
update();
}
}
};
terminate.setToolTipText(Messages.getString("action.stop"));
terminate.setImageDescriptor(getSharedImage(ISharedImages.IMG_ELCL_STOP));
terminate.setHoverImageDescriptor(getSharedImage(ISharedImages.IMG_ELCL_STOP));
terminate.setDisabledImageDescriptor(getSharedImage(ISharedImages.IMG_ELCL_STOP_DISABLED));
return terminate;
}
示例3: configureToolBar
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void configureToolBar(IToolBarManager toolbarManager) {
terminateAction = new Action(Messages.actionStop) {
@Override
public void run() {
//code to execute when button is pressed
LocalAppEngineServerBehaviour serverBehaviour = console.getServerBehaviourDelegate();
if (serverBehaviour != null) {
// try to initiate a nice shutdown
boolean force = serverBehaviour.getServer().getServerState() == IServer.STATE_STOPPING;
serverBehaviour.stop(force);
}
update();
}
};
terminateAction.setToolTipText(Messages.actionStopToolTip);
terminateAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_STOP));
terminateAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_STOP));
terminateAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_STOP));
toolbarManager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, terminateAction);
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:22,代码来源:LocalAppEngineConsolePageParticipant.java
示例4: createActions
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void createActions() {
_actionTTSpeed_Add = new ActionSpeedTourType_Add();
_actionTTSpeed_Sort = new ActionSpeedTourType_Sort();
_actionOpenTourTypePrefs = new ActionOpenPrefDialog(
Messages.action_tourType_modify_tourTypes,
ITourbookPreferences.PREF_PAGE_TOUR_TYPE);
/*
* Action: Restore default
*/
_actionRestoreDefaults = new Action() {
@Override
public void run() {
resetDashboardToDefaults();
}
};
_actionRestoreDefaults.setImageDescriptor(//
TourbookPlugin.getImageDescriptor(Messages.Image__App_RestoreDefault));
_actionRestoreDefaults.setToolTipText(Messages.App_Action_RestoreDefault_Tooltip);
}
示例5: configureAction
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
@Override
protected void configureAction(Action action) {
action.setText("Hide Local Types");
action.setDescription("Hide Local Types");
action.setToolTipText("Hide Local (not exported) types");
action.setImageDescriptor(imageHelper.getImageDescriptor("localtypes_co.png"));
}
示例6: configureAction
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
@Override
protected void configureAction(Action action) {
action.setText("Hide Static Members");
action.setDescription("Hide Static Members");
action.setToolTipText("Hide Static Fields and Methods");
action.setImageDescriptor(imageHelper.getImageDescriptor("static_co.png"));
}
示例7: configureAction
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
@Override
protected void configureAction(Action action) {
action.setText("Hide Non-Public Members");
action.setDescription("Hide Non-Public Members");
action.setToolTipText("Hide Non-Public Fields and Methods");
action.setImageDescriptor(imageHelper.getImageDescriptor("public_co.png"));
}
示例8: configureAction
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
@Override
protected void configureAction(Action action) {
action.setText("Show Inherited Members");
action.setDescription("Show Inherited Members");
action.setToolTipText("Show inherited, consumed, and polyfilled members");
action.setImageDescriptor(imageHelper.getImageDescriptor("inher_co.png"));
}
示例9: createAction
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
/**
* Creates a single action.
*/
protected Action createAction(String text, int style, String tooltip, ImageDescriptor imageDescriptor,
Runnable runnable) {
final Action a = new Action(text, style) {
@Override
public void run() {
if (runnable != null)
runnable.run();
}
};
a.setToolTipText(tooltip);
a.setImageDescriptor(imageDescriptor);
return a;
}
示例10: createAction
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private Action createAction(String label, int style, String tooltip, ImageDescriptor image,
Consumer<Action> onRun) {
final Action result = new Action(label, style) {
@Override
public void run() {
onRun.accept(this);
}
};
result.setText(label);
result.setToolTipText(tooltip);
result.setImageDescriptor(image);
getViewSite().getActionBars().getToolBarManager().add(result);
return result;
}
示例11: createActions
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void createActions() {
sampleAction = new Action() {
public void run() {
MessageDialog.openInformation(null, "osets-eclipse-plugin", "Sample Action Executed");
}
};
sampleAction.setText("Sample Action");
sampleAction.setToolTipText("Sample Action tool tip");
sampleAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(IDE.SharedImages.IMG_OBJS_TASK_TSK));
}
示例12: addtoolbarAction
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void addtoolbarAction(ToolBarManager toolBarManager, final ImagePathConstant imagePath, Action action) {
ImageDescriptor exportImageDescriptor = new ImageDescriptor() {
@Override
public ImageData getImageData() {
return imagePath.getImageFromRegistry().getImageData();
}
};
action.setImageDescriptor(exportImageDescriptor);
toolBarManager.add(action);
}
示例13: addtoolbarAction
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
/**
* Addtoolbar action.
*
* @param toolBarManager the tool bar manager
* @param imagePath the image path
* @param action the action
*/
private void addtoolbarAction(ToolBarManager toolBarManager, final ImagePathConstant imagePath, Action action) {
ImageDescriptor exportImageDescriptor = new ImageDescriptor() {
@Override
public ImageData getImageData() {
return imagePath.getImageFromRegistry().getImageData();
}
};
action.setImageDescriptor(exportImageDescriptor);
toolBarManager.add(action);
}
示例14: createActions
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
/**
* Créé les actions de la page.
*/
private void createActions() {
/* Créé l'action de tri de l'arborescence */
sortAction = new Action("Sort", IAction.AS_CHECK_BOX) {
@Override
public void run() {
sortDeclarations();
}
};
sortAction.setImageDescriptor(ImageUtils.getSortImage());
}
示例15: createControl
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
super.createControl(parent);
this.getTreeViewer().setLabelProvider(new PropertiesOutlineLabelProvider());
this.getTreeViewer().setContentProvider(new PropsOutlineProvider());
this.getTreeViewer().setInput(inputPropertyFile);
IToolBarManager toolbar = getSite().getActionBars().getToolBarManager();
Action action = new SortAction("Sort", 2);
action.setText(action.getText());
action.setImageDescriptor(getDescriptor());
toolbar.add(action);
}