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


Java HandlerUtil.getActiveWorkbenchWindowChecked方法代码示例

本文整理汇总了Java中org.eclipse.ui.handlers.HandlerUtil.getActiveWorkbenchWindowChecked方法的典型用法代码示例。如果您正苦于以下问题:Java HandlerUtil.getActiveWorkbenchWindowChecked方法的具体用法?Java HandlerUtil.getActiveWorkbenchWindowChecked怎么用?Java HandlerUtil.getActiveWorkbenchWindowChecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.handlers.HandlerUtil的用法示例。


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

示例1: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
	/*MessageDialog.openInformation(
			window.getShell(),
			"Plugin",
			"Hello, Eclipse world");*/
	
	// Pfad vom Projekt
    if (window != null)
    {
        IStructuredSelection selection = (IStructuredSelection) window.getSelectionService().getSelection();
        Object firstElement = selection.getFirstElement();
        if (firstElement instanceof IAdaptable)
        {
            IProject project = (IProject)((IAdaptable)firstElement).getAdapter(IProject.class);
            IPath path = project.getFullPath();
            System.out.println("Projekt: "+path);
            StartEGL.start(""+path);
        }
    }
	
	return null;
}
 
开发者ID:Nielko,项目名称:MBSE-Vacation-Manager,代码行数:25,代码来源:ExportHandler.java

示例2: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
@Override
public final Object execute ( final ExecutionEvent event ) throws ExecutionException
{
    final IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked ( event );

    final Object value = event.getParameter ( PARAMETER_NAME_VIEW_ID );

    try
    {
        final String[] viewIds = ( (String)value ).split ( ":" );
        if ( viewIds.length == 1 )
        {
            openView ( viewIds[0], null, window );
        }
        else if ( viewIds.length == 2 )
        {
            openView ( viewIds[0], viewIds[1], window );
        }
    }
    catch ( final PartInitException e )
    {
        throw new ExecutionException ( "Part could not be initialized", e ); //$NON-NLS-1$
    }

    return null;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:27,代码来源:ShowViewHandler.java

示例3: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
/**
 * the command has been executed, so extract extract the needed information
 * from the application context.
 */
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWorkbenchWindow window = HandlerUtil
			.getActiveWorkbenchWindowChecked(event);
	final Display display = Display.getDefault();
	final Shell shell = window.getShell();
	Locale.setDefault(Locale.ENGLISH);
	final TipDayEx tipDayEx = new TipDayEx();
	for (String tipMessage : new String[] { "This is the first tip",
			"This is the second tip", "This is the third tip",
			"This is the forth tip", "This is the fifth tip" }) {
		tipDayEx.addTip(String.format(
				"<h4>%s</h4>" + "<b>%s</b> " + "<u>%s</u> " + "<i>%s</i> " + "%s "
						+ "%s<br/>" + "<p color=\"#A00000\">%s</p>",
				tipMessage, tipMessage, tipMessage, tipMessage, tipMessage,
				tipMessage, tipMessage));

	}
	tipDayEx.open(shell, display);
	return null;
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:25,代码来源:SampleHandler.java

示例4: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
/**
 * the command has been executed, so extract extract the needed information
 * from the application context.
 */
public Object execute(ExecutionEvent event) throws ExecutionException {
	final IWorkbenchWindow window = HandlerUtil
			.getActiveWorkbenchWindowChecked(event);
	GemocPackageDiscovery.openModelingDiscoveryWizard(window);
	return null;
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:11,代码来源:GemocDiscoveryHandler.java

示例5: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
	TargetHandlerDialog targetHandler = new TargetHandlerDialog(window.getShell());
	targetHandler.open();
	return null;
}
 
开发者ID:VisuFlow,项目名称:visuflow-plugin,代码行数:9,代码来源:LinkTargetProject.java

示例6: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	// get workbench window
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
	File inputFile = null;

	try {
		// set structured selection
		IStructuredSelection selection = (IStructuredSelection) window.getSelectionService().getSelection();

		// check if it is an IFile
		if (selection.getFirstElement() instanceof IFile) {
			File file = FileUtils.getFile((IFile) selection.getFirstElement());
			String ext = FileUtils.getExtension(file);
			if (ext.equals(TurnusExtensions.OPTIMAL_BUFFER_REPORT)) {
				inputFile = file;
			} else {
				inputFile = null;
			}
		}
	} catch (Exception e) {
		inputFile = null;
	}

	OptimalBufferSizeExporterWizard wizard = new OptimalBufferSizeExporterWizard();
	if (inputFile != null) {
		wizard.configure(inputFile);
	}
	
	return new WizardDialog(window.getShell(), wizard).open();
}
 
开发者ID:turnus,项目名称:turnus,代码行数:32,代码来源:OptimalBufferSizeExporterHandler.java

示例7: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
	DebugUITools.openLaunchConfigurationDialogOnGroup(window.getShell(), new StructuredSelection(),
			IDebugUIConstants.ID_RUN_LAUNCH_GROUP, null);
	return null;
}
 
开发者ID:dice-project,项目名称:DICE-Platform,代码行数:8,代码来源:ConfigureToolsHandler.java

示例8: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
/**
 * the command has been executed, so extract extract the needed information
 * from the application context.
 */
public Object execute(ExecutionEvent event) throws ExecutionException {
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
	MessageDialog.openInformation(
			window.getShell(),
			"Ytypesystem",
			"Hello, Eclipse world");
	return null;
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:13,代码来源:SampleHandler.java

示例9: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	// TODO Auto-generated method stub
	// get workbench window
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);

	// create a new wizard and open it
	Wizard wizard = new CaseOptimalScheduleGenerationWizard();
	return new WizardDialog(window.getShell(), wizard).open();
}
 
开发者ID:turnus,项目名称:turnus,代码行数:11,代码来源:CaseOptimalScheduleGenerationHandler.java

示例10: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	// get workbench window
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);

	// create a new wizard and open it
	MarkovModelSchedulerWizard wizard = new MarkovModelSchedulerWizard();
	return new WizardDialog(window.getShell(), wizard).open();
}
 
开发者ID:turnus,项目名称:turnus,代码行数:10,代码来源:MarkovModelSchedulerHandler.java

示例11: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	// get workbench window
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);

	// create a new wizard and open it
	TabuSearchPartitioningWizard wizard = new TabuSearchPartitioningWizard();
	return new WizardDialog(window.getShell(), wizard).open();
}
 
开发者ID:turnus,项目名称:turnus,代码行数:10,代码来源:TabuSearchPartitioningHandler.java

示例12: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	// get workbench window
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);

	// create a new wizard and open it
	CommunicationCostPartitioningWizard wizard = new CommunicationCostPartitioningWizard();
	return new WizardDialog(window.getShell(), wizard).open();
}
 
开发者ID:turnus,项目名称:turnus,代码行数:10,代码来源:CommunicationCostPartitioningHandler.java

示例13: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	// get workbench window
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);

	// create a new wizard and open it
	Wizard wizard = new BoundedBufferAnalysisWizard();
	return new WizardDialog(window.getShell(), wizard).open();
}
 
开发者ID:turnus,项目名称:turnus,代码行数:10,代码来源:BoundedBufferAnalysisHandler.java

示例14: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	// get workbench window
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);

	// create a new wizard and open it
	WorkloadBalancePartitioningWizard wizard = new WorkloadBalancePartitioningWizard();
	return new WizardDialog(window.getShell(), wizard).open();
}
 
开发者ID:turnus,项目名称:turnus,代码行数:10,代码来源:WorkloadBalancePartitioningHandler.java

示例15: execute

import org.eclipse.ui.handlers.HandlerUtil; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	// get workbench window
	IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);

	// create a new wizard and open it
	Wizard wizard = new PipeliningAlgorithmicImpactAnalysisWizard();
	return new WizardDialog(window.getShell(), wizard).open();
}
 
开发者ID:turnus,项目名称:turnus,代码行数:10,代码来源:PipeliningAlgorithmicImpactAnalysisHandler.java


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