@Override public Object execute(ExecutionEvent event) { IWorkbenchPart part = HandlerUtil.getActiveEditor(event); if (part instanceof SQLEditor){ SQLEditor sqlEditor = (SQLEditor) part; if (sqlEditor.getCurrentDb() != null) { sqlEditor.updateDdl(); } else { MessageBox mb = new MessageBox(HandlerUtil.getActiveShell(event), SWT.ICON_INFORMATION); mb.setText(Messages.UpdateDdl_select_source); mb.setMessage(Messages.UpdateDdl_select_source_msg); mb.open(); } } return null; }
public void partActivated(IWorkbenchPart p) { if (p instanceof ContentOutline) { if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { getActionBarContributor().setActiveEditor(GrmEditor.this); setCurrentViewer(contentOutlineViewer); } } else if (p instanceof PropertySheet) { if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { getActionBarContributor().setActiveEditor(GrmEditor.this); handleActivate(); } } else if (p == GrmEditor.this) { handleActivate(); } }
public void partActivated(IWorkbenchPart p) { if (p instanceof ContentOutline) { if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { getActionBarContributor().setActiveEditor(TracingannotationsEditor.this); setCurrentViewer(contentOutlineViewer); } } else if (p instanceof PropertySheet) { if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { getActionBarContributor().setActiveEditor(TracingannotationsEditor.this); handleActivate(); } } else if (p == TracingannotationsEditor.this) { handleActivate(); } }
/** * Recursive function for setting up children controls for a control if it is * a composite and setting up the main control's manager. * @param part * @param control */ private void setupControls(IWorkbenchPart part, Control control) { //If composite, setup children controls. if (control instanceof Composite) { Composite composite = (Composite) control; Control[] children = composite.getChildren(); if (children.length > 0 && children[0] != null) { for (Control curControl : children) setupControls(part, curControl); } } if (control instanceof StyledText) { //set up styled text manager if there is one setupStyledText((IEditorPart) part, (StyledText) control); } else if (control instanceof Browser) { //set up browser manager if there is one setupBrowser((Browser) control); } //TODO: no control set up for a ProjectExplorer, since there isn't an need for //a Manager right now, might be needed in the future }
@Override public void partActivated ( final IWorkbenchPart p ) { if ( p instanceof ContentOutline ) { if ( ( (ContentOutline)p ).getCurrentPage () == ChartEditor.this.contentOutlinePage ) { getActionBarContributor ().setActiveEditor ( ChartEditor.this ); setCurrentViewer ( ChartEditor.this.contentOutlineViewer ); } } else if ( p instanceof PropertySheet ) { if ( ChartEditor.this.propertySheetPages.contains ( ( (PropertySheet)p ) .getCurrentPage () ) ) { getActionBarContributor ().setActiveEditor ( ChartEditor.this ); handleActivate (); } } else if ( p == ChartEditor.this ) { handleActivate (); } }
public void partActivated(IWorkbenchPart p) { if (p instanceof ContentOutline) { if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { getActionBarContributor().setActiveEditor(SrmEditor.this); setCurrentViewer(contentOutlineViewer); } } else if (p instanceof PropertySheet) { if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { getActionBarContributor().setActiveEditor(SrmEditor.this); handleActivate(); } } else if (p == SrmEditor.this) { handleActivate(); } }
public void partActivated ( IWorkbenchPart p ) { if ( p instanceof ContentOutline ) { if ( ( (ContentOutline)p ).getCurrentPage () == contentOutlinePage ) { getActionBarContributor ().setActiveEditor ( DeploymentEditor.this ); setCurrentViewer ( contentOutlineViewer ); } } else if ( p instanceof PropertySheet ) { if ( propertySheetPages.contains ( ( (PropertySheet)p ).getCurrentPage () ) ) { getActionBarContributor ().setActiveEditor ( DeploymentEditor.this ); handleActivate (); } } else if ( p == DeploymentEditor.this ) { handleActivate (); } }
public void partActivated ( IWorkbenchPart p ) { if ( p instanceof ContentOutline ) { if ( ( (ContentOutline)p ).getCurrentPage () == contentOutlinePage ) { getActionBarContributor ().setActiveEditor ( ProfileEditor.this ); setCurrentViewer ( contentOutlineViewer ); } } else if ( p instanceof PropertySheet ) { if ( propertySheetPages.contains ( ( (PropertySheet)p ).getCurrentPage () ) ) { getActionBarContributor ().setActiveEditor ( ProfileEditor.this ); handleActivate (); } } else if ( p == ProfileEditor.this ) { handleActivate (); } }
public void partActivated ( IWorkbenchPart p ) { if ( p instanceof ContentOutline ) { if ( ( (ContentOutline)p ).getCurrentPage () == contentOutlinePage ) { getActionBarContributor ().setActiveEditor ( ItemEditor.this ); setCurrentViewer ( contentOutlineViewer ); } } else if ( p instanceof PropertySheet ) { if ( propertySheetPages.contains ( ( (PropertySheet)p ).getCurrentPage () ) ) { getActionBarContributor ().setActiveEditor ( ItemEditor.this ); handleActivate (); } } else if ( p == ItemEditor.this ) { handleActivate (); } }
public void partActivated(IWorkbenchPart p) { if (p instanceof ContentOutline) { if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { getActionBarContributor().setActiveEditor(GqamEditor.this); setCurrentViewer(contentOutlineViewer); } } else if (p instanceof PropertySheet) { if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { getActionBarContributor().setActiveEditor(GqamEditor.this); handleActivate(); } } else if (p == GqamEditor.this) { handleActivate(); } }
protected void createActions() { super.createActions(); ActionRegistry registry = getActionRegistry(); IAction action = new DirectEditAction((IWorkbenchPart) this); registry.registerAction(action); getSelectionActions().add(action.getId()); action = new CopyNodeAction(this); registry.registerAction(action); getSelectionActions().add(action.getId()); action = new PasteNodeAction(this); registry.registerAction(action); getSelectionActions().add(action.getId()); action = new ClearEdgeBendpointLayoutAction(this); registry.registerAction(action); getSelectionActions().add(action.getId()); }
public void partActivated(IWorkbenchPart p) { if (p instanceof ContentOutline) { if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { getActionBarContributor().setActiveEditor(HrmEditor.this); setCurrentViewer(contentOutlineViewer); } } else if (p instanceof PropertySheet) { if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { getActionBarContributor().setActiveEditor(HrmEditor.this); handleActivate(); } } else if (p == HrmEditor.this) { handleActivate(); } }
public void partActivated(IWorkbenchPart p) { if (p instanceof ContentOutline) { if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { getActionBarContributor().setActiveEditor(LibraryEditor.this); setCurrentViewer(contentOutlineViewer); } } else if (p instanceof PropertySheet) { if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { getActionBarContributor().setActiveEditor(LibraryEditor.this); handleActivate(); } } else if (p == LibraryEditor.this) { handleActivate(); } }
public void partActivated(IWorkbenchPart p) { if (p instanceof ContentOutline) { if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { getActionBarContributor().setActiveEditor(NfpEditor.this); setCurrentViewer(contentOutlineViewer); } } else if (p instanceof PropertySheet) { if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { getActionBarContributor().setActiveEditor(NfpEditor.this); handleActivate(); } } else if (p == NfpEditor.this) { handleActivate(); } }
public void partActivated ( IWorkbenchPart p ) { if ( p instanceof ContentOutline ) { if ( ( (ContentOutline)p ).getCurrentPage () == contentOutlinePage ) { getActionBarContributor ().setActiveEditor ( GlobalizeEditor.this ); setCurrentViewer ( contentOutlineViewer ); } } else if ( p instanceof PropertySheet ) { if ( propertySheetPages.contains ( ( (PropertySheet)p ).getCurrentPage () ) ) { getActionBarContributor ().setActiveEditor ( GlobalizeEditor.this ); handleActivate (); } } else if ( p == GlobalizeEditor.this ) { handleActivate (); } }
@Override public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { if ("gluonMobileFound".equals(property)) { try { IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (activeWorkbenchWindow == null) { return false; } IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); if (activePage == null) { return false; } IWorkbenchPart activePart = activePage.getActivePart(); if (activePart == null || ! (activePart instanceof CompilationUnitEditor)) { return false; } IEditorPart editor = activePage.getActiveEditor(); if (editor == null) { return false; } IEditorInput input = editor.getEditorInput(); if (input == null || ! (input instanceof FileEditorInput)) { return false; } IFile file = ((FileEditorInput) input).getFile(); if (file != null && file.getType() == IResource.FILE && file.getFileExtension().equals("java")) { ProjectUtils utils = new ProjectUtils(file.getProject()); return utils.isGluonMobileProject(); } } catch (Exception e) { } } return false; }
@Override public Object execute(ExecutionEvent event) { IWorkbenchPart part = HandlerUtil.getActiveEditor(event); if (part instanceof ProjectEditorDiffer){ ProjectEditorDiffer differ = (ProjectEditorDiffer) part; differ.diff(); } return null; }
@Override public LayoutMapping buildLayoutGraph(IWorkbenchPart workbenchPart, Object diagramPart) { StateGraphViewPart layoutRootPart = null; if (!(workbenchPart instanceof StateGraphViewPart)) { return null; } layoutRootPart = (StateGraphViewPart) workbenchPart; final StateGraph stateGraph = layoutRootPart.getStateGraph(); LayoutMapping mapping = new LayoutMapping(workbenchPart); mapping.setParentElement(layoutRootPart); KNode topNode = ElkUtil.createInitializedNode(); mapping.getGraphMap().put(topNode, layoutRootPart); mapping.setLayoutGraph(topNode); final Set<StateVertex> movedVertice = layoutRootPart.getMovedVertice(); final List<StateVertex> vertice = new ArrayList<>(stateGraph.getVertice()); vertice.removeAll(movedVertice); for (StateVertex vertex : vertice) { KNode node = createNode(mapping, vertex, topNode); mapping.getGraphMap().put(node, vertex); } List<DirectedGraph.Edge<StateVertex>> edges = stateGraph.getEdges().stream() .filter(e -> !movedVertice.contains(e.getSource()) && !movedVertice.contains(e.getTarget())) .collect(Collectors.toList()); for (DirectedGraph.Edge<StateVertex> edge : edges) { KEdge kEdge = createEdge(mapping, edge); mapping.getGraphMap().put(kEdge, edge); } return mapping; }
@Override public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchPart part = HandlerUtil.getActivePart(event); if(part instanceof ELTGraphicalEditor){ copy.execute(event); cut.execute(event); } return null; }
private IWorkbenchPart getActivePart() { IWorkbenchWindow activeWindow = getWorkbench().getActiveWorkbenchWindow(); if( activeWindow != null ) { IWorkbenchPage activePage = activeWindow.getActivePage(); if( activePage != null ) { return activePage.getActivePart(); } } return null; }
protected void attachSelectionService () { getViewSite ().getWorkbenchWindow ().getSelectionService ().addPostSelectionListener ( new ISelectionListener () { @Override public void selectionChanged ( final IWorkbenchPart part, final ISelection selection ) { handleSelectionChanged ( selection ); } } ); handleSelectionChanged ( getViewSite ().getWorkbenchWindow ().getSelectionService ().getSelection () ); }
protected void addSelectionListener () { if ( this.selectionListener == null ) { getViewSite ().getWorkbenchWindow ().getSelectionService ().addSelectionListener ( this.selectionListener = new ISelectionListener () { public void selectionChanged ( final IWorkbenchPart part, final ISelection selection ) { AbstractQueryViewPart.this.setSelection ( selection ); } } ); } }
public void setInput(IWorkbenchPart part, ISelection selection) { super.setInput(part, selection); Object input = ((IStructuredSelection) selection).getFirstElement(); this.node = (SectionProvider) input; GWNode model = this.node.getModel(); Map<String, Object> p = model.getProperties(); this.properties = ModelProperties.filterCustomProperty(p); listViewer.setInput(this.properties.entrySet()); }
protected void addSelectionListener () { if ( this.selectionListener == null ) { getViewSite ().getWorkbenchWindow ().getSelectionService ().addSelectionListener ( this.selectionListener = new ISelectionListener () { @Override public void selectionChanged ( final IWorkbenchPart part, final ISelection selection ) { AbstractAlarmsEventsView.this.setSelection ( selection ); } } ); } }
@Override public Object execute ( final ExecutionEvent handlerEvent ) throws ExecutionException { final IWorkbenchPart part = getActivePage ().getActivePart (); if ( ! ( part instanceof MonitorSubscriptionAlarmsEventsView ) ) { return null; } final MonitorSubscriptionAlarmsEventsView view = (MonitorSubscriptionAlarmsEventsView)part; final Iterator<?> i = getSelection ().iterator (); while ( i.hasNext () ) { final AckInformation ackInformation = AdapterHelper.adapt ( i.next (), AckInformation.class ); if ( ackInformation == null ) { continue; } final MonitorStatus status = ackInformation.getMonitorStatus (); switch ( status ) { case NOT_AKN: case NOT_OK_NOT_AKN: view.acknowledgeMonitor ( ackInformation.getMonitorId (), ackInformation.getTimestamp (), new DisplayCallbackHandler ( getShell (), "Acknowledge", "Confirmation required" ) ); break; default: break; } } return null; }
/** * Add a listener to the global selection service and set the currently selected query */ protected void addListener () { if ( this.selectionListener == null ) { getViewSite ().getWorkbenchWindow ().getSelectionService ().addSelectionListener ( this.selectionListener = new ISelectionListener () { @Override public void selectionChanged ( final IWorkbenchPart part, final ISelection selection ) { QueryViewPart.this.setSelection ( selection ); } } ); } }
@Override public void resourceChanged(IResourceChangeEvent event) { IResource file = ResourceUtil.getResource(getEditorInput()); IResourceDelta delta = event.getDelta(); if (delta != null && file != null) { IResourceDelta child = delta.findMember(file.getFullPath()); if (child != null && (child.getFlags() & IResourceDelta.MARKERS) != 0) { UiSync.exec(parentComposite, () -> { if (!parentComposite.isDisposed()) { firePropertyChange(IWorkbenchPart.PROP_TITLE); } }); } } }
public void run() { Display display = Display.getDefault(); Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT); Shell shell = getParentShell(); shell.setCursor(waitCursor); try { ProjectExplorerView explorerView = getProjectExplorerView(); if (explorerView != null) { TreeObject treeObject = explorerView.getFirstSelectedTreeObject(); Object databaseObject = treeObject.getObject(); if ((databaseObject != null) && (databaseObject instanceof RequestableStep)) { RequestableStep requestableStep = (RequestableStep)databaseObject; requestableStep.exportVariableDefinition(); Sequence sequence = requestableStep.getSequence(); if (sequence.hasChanged) { SequenceTreeObject sequenceTreeObject = (SequenceTreeObject) explorerView.findTreeObjectByUserObject(sequence); explorerView.reloadTreeObject(sequenceTreeObject); explorerView.setSelectedTreeObject(sequenceTreeObject); StructuredSelection structuredSelection = new StructuredSelection(sequenceTreeObject); ConvertigoPlugin.getDefault().getPropertiesView().selectionChanged((IWorkbenchPart)explorerView, structuredSelection); } } } } catch (Throwable e) { ConvertigoPlugin.logException(e, "Unable to export step variables to main sequence!"); } finally { shell.setCursor(null); waitCursor.dispose(); } }
@Override public void selectionChanged(IWorkbenchPart part, ISelection selection) { if (selection instanceof IStructuredSelection) { Object ob = ((IStructuredSelection)selection).getFirstElement(); if (ob instanceof ValidateResults) { ValidateResults validationResults = (ValidateResults)ob; update(validationResults); } } }
public void setInput(IWorkbenchPart part, ISelection selection) { super.setInput(part, selection); Object input = ((IStructuredSelection) selection).getFirstElement(); this.node = (SectionProvider) input; AbstractGW4EEditPartProperties properties = (AbstractGW4EEditPartProperties) node.getAdapter(IPropertySource.class); viewer.getControl().setEnabled(properties.isUpdatable(ModelProperties.PROPERTY_VERTEX_INIT)); }
protected void activate(IWorkbenchPart part) { editor.getSite().getPage().activate(part); }
public void partDeactivated(IWorkbenchPart p) { // Ignore. }
public WatchRecordAction(IWorkbenchPart part) { super(part); setLazyEnablementCalculation(true); }
public void partClosed(IWorkbenchPart p) { // Ignore. }
public void partBroughtToTop(IWorkbenchPart p) { // Ignore. }
public void partOpened(IWorkbenchPart p) { // Ignore. }