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