本文整理匯總了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();
}