當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。