当前位置: 首页>>代码示例>>Java>>正文


Java Execute类代码示例

本文整理汇总了Java中org.eclipse.e4.core.di.annotations.Execute的典型用法代码示例。如果您正苦于以下问题:Java Execute类的具体用法?Java Execute怎么用?Java Execute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Execute类属于org.eclipse.e4.core.di.annotations包,在下文中一共展示了Execute类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
/**
 * Execute.
 * @param registry the registry
 */
@Execute
   public void execute() {
       
   	System.out.println("Start evaluating available extensions");
   	IConfigurationElement[] config = this.getExtensionRegistry().getConfigurationElementsFor(PLUGIN_ID);
   	
       try {
       	
           for (IConfigurationElement e : config) {
               System.out.println("Evaluating extension " + e.getName());
               final Object object = e.createExecutableExtension("class");
               if (object instanceof PlugIn) {
                   executeExtension(object);
               }
           }
       } catch (CoreException ex) {
           System.err.println(ex.getMessage());
       }
   }
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:24,代码来源:EvaluateContributionsHandler.java

示例2: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
@Execute
public void execute(
		@Optional @Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
		@Optional TerminologyService terminologyService,
		@Optional ETerminology terminology,
		@Optional IndexedCorpus indexedCorpus
		) throws IOException {
	
	FileDialog fileDialog = new FileDialog(shell, SWT.SAVE);
	fileDialog.setText("Exporting terminology "+ TerminologyPart.toPartLabel(terminology) +" to " + formatName);
	String path = fileDialog.open();
	if(path != null) {
		if(withOptionDialog) {
			Dialog dialog = getDialog(shell);
			if(dialog.open() == Dialog.OK) 
				export(shell, terminology, getExporter(dialog), indexedCorpus, path);
		} else
			// no option dialog
			export(shell, terminology, getExporter(), indexedCorpus, path);
	}
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:22,代码来源:ExportHandler.java

示例3: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
@Execute
public void execute(
		@Optional @Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
		@Optional TerminologyService terminologyService,
		@Optional ETerminoViewerConfig viewerConfig,
		@Optional MPart terminologyPart
		) {
	EList<String> viewerList = viewerConfig.getSelectedPropertyNames();
	List<Property<?>> selectedProperties = viewerList
			.stream()
			.map(s -> PropertyUtil.forName(s)).collect(Collectors.toList());
	
	SelectPropertyDialog dialog = new SelectPropertyDialog(shell, selectedProperties, p-> true, false);
	if(dialog.open() == Dialog.OK) {
		List<String> propertyNames = dialog.getSelectedPropertyNames();
		viewerList.retainAll(propertyNames);
		propertyNames.removeAll(viewerList);
		viewerList.addAll(propertyNames);
	}
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:21,代码来源:SelectTerminologyPropertiesHandler.java

示例4: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
@Execute
public void execute(ParameterizedCommand command, 
		@Optional @Named(IServiceConstants.ACTIVE_SELECTION) EPipeline selectedPipeline,
		@Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
		NLPService extractorService,
		ResourceService resourceService) {
	Map<String, Object> parameterMap = command.getParameterMap();
	boolean useCache = parameterMap.containsKey(TermSuiteUI.COMMAND_RUN_PIPELINE_PARAMETER_USE_CACHE)
			&& Boolean.parseBoolean((String) parameterMap.get(TermSuiteUI.COMMAND_RUN_PIPELINE_PARAMETER_USE_CACHE));
	if(!parameterMap.containsKey(TermSuiteUI.COMMAND_RUN_PIPELINE_PARAMETER_PIPELINE_ID)
			&& selectedPipeline != null) {
		// run handler from selected pipeline
		runPipeline(shell, extractorService, resourceService, selectedPipeline, useCache);
	} else {
		// run handler from parameterized command
		String pipelineName = parameterMap.get(TermSuiteUI.COMMAND_RUN_PIPELINE_PARAMETER_PIPELINE_ID).toString();
		java.util.Optional<EPipeline> pipeline = resourceService.getPipeline(pipelineName);
		if(pipeline.isPresent()) 
			runPipeline(shell, extractorService, resourceService, pipeline.get(), useCache);
	}
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:22,代码来源:RunPipelineHandler.java

示例5: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
@Execute
	public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell,  E4PreferenceRegistry prefReg, 
			@Optional @Named("preferencePageId") String pageId)
	{
		PreferenceManager pm = prefReg.getPreferenceManager();
		PreferenceDialog dialog = new PreferenceDialog(shell, pm);
		if (pageId != null)
		{
			dialog.setSelectedNode(pageId);
		}

		dialog.create();
		dialog.getTreeViewer().setComparator(new ViewerComparator());
//		dialog.getTreeViewer().expandAll();
		dialog.open();
		
	}
 
开发者ID:cplutte,项目名称:bts,代码行数:18,代码来源:E4PreferencesHandler.java

示例6: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
@Execute
public final Object execute(@Optional final ExecutionEvent event)
		throws ExecutionException {
	
	if ((action.getStyle() == IAction.AS_CHECK_BOX)
			|| (action.getStyle() == IAction.AS_RADIO_BUTTON)) {
		action.setChecked(!action.isChecked());
	}
	Object trigger = null;
	if (event != null)
	{
		trigger = event.getTrigger();
	}
	try {
		if (trigger != null && trigger instanceof Event) {
			action.runWithEvent((Event) trigger);
		} else {
			action.runWithEvent(new Event());
		}
	} catch (Exception e) {
		throw new ExecutionException(
				"While executing the action, an exception occurred", e); //$NON-NLS-1$
	}
	return null;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:26,代码来源:E4ActionHandler.java

示例7: run

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
/**
 * The <code>TextOperationAction</code> implementation of this <code>IAction</code> method runs the operation with
 * the current operation code.
 */
@Override
@Execute
public void run() {
	if (fOperationCode == -1 || fOperationTarget == null)
		return;

	ITextViewer viewer = getTextViewer();
	if (viewer == null)
		return;

	if (!fRunsOnReadOnly && !canModifyViewer())
		return;

	Display display = null;

	Shell shell = viewer.getTextWidget().getShell();
	if (shell != null && !shell.isDisposed())
		display = shell.getDisplay();

	BusyIndicator.showWhile(display, new Runnable() {
		public void run() {
			fOperationTarget.doOperation(fOperationCode);
		}
	});
}
 
开发者ID:cplutte,项目名称:bts,代码行数:30,代码来源:TextViewerOperationAction.java

示例8: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
@Execute
public void execute(@Preference(nodePath = "org.bbaw.bts.app") IEclipsePreferences prefs, IEclipseContext context,
		ApplicationStartupController startupController)
{
	//		PartHolderDialog dialog = ContextInjectionFactory.make(PartHolderDialog.class, context);
	//		//		context.set(UserManagementDialog.class, dialog);
	//
	//		if (dialog.open() == dialog.OK)
	//		{
	//		}

	Wizard w = new InstallationWizard(context, startupController, null, null);
	WizardDialog dialog = new WizardDialog(new Shell(), w);
	if (dialog.open() == dialog.OK)
	{
		System.out.println("new project created.");

	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:20,代码来源:TESTER.java

示例9: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
@Execute
public void execute(
		@Optional @Named(IServiceConstants.ACTIVE_SELECTION) Object selection,
		EditingDomainController editingDomainController) {
	System.out.println("delete");
	if (selection instanceof EObject) {
		EditingDomain ed = null; // editingDomainController.getEditingDomain((EObject)
									// selection);
		if (ed != null) {
			Command command = SetCommand.create(ed, selection,
					BtsmodelPackage.ADMINISTRATIV_DATA_OBJECT__STATE,
					BTSConstants.OBJECT_STATE_TERMINATED);
			ed.getCommandStack().execute(command);

		}
else {
			((AdministrativDataObject) selection)
					.setState(BTSConstants.OBJECT_STATE_TERMINATED);
		}
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:22,代码来源:DeleteHandler.java

示例10: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
		BTSConfigurationController configurationController, EventBroker eventBroker,
		IEclipseContext context)
{

	NewConfigurationDialog dialog = new NewConfigurationDialog(shell);
	ContextInjectionFactory.inject(
			dialog, context);
	if (dialog.open() == dialog.OK)
	{
		System.out.println("Realm.runWithDefault in NewConfigurationHandler");
		final BTSConfiguration config = dialog.getConfiguration();
		configurationController.save(config);
		eventBroker.post("model_new/asyncEvent", config);
	}

}
 
开发者ID:cplutte,项目名称:bts,代码行数:19,代码来源:NewConfigurationHandler.java

示例11: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
@Execute
public void execute(@Active MPart activePart, @Active Shell shell,
		IEclipseContext context, @Optional @Named("org.bbaw.bts.ui.main.commandparameter.viewerFilter") String viewerFilterString,
		@Optional @Named("org.bbaw.bts.ui.main.commandparameter.searchString") String searchString,
		@Optional @Named("org.bbaw.bts.ui.main.commandparameter.searchOptions") String searchOptions) {
	Object o = activePart.getObject();
	if (o instanceof SearchViewer) {
		SearchViewer searchViewer = (SearchViewer) o;
		SimpleSearchQueryDialog dialog = new SimpleSearchQueryDialog(shell);
		ContextInjectionFactory.inject(dialog, context);
		dialog.create();
		dialog.setSearchString(searchString);
		if (searchOptions != null) {
			dialog.setNameOnly(searchOptions.contains(SearchViewer.OPT_NAME_ONLY));
			dialog.setIdOnly(searchOptions.contains(SearchViewer.OPT_ID_ONLY));
		}
		dialog.setTitle("Object Search");
		if (dialog.open() == SimpleSearchQueryDialog.OK) {
			if (dialog.getQueryRequest() != null) {
				searchViewer.search(dialog.getQueryRequest(), null, viewerFilterString);
			}
		}
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:25,代码来源:OpenSearchQueryDialogHandler.java

示例12: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
@Optional
@Execute
public void execute(
		@Optional @Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
		IEclipseContext context,
		@Optional @Named("org.bbaw.bts.ui.main.commandparameter.dbManagerMessage") String message) {
	IEclipseContext child = context.createChild("DBManager");
	child.set("dbManagerMessage", message);
	if (shell == null)
	{
		child.set(Shell.class, new Shell());
	}
	else
	{
		child.set(Shell.class, shell);
	}
	DBManagerDialog dialog = ContextInjectionFactory.make(
			DBManagerDialog.class, child);
	// context.set(UserManagementDialog.class, dialog);

	if (dialog.open() == dialog.OK) {
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:24,代码来源:OpenDBManagerDialog.java

示例13: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
@Execute
public void execute(IEclipseContext context,
		@Optional @Named("userId") String userId, BTSUserController userController) {
	IEclipseContext child = context.createChild("changePassword");

	if (userId != null)
	{
		BTSUser user = userController.findUser(userId, null);
		child.set(BTSUser.class, user);
	}
	PasswordChangeDialog dialog = ContextInjectionFactory.make(PasswordChangeDialog.class, child);
	//		context.set(UserManagementDialog.class, dialog);

	if (dialog.open() == SWT.OK)
	{
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:18,代码来源:OpenChangePasswordDialogHandler.java

示例14: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_SELECTION) @Optional Object object,
		@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
		IEclipseContext context) {
	BTSCorpusObject corpusObject = null;
	if (object instanceof BTSCorpusObject)
	{
		corpusObject = (BTSCorpusObject) object;
	}
	else if (object instanceof BTSTextSelectionEvent && ((BTSTextSelectionEvent) object).data instanceof BTSCorpusObject)
	{
		corpusObject = (BTSCorpusObject) ((BTSTextSelectionEvent) object).data;
	}
	if (corpusObject == null) return;
	IEclipseContext child = context.createChild();
	child.set(BTSCorpusObject.class, corpusObject);
	child.set(Shell.class, shell);
	
	CheckPassportDialog dialog = ContextInjectionFactory.make(
			CheckPassportDialog.class, child);

	if (dialog.open() == CheckPassportDialog.OK) {
		
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:26,代码来源:CheckPassportCompletenessHandler.java

示例15: execute

import org.eclipse.e4.core.di.annotations.Execute; //导入依赖的package包/类
@Execute
public void execute(IEclipseContext context, @Named("objectId") String objectId, 
		CorpusNavigatorController corpusNavigatorController) {
	
	if (objectId != null)
	{
		BTSObject object = corpusNavigatorController.find(objectId, null);
		if (object == null) return;
		IEclipseContext child = context.createChild();
		child.set(BTSObject.class, object);
		child.set(Shell.class, new Shell());
		child.set(BTSCoreConstants.CORE_EXPRESSION_MAY_EDIT, false);

		PassportEditorDialog dialog = ContextInjectionFactory.make(
				PassportEditorDialog.class, child);
		if (dialog.open() == dialog.OK) {
			
		}
	}
	
}
 
开发者ID:cplutte,项目名称:bts,代码行数:22,代码来源:PassportOpenObjectMetadataHandler.java


注:本文中的org.eclipse.e4.core.di.annotations.Execute类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。