當前位置: 首頁>>代碼示例>>Java>>正文


Java IAction.setChecked方法代碼示例

本文整理匯總了Java中org.eclipse.jface.action.IAction.setChecked方法的典型用法代碼示例。如果您正苦於以下問題:Java IAction.setChecked方法的具體用法?Java IAction.setChecked怎麽用?Java IAction.setChecked使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.action.IAction的用法示例。


在下文中一共展示了IAction.setChecked方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createPreferenceAction

import org.eclipse.jface.action.IAction; //導入方法依賴的package包/類
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;
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:17,代碼來源:MonitorView.java

示例2: togglePausedConsumer

import org.eclipse.jface.action.IAction; //導入方法依賴的package包/類
protected void togglePausedConsumer(IAction pauseConsumer) {

		// The button can get out of sync if two clients are used.
		final boolean currentState = queueConnection.isQueuePaused(getSubmissionQueueName());
		try {
			pauseConsumer.setChecked(!currentState); // We are toggling it.

			IPublisher<PauseBean> pauser = service.createPublisher(getUri(), IEventService.CMD_TOPIC);
			pauser.setStatusSetName(IEventService.CMD_SET); // The set that other clients may check
			pauser.setStatusSetAddRequired(true);

			PauseBean pbean = new PauseBean();
			pbean.setQueueName(getSubmissionQueueName()); // The queue we are pausing
			pbean.setPause(pauseConsumer.isChecked());
			pauser.broadcast(pbean);

		} catch (Exception e) {
			ErrorDialog.openError(getViewSite().getShell(), "Cannot pause queue "+getSubmissionQueueName(), "Cannot pause queue "+getSubmissionQueueName()+"\n\nPlease contact your support representative.",
					new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()));
		}
		pauseConsumer.setChecked(queueConnection.isQueuePaused(getSubmissionQueueName()));
	}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:23,代碼來源:StatusQueueView.java

示例3: selectionChanged

import org.eclipse.jface.action.IAction; //導入方法依賴的package包/類
public void selectionChanged(IAction action, ISelection selection) {
	super.selectionChanged(action, selection);
	IStructuredSelection structuredSelection = (IStructuredSelection) selection;
	TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
	if (treeObject instanceof ConnectorTreeObject) {
		DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
		ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
		action.setChecked(actionModel.isChecked);
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:11,代碼來源:SetDefaultConnectorAction.java

示例4: selectionChanged

import org.eclipse.jface.action.IAction; //導入方法依賴的package包/類
public void selectionChanged(IAction action, ISelection selection) {
	super.selectionChanged(action, selection);
	IStructuredSelection structuredSelection = (IStructuredSelection) selection;
	TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
	if (treeObject instanceof TransactionTreeObject) {
		DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
		ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
		action.setChecked(actionModel.isChecked);
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:11,代碼來源:SetDefaultTransactionAction.java

示例5: selectionChanged

import org.eclipse.jface.action.IAction; //導入方法依賴的package包/類
public void selectionChanged(IAction action, ISelection selection) {
	super.selectionChanged(action, selection);
	IStructuredSelection structuredSelection = (IStructuredSelection) selection;
	TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
	if (treeObject instanceof MobilePageComponentTreeObject) {
		DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
		ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
		action.setChecked(actionModel.isChecked);
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:11,代碼來源:SetMobileRootPageAction.java

示例6: createPreferenceAction

import org.eclipse.jface.action.IAction; //導入方法依賴的package包/類
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;
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:13,代碼來源:DetectorView.java

示例7: createButtonAction

import org.eclipse.jface.action.IAction; //導入方法依賴的package包/類
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;
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:12,代碼來源:ScanView.java

示例8: setDynamicMenuOptions

import org.eclipse.jface.action.IAction; //導入方法依賴的package包/類
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);
	}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:36,代碼來源:ScanView.java

示例9: createPreferenceAction

import org.eclipse.jface.action.IAction; //導入方法依賴的package包/類
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;
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:13,代碼來源:ExecuteView.java

示例10: createConnectionActions

import org.eclipse.jface.action.IAction; //導入方法依賴的package包/類
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());
		}

	}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:58,代碼來源:StreamView.java


注:本文中的org.eclipse.jface.action.IAction.setChecked方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。