當前位置: 首頁>>代碼示例>>Java>>正文


Java ExecutionException類代碼示例

本文整理匯總了Java中org.eclipse.core.commands.ExecutionException的典型用法代碼示例。如果您正苦於以下問題:Java ExecutionException類的具體用法?Java ExecutionException怎麽用?Java ExecutionException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExecutionException類屬於org.eclipse.core.commands包,在下文中一共展示了ExecutionException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
  ISelection sel = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow()
      .getSelectionService().getSelection();
  if (sel instanceof ITreeSelection) {
    ITreeSelection treeSel = (ITreeSelection) sel;
    if (treeSel.getFirstElement() instanceof IFile) {
      IFile file = (IFile) treeSel.getFirstElement();
      List<IMarker> markers = MarkerFactory.findMarkers(file);
      MessageDialog dialog = new MessageDialog(MarkerActivator.getShell(), "Marker Count", null,
          markers.size() + " marker(s)", MessageDialog.INFORMATION, new String[] {"OK"}, 0);
      dialog.open();
    }
  }
  return null;
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:17,代碼來源:CountMarkersInFileHandler.java

示例2: execute

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	OpenDialogFactory.openDialog(new OpenDialogTemplate() {

		@Override
		public String getNature() {
			return "route";
		}

		@Override
		public Object[] getElements() {
			/* Charge les routes du cache du WsRouteManager. */
			return WsRouteManager.getInstance().getWorkspace().getWsRoutes().toArray();
		}
	});
	return null;
}
 
開發者ID:sebez,項目名稱:vertigo-chroma-kspplugin,代碼行數:18,代碼來源:OpenWsRouteHandler.java

示例3: execute

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	OpenDialogFactory.openDialog(new OpenDialogTemplate() {

		@Override
		public String getNature() {
			return "DAO/PAO method";
		}

		@Override
		public Object[] getElements() {
			/* Charge les DAO/PAO du cache du DaoManager. */
			return DaoManager.getInstance().getWorkspace().getDaoImplementations().toArray();
		}
	});
	return null;
}
 
開發者ID:sebez,項目名稱:vertigo-chroma-kspplugin,代碼行數:18,代碼來源:OpenDaoHandler.java

示例4: execute

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
  final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
  final ISourceProviderService service =
      activeWorkbenchWindow.getService(ISourceProviderService.class);
  final AnalysisSourceProvider sourceProvider =
      (AnalysisSourceProvider) service.getSourceProvider(AnalysisSourceProvider.ANALYSIS_STATE);
  sourceProvider.setActive(ReasoningType.DISCOVER_ATOM);

  final Thread thread = new Thread(new Runnable() {
    @Override
    public void run() {
      final AlloyDiscovering alloyDiscovering = new AlloyDiscovering();
      final boolean discovering =
          alloyDiscovering.discovering();
      if (!discovering) {
        Visualization.sourceProvider.setPassive();
      }
      Visualization.showViz();
    }
  });
  thread.start();
  return true;
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:25,代碼來源:VizDiscoverAtomsHandler.java

示例5: execute

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
  final MessageDialog warningdialog =
      new MessageDialog(MarkerActivator.getShell(), "Mark Information", null,
          "If new alloy file will be parsed , your all marker type will be lost !",
          MessageDialog.WARNING, new String[] {"OK", "Cancel"}, 0);
  if (warningdialog.open() != 0) {
    return null;
  }

  final String filePath = getFilePath();
  if (filePath == null) {
    return null;
  }
  AlloyParseUtil.parse(filePath);

  try {
    TraceManager.get().loadSpec(filePath);
  } catch (final TraceException e) {
    e.printStackTrace();
  }
  return null;
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:24,代碼來源:LoadSpecificationHandler.java

示例6: execute

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    //IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
    try {
        IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
        TreeViewCommander tvc = new TreeViewCommander();
        
        for (IProject project1 : allProjects) {
            String name = project1.getName();
            if (name.endsWith("-v1")) {
                String baseName = name.substring(0, name.length() - 3);
                IProject project0 = find(allProjects, baseName + "-v0");
                tvc.detectRefactorings(project0, project1);
            }
        }
    } catch (Exception e) {
        System.err.println(e.getMessage());
        e.printStackTrace(System.err);
    }
    return null;
}
 
開發者ID:aserg-ufmg,項目名稱:RefDiff,代碼行數:22,代碼來源:RunHandler.java

示例7: executeForSelectedLanguage

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
@Override
public Object executeForSelectedLanguage(ExecutionEvent event,
		IProject updatedGemocLanguageProject, Language language)
		throws ExecutionException {
	CreateDSAWizardContextActionDSAK3 action = new CreateDSAWizardContextActionDSAK3(
			updatedGemocLanguageProject);
	action.createNewDSAProject(MelangeXDSMLProjectHelper.getFirstEcore(language));
	
	if(action.getLastCreatedProject() != null){
		waitForAutoBuild();
		
		Set<String> aspects = SequentialSingleLanguageTemplate.getAspectClassesList(action.getLastCreatedProject());
		
		updateMelange(event,language,aspects);
	}
	
	return null;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:19,代碼來源:CreateDSAProjectHandler.java

示例8: executeForSelectedLanguage

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
@Override
public Object executeForSelectedLanguage(ExecutionEvent event,
		IProject updatedGemocLanguageProject, Language language)
		throws ExecutionException {
	CreateDomainModelWizardContextAction action = new CreateDomainModelWizardContextAction(
			updatedGemocLanguageProject); 
	action.actionToExecute = CreateDomainModelAction.CREATE_NEW_EMF_PROJECT;
	action.execute();
	
	if(action.getCreatedEcoreUri() != null){
		waitForAutoBuild();
		updateMelange(event,language,action.getCreatedEcoreUri());
	}
	
	return null;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:17,代碼來源:CreateDomainModelProjectHandler.java

示例9: execute

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	if (DebugHelper.INSTANCE.hasMoreWatchPoints()) {
		ELTGraphicalEditor editor = (ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
				.getActivePage().getActiveEditor();
		GraphicalViewer graphicalViewer = (GraphicalViewer) ((GraphicalEditor) editor)
				.getAdapter(GraphicalViewer.class);
		for (Iterator<EditPart> iterator = graphicalViewer.getEditPartRegistry().values().iterator(); iterator
				.hasNext();) {
			EditPart editPart = (EditPart) iterator.next();
			if (editPart instanceof ComponentEditPart) {
				Component comp = ((ComponentEditPart) editPart).getCastedModel();
				comp.clearWatchers();
			} else if (editPart instanceof PortEditPart) {
				((PortEditPart) editPart).getPortFigure().removeWatcherColor();
				((PortEditPart) editPart).getPortFigure().setWatched(false);
				((PortEditPart) editPart).getCastedModel().setWatched(false);
			}
		}
		showMessage(Messages.WATCH_POINT_REMOVED_SUCCESSFULLY);
	} else {
		showMessage(Messages.NO_WATCH_POINT_AVAILABLE);
	}
	return null;

}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:27,代碼來源:RemoveDebugHandler.java

示例10: execute

import org.eclipse.core.commands.ExecutionException; //導入依賴的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

示例11: execute

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
public Object execute ( final ExecutionEvent event ) throws ExecutionException
{
    for ( final Item item : getItems () )
    {
        GeneratorView view;
        try
        {
            view = (GeneratorView)getActivePage ().showView ( GeneratorView.VIEW_ID, asSecondardId ( item ), IWorkbenchPage.VIEW_ACTIVATE );
        }
        catch ( final PartInitException e )
        {
            throw new ExecutionException ( "Failed to open view", e );
        }
        view.setDataItem ( item );
    }

    return null;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:19,代碼來源:OpenSignalGenerator.java

示例12: execute

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
  final String alloyFilePath = MarkerPage.settings.get("alloyFile");
  try {
    TraceManager.get().loadSpec(alloyFilePath);
    final AlloyToEMF alloy2emf = new AlloyToEMF(alloyFilePath);
    alloy2emf.start();
    Display.getDefault().syncExec(new Runnable() {

      @Override
      public void run() {
        Visualization.showViz();
      }
    });
  } catch (final TraceException e) {
    final MessageDialog warningdialog = new MessageDialog(MarkerActivator.getShell(),
        "Alloy To EMF", null, e.getMessage(), MessageDialog.WARNING, new String[] {"OK"}, 0);
    if (warningdialog.open() != 0) {
      return null;
    }
  }
  return null;
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:24,代碼來源:AlloyToEMFHandler.java

示例13: execute

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
  if (AlloyUtilities.isExists()) {
    candidateToTypeChanging = new ArrayList<IMarker>();
    file = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()
        .getEditorInput().getAdapter(IFile.class);
    selection =
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
    editor =
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    selectedMarker = MarkUtilities.getLeaderOfMarker(getMarker());

    addRemoveType();
    if (Activator.getDefault().getWorkbench().getWorkbenchWindows()[0].getActivePage()
        .findView(Visualization.ID) != null) {
      Visualization.showViz();
    }
  } else {
    final MessageDialog infoDialog = new MessageDialog(MarkerActivator.getShell(),
        "System Information", null, "You dont have any registered alloy file to system.",
        MessageDialog.INFORMATION, new String[] {"Ok"}, 0);
    infoDialog.open();
  }
  return null;
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:26,代碼來源:AddRemoveTypeHandler.java

示例14: execute

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	OpenDialogFactory.openDialog(new OpenDialogTemplate() {

		@Override
		public String getNature() {
			return "service method";
		}

		@Override
		public Object[] getElements() {
			/* Charge les services du cache du ServiceManager. */
			return ServiceManager.getInstance().getWorkspace().getServiceImplementations().toArray();
		}
	});
	return null;
}
 
開發者ID:sebez,項目名稱:vertigo-chroma-kspplugin,代碼行數:18,代碼來源:OpenServiceHandler.java

示例15: execute

import org.eclipse.core.commands.ExecutionException; //導入依賴的package包/類
@SuppressWarnings ( "unchecked" )
@Override
public Object execute ( final ExecutionEvent event ) throws ExecutionException
{
    final String detailViewId = event.getParameter ( "org.eclipse.scada.vi.details.showDetailDialog.id" );
    final Map<String, String> parameters = (Map<String, String>)event.getObjectParameterForExecution ( "org.eclipse.scada.vi.details.showDetailDialog.parameters" );

    try
    {
        if ( this.useWaitShell )
        {
            openWithWaitShell ( getShell (), detailViewId, parameters );
        }
        else
        {
            open ( getShell (), detailViewId, parameters );
        }
    }
    catch ( final Exception e )
    {
        StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, "Failed to open detail view", e ), StatusManager.SHOW );
    }

    return null;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:26,代碼來源:ShowDetailDialog.java


注:本文中的org.eclipse.core.commands.ExecutionException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。