本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}