本文整理汇总了Java中org.eclipse.jface.action.IAction.AS_CHECK_BOX属性的典型用法代码示例。如果您正苦于以下问题:Java IAction.AS_CHECK_BOX属性的具体用法?Java IAction.AS_CHECK_BOX怎么用?Java IAction.AS_CHECK_BOX使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jface.action.IAction
的用法示例。
在下文中一共展示了IAction.AS_CHECK_BOX属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPreferenceAction
private IAction createPreferenceAction(String label, String preference, String icon) {
IAction ret = new Action(label, IAction.AS_CHECK_BOX) {
@Override
public void run() {
Activator.getDefault().getPreferenceStore().setValue(preference, isChecked());
try {
viewer.reset();
} catch (Exception e) {
logger.error("Cannot refresh scannable viewer!", e);
}
}
};
ret.setImageDescriptor(Activator.getImageDescriptor(icon));
ret.setChecked(Activator.getDefault().getPreferenceStore().getBoolean(preference));
return ret;
}
示例2: createPreferenceAction
private IAction createPreferenceAction(String label, String preference, String icon) {
IAction ret = new Action(label, IAction.AS_CHECK_BOX) {
@Override
public void run() {
Activator.getDefault().getPreferenceStore().setValue(preference, isChecked());
viewer.refresh();
}
};
ret.setImageDescriptor(Activator.getImageDescriptor(icon));
ret.setChecked(Activator.getDefault().getPreferenceStore().getBoolean(preference));
return ret;
}
示例3: createButtonAction
private IAction createButtonAction(String propName, String label, String iconPath, DelegatingSelectionProvider prov) {
IAction ret = new Action(label, IAction.AS_CHECK_BOX) {
@Override
public void run() {
updatePositionSelection(propName, isChecked(), prov);
}
};
ret.setChecked(store.getBoolean(propName));
ret.setImageDescriptor(Activator.getImageDescriptor(iconPath));
return ret;
}
示例4: setDynamicMenuOptions
private void setDynamicMenuOptions(IMenuManager mm) {
mm.add(add);
mm.add(delete);
mm.add(clear);
mm.add(new Separator());
IPointGenerator<?> gen = null;
try {
ISeriesItemDescriptor selected = seriesTable.getSelected();
if (!(selected instanceof GeneratorDescriptor)) return;
gen = ((GeneratorDescriptor)selected).getSeriesObject();
} catch (Exception e1) {
}
final IAction passUnMod = new Action("Enabled", IAction.AS_CHECK_BOX) {
@Override
public void run() {
ISeriesItemDescriptor current = seriesTable.getSelected();
if (current instanceof GeneratorDescriptor) {
try {
((GeneratorDescriptor)current).getSeriesObject().setEnabled(isChecked());
seriesTable.refreshTable();
} catch (Exception e) {
logger.error("Problem refreshing series table!", e);
}
}
}
};
if (gen != null && !gen.isEnabled()) passUnMod.setChecked(true);
mm.add(passUnMod);
}
示例5: createPreferenceAction
private IAction createPreferenceAction(String label, String preference, String icon) {
IAction ret = new Action(label, IAction.AS_CHECK_BOX) {
@Override
public void run() {
Activator.getDefault().getPreferenceStore().setValue(preference, isChecked());
updateJob.schedule();
}
};
ret.setImageDescriptor(Activator.getImageDescriptor(icon));
ret.setChecked(Activator.getDefault().getPreferenceStore().getBoolean(preference));
return ret;
}
示例6: createFieldRoleActions
private void createFieldRoleActions(CheckableActionGroup group) {
FieldRole[] roles = FieldRole.values();
for (FieldRole role : roles) {
IAction action = new Action(role.getLabel(), IAction.AS_CHECK_BOX) {
@Override
public void run() {
setFieldRole(role);
}
};
//action.setImageDescriptor(newImage);
group.add(action);
}
}
示例7: createActions
/**
* 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());
}
示例8: ToggleNafAction
public ToggleNafAction(UiAutomatorView view) {
super("&Toggle NAF Nodes", IAction.AS_CHECK_BOX);
setChecked(view.shouldShowNafNodes());
mView = view;
}
示例9: createPartControl
/**
* This is a callback that will allow us to create the viewer and initialize
* it.
*/
@Override
public void createPartControl ( final Composite parent )
{
super.createPartControl ( parent );
this.scheduler = ScheduledExportedExecutorService.newSingleThreadExportedScheduledExecutor ( ID + "/" + getViewSite ().getSecondaryId () );
// resume Action
this.resumeAction = new CustomizableAction ();
this.resumeAction.setText ( Messages.EventHistoryView_Action_Resume_Text );
this.resumeAction.setToolTipText ( Messages.EventHistoryView_Action_Resume_ToolTop );
this.resumeAction.setImageDescriptor ( ImageDescriptor.createFromURL ( Activator.getDefault ().getBundle ().getResource ( "icons/resume.gif" ) ) ); //$NON-NLS-1$
this.resumeAction.setDisabledImageDescriptor ( ImageDescriptor.createFromURL ( Activator.getDefault ().getBundle ().getResource ( "icons/resume_disabled.gif" ) ) ); //$NON-NLS-1$
this.resumeAction.setEnabled ( false );
this.resumeAction.setRunnable ( new Runnable () {
@Override
public void run ()
{
resumeEventsRetrieval ();
}
} );
// clear Action
this.clearAction = new CustomizableAction ();
this.clearAction.setText ( Messages.EventHistoryView_Action_Clear_Text );
this.clearAction.setToolTipText ( Messages.EventHistoryView_Action_Clear_ToolTip );
this.clearAction.setImageDescriptor ( ImageDescriptor.createFromURL ( Activator.getDefault ().getBundle ().getResource ( "icons/clear_search.gif" ) ) ); //$NON-NLS-1$
this.clearAction.setEnabled ( false );
this.clearAction.setRunnable ( new Runnable () {
@Override
public void run ()
{
clearData ();
EventHistoryView.this.searchAction.setChecked ( false );
}
} );
// search Action
this.searchAction = new CustomizableAction ( "", IAction.AS_CHECK_BOX );
this.searchAction.setText ( Messages.EventHistoryView_Action_Search_Text );
this.searchAction.setToolTipText ( Messages.EventHistoryView_Action_Search_ToolTip );
this.searchAction.setImageDescriptor ( ImageDescriptor.createFromURL ( Activator.getDefault ().getBundle ().getResource ( "icons/search.gif" ) ) ); //$NON-NLS-1$
this.searchAction.setDisabledImageDescriptor ( ImageDescriptor.createFromURL ( Activator.getDefault ().getBundle ().getResource ( "icons/search_disabled.gif" ) ) ); //$NON-NLS-1$
this.searchAction.setEnabled ( false );
this.searchAction.setRunnable ( new Runnable () {
@Override
public void run ()
{
EventHistoryView.this.searchAction.setChecked ( true );
pauseEventsRetrieval ();
startEventsRetrieval ();
}
} );
final IToolBarManager toolBarManager = getViewSite ().getActionBars ().getToolBarManager ();
toolBarManager.add ( this.resumeAction );
toolBarManager.add ( this.searchAction );
toolBarManager.add ( this.clearAction );
// label which contains no of retrieved events
this.events = new WritableSet ( DisplayRealm.getRealm ( parent.getDisplay () ) );
// load configuration first, since we need the additional columns later
loadConfiguration ();
this.eventsTable = new EventViewTable ( getContentPane (), getViewSite (), SWT.BORDER, this.events, this.initialColumnSettings, this.columnInformations );
this.eventsTable.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true, 1, 1 ) );
getSite ().setSelectionProvider ( this.eventsTable.getTableViewer () );
}
示例10: createConnectionActions
private void createConnectionActions() {
connectors.clear();
String lastId = Activator.getDefault().getPreferenceStore().getString(DevicePreferenceConstants.STREAM_ID);
final IConfigurationElement[] eles = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.scanning.api.stream");
for (IConfigurationElement e : eles) {
CheckableActionGroup group = new CheckableActionGroup();
try {
final IStreamConnection<ILazyDataset> connection = (IStreamConnection<ILazyDataset>)e.createExecutableExtension("stream");
connectors.add(connection);
connection.setId(e.getAttribute("id"));
connection.setLabel(e.getAttribute("label"));
final String iconPath = e.getAttribute("icon");
ImageDescriptor icon=null;
if (iconPath!=null) {
final String id = e.getContributor().getName();
final Bundle bundle= Platform.getBundle(id);
final URL entry = bundle.getEntry(iconPath);
icon = ImageDescriptor.createFromURL(entry);
}
final MenuAction menu = new MenuAction(connection.getLabel());
final IAction connect = new Action(connection.getLabel(), IAction.AS_CHECK_BOX) {
@Override
public void run() {
connect(connection);
}
};
connect.setImageDescriptor(icon);
connect.setChecked(lastId!=null && lastId.equals(connection.getId()));
group.add(connect);
menu.add(connect);
menu.setSelectedAction(connect);
final IAction configure = new Action("Configure...") {
@Override
public void run() {
configure(connection);
}
};
menu.add(configure);
getViewSite().getActionBars().getToolBarManager().add(menu);
} catch (Exception ne) {
logger.error("Problem creating stream connection for "+e, ne);
}
getViewSite().getActionBars().getToolBarManager().add(new Separator());
}
}
示例11: PersistBoundsAction
PersistBoundsAction() {
super(JFaceResources.getString("PopupDialog.persistBounds"), //$NON-NLS-1$
IAction.AS_CHECK_BOX);
setChecked(persistLocation && persistSize);
}
示例12: PersistSizeAction
PersistSizeAction() {
super(JFaceResources.getString("PopupDialog.persistSize"), //$NON-NLS-1$
IAction.AS_CHECK_BOX);
setChecked(persistSize);
}
示例13: PersistLocationAction
PersistLocationAction() {
super(JFaceResources.getString("PopupDialog.persistLocation"), //$NON-NLS-1$
IAction.AS_CHECK_BOX);
setChecked(persistLocation);
}
示例14: getShowGridRetargetAction
private RetargetAction getShowGridRetargetAction() {
RetargetAction showGridAction = new RetargetAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY, "显示网格", IAction.AS_CHECK_BOX);
showGridAction.setImageDescriptor(Activator.getImageDescriptor(Activator.IMAGE_GRID));
return showGridAction;
}