public void createPartControl(Composite parent) { super.createPartControl(parent); // Code Folding ProjectionViewer viewer = (ProjectionViewer) getSourceViewer(); // Occurrence initiation, need ITextResource and ISourceViewer. highlighting = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileHighlighting(getResource(), viewer, colorManager, this); projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors()); projectionSupport.install(); // turn projection mode on viewer.doOperation(ProjectionViewer.TOGGLE); codeFoldingManager = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileCodeFoldingManager(viewer, this); IContextService contextService = (IContextService) getSite().getService(IContextService.class); contextService.activateContext("de.darwinspl.preferences.resource.dwprofile.EditorScope"); }
public void createPartControl(Composite parent) { super.createPartControl(parent); // Code Folding ProjectionViewer viewer = (ProjectionViewer) getSourceViewer(); // Occurrence initiation, need ITextResource and ISourceViewer. highlighting = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionHighlighting(getResource(), viewer, colorManager, this); projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors()); projectionSupport.install(); // turn projection mode on viewer.doOperation(ProjectionViewer.TOGGLE); codeFoldingManager = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionCodeFoldingManager(viewer, this); IContextService contextService = (IContextService) getSite().getService(IContextService.class); contextService.activateContext("eu.hyvar.feature.expression.resource.hyexpression.EditorScope"); }
public void createPartControl(Composite parent) { super.createPartControl(parent); // Code Folding ProjectionViewer viewer = (ProjectionViewer) getSourceViewer(); // Occurrence initiation, need ITextResource and ISourceViewer. highlighting = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaHighlighting(getResource(), viewer, colorManager, this); projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors()); projectionSupport.install(); // turn projection mode on viewer.doOperation(ProjectionViewer.TOGGLE); codeFoldingManager = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaCodeFoldingManager(viewer, this); IContextService contextService = (IContextService) getSite().getService(IContextService.class); contextService.activateContext("eu.hyvar.context.contextValidity.resource.hyvalidityformula.EditorScope"); }
public void createPartControl(Composite parent) { super.createPartControl(parent); // Code Folding ProjectionViewer viewer = (ProjectionViewer) getSourceViewer(); // Occurrence initiation, need ITextResource and ISourceViewer. highlighting = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueHighlighting(getResource(), viewer, colorManager, this); projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors()); projectionSupport.install(); // turn projection mode on viewer.doOperation(ProjectionViewer.TOGGLE); codeFoldingManager = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueCodeFoldingManager(viewer, this); IContextService contextService = (IContextService) getSite().getService(IContextService.class); contextService.activateContext("eu.hyvar.dataValues.resource.hydatavalue.EditorScope"); }
public void createPartControl(Composite parent) { super.createPartControl(parent); // Code Folding ProjectionViewer viewer = (ProjectionViewer) getSourceViewer(); // Occurrence initiation, need ITextResource and ISourceViewer. highlighting = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingHighlighting(getResource(), viewer, colorManager, this); projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors()); projectionSupport.install(); // turn projection mode on viewer.doOperation(ProjectionViewer.TOGGLE); codeFoldingManager = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingCodeFoldingManager(viewer, this); IContextService contextService = (IContextService) getSite().getService(IContextService.class); contextService.activateContext("eu.hyvar.feature.mapping.resource.hymapping.EditorScope"); }
public void createPartControl(Composite parent) { super.createPartControl(parent); // Code Folding ProjectionViewer viewer = (ProjectionViewer) getSourceViewer(); // Occurrence initiation, need ITextResource and ISourceViewer. highlighting = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsHighlighting(getResource(), viewer, colorManager, this); projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors()); projectionSupport.install(); // turn projection mode on viewer.doOperation(ProjectionViewer.TOGGLE); codeFoldingManager = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsCodeFoldingManager(viewer, this); IContextService contextService = (IContextService) getSite().getService(IContextService.class); contextService.activateContext("eu.hyvar.feature.constraint.resource.hyconstraints.EditorScope"); }
public void createPartControl(Composite parent) { super.createPartControl(parent); // Code Folding ProjectionViewer viewer = (ProjectionViewer) getSourceViewer(); // Occurrence initiation, need ITextResource and ISourceViewer. highlighting = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestHighlighting(getResource(), viewer, colorManager, this); projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors()); projectionSupport.install(); // turn projection mode on viewer.doOperation(ProjectionViewer.TOGGLE); codeFoldingManager = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestCodeFoldingManager(viewer, this); IContextService contextService = (IContextService) getSite().getService(IContextService.class); contextService.activateContext("eu.hyvar.mspl.manifest.resource.hymanifest.EditorScope"); }
private void handleStateChange() { boolean isActive = false; for (IPyContextObserver obs : this.observers.getListeners()) { if (obs.isPyContextActive()) { isActive = true; break; } } IContextService contextService = (IContextService) PlatformUI.getWorkbench().getService(IContextService.class); //May be null on shutdown on Eclipse 4. if (contextService != null) { if (isActive) { if (activateContext == null) { activateContext = contextService.activateContext("com.python.pydev.contexts.window"); } } else { if (activateContext != null) { contextService.deactivateContext(activateContext); } activateContext = null; } } }
@Override protected void createControls(Composite composite) { super.createControls(composite); ICompareContainer container = getCompareConfiguration().getContainer(); IWorkbenchPart workbenchPart= container.getWorkbenchPart(); if (workbenchPart != null) { IContextService service= workbenchPart.getSite().getService(IContextService.class); if (service != null) { service.activateContext(EditorSettings_Actual.EDITOR_CONTEXT_ID); } } // TODO: activate Lang editor commands // IHandlerService handlerSvc = container.getServiceLocator().getService(IHandlerService.class); // handlerSvc.activateHandler(EditorCommandIds.OpenDef_ID, new OpenDefinitionHandler2()); }
/** * Activate a context that this view uses. It will be tied to this view activation events and will be removed when * the view is disposed. * */ private void activateContext() { IContextService contextService = getSite().getService(IContextService.class); // this will get cleaned up automatically when the site // is disposed contextService.activateContext(VIEW_CONTEXT_ID); }
private void initN4Context() { if (isWorkbenchRunning()) { final IWorkbench workbench = getWorkbench(); workbench.getDisplay().asyncExec(() -> { final IContextService service = workbench.getService(IContextService.class); service.activateContext(N4_CONTEXT_ID); }); } }
@Override public void createPartControl(Composite parent) { parentComposite = parent; super.createPartControl(parent); setLineBackground(); getSite().getService(IContextService.class).activateContext(CONTEXT.EDITOR); }
@Override public void createPartControl(Composite parent) { contextService = (IContextService) PlatformUI.getWorkbench().getService(IContextService.class); createWidgets(parent); debugEventListener = new DebugListener(); DebugPlugin.getDefault().addDebugEventListener(debugEventListener); breakpointListener = new PandionJBreakpointListener(); JDIDebugModel.addJavaBreakpointListener(breakpointListener); // populateToolBar(); addErrorReporting(); }
@Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { setSite(site); setInput(input); setTitleImage(input.getImageDescriptor().createImage()); setPartName(input.getName()); // initialize the context bindings for this editor. Useful for shortcuts IContextService service = (IContextService) site.getService(IContextService.class); service.activateContext(CONTEXT_ID); // get the input avroSchema = getAvroSchema(); // load the configurations IEditorConfiguration editorConfiguration = loadEditorConfiguration(); SchemaViewerConfiguration schemaViewerConfiguration = loadSchemaViewerConfiguration(); AttributesConfiguration attributesConfiguration = loadAttributesConfiguration(); // create and configure the main component editor = new AvroSchemaEditor(input.getName(), getContextId(), this); editor.setEditorConfiguration(editorConfiguration); editor.setSchemaViewerConfiguration(schemaViewerConfiguration); editor.setAttributesConfiguration(attributesConfiguration); editor.setInput(avroSchema); editor.addDirtyListener(this); }
@Override protected void createControls(Composite composite) { super.createControls(composite); IWorkbenchPart workbenchPart = getCompareConfiguration().getContainer().getWorkbenchPart(); if (workbenchPart != null) { IContextService service = workbenchPart.getSite().getService(IContextService.class); if (service != null) { service.activateContext("ts.eclipse.ide.jsdt.ui.typeScriptEditorScope"); //$NON-NLS-1$ } } }
public void focusGained(FocusEvent e) { ConfigurationManager.getInstance(getProject()).clearProjectClassLoader(); IContextService contextService = (IContextService)PlatformUI.getWorkbench() .getService(IContextService.class); contextService.activateContext("com.hudson.velocityweb.velocityContext"); }
@Override protected void setSite(IWorkbenchPartSite newSite) { newSite.setSelectionProvider(new EnsembleSelectionProvider(this.toString())); super.setSite(newSite); IContextService contextService = (IContextService)newSite.getService(IContextService.class); contextService.activateContext("timeline"); }
@Override protected void createControls(Composite composite) { super.createControls(composite); IWorkbenchPart workbenchPart = getCompareConfiguration().getContainer().getWorkbenchPart(); if (workbenchPart != null) { IContextService service = (IContextService)workbenchPart.getSite().getService(IContextService.class); if (service != null) { service.activateContext("org.eclipse.jdt.ui.javaEditorScope"); //$NON-NLS-1$ } } }
@Override public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) { if (perspective.getId().equals(Constants.FORCE_PLUGIN_PERSPECTIVE)) { page.getWorkbenchWindow().getService(IContextService.class).getActiveContextIds(); activateForceContext(); } else { deactivateForceContext(); } }
public void activateForceContext() { IWorkbench workbench = PlatformUI.getWorkbench(); IContextService service = workbench.getService(IContextService.class); if (!service.getActiveContextIds().contains(Constants.FORCE_PLUGIN_CONTEXT_ID)) { forceContext = service.activateContext(Constants.FORCE_PLUGIN_CONTEXT_ID); } }
public void deactivateForceContext() { IWorkbench workbench = PlatformUI.getWorkbench(); IContextService service = workbench.getService(IContextService.class); if (service.getActiveContextIds().contains(Constants.FORCE_PLUGIN_CONTEXT_ID)) { service.deactivateContext(forceContext); forceContext = null; } }
/** * Passing the focus request to the viewer's control. */ @Override public void setFocus() { viewer.getControl().setFocus(); IContextService contextService = PlatformUI.getWorkbench().getService(IContextService.class); contextService.activateContext("net.resheim.eclipse.timekeeper.ui.workweek"); }
@Override public void init(@Nullable IEditorSite site, @Nullable IEditorInput input) throws PartInitException { super.init(site, input); IContextService cs = (IContextService)getSite().getService(IContextService.class); cs.activateContext(EDITOR_SCOPE); }
/** * Sets the site and input for this editor then creates and initializes the actions. * @see org.eclipse.ui.IEditorPart#init(IEditorSite, IEditorInput) */ @Override public void init(IEditorSite site, IEditorInput input) { setSite(site); setInput(input); getCommandStack().addCommandStackListener(this); ((IContextService)site.getService(IContextService.class)).activateContext(EDITING_INSTALLOPTIONS_DESIGN_CONTEXT_ID); initializeActionRegistry(); }
public void earlyStartup() { final IWorkbench workbench = PlatformUI.getWorkbench(); workbench.getDisplay().asyncExec(new Runnable() { @Override public void run() { IContextService contextService = (IContextService) workbench.getService(IContextService.class); if(contextService != null){ contextService.activateContext("net.heartsome.cat.te.context"); } } }); }
private void activateDesignerEditPart( ) { IContextService contextService = (IContextService) PlatformUI.getWorkbench( ) .getService( IContextService.class ); if ( contextActivation == null ) contextActivation = contextService.activateContext( VIEW_CONTEXT_ID ); }
private void deActivateDesignerEditPart( ) { if ( !UIUtil.isReportEditorActivated( ) ) { IContextService contextService = (IContextService) PlatformUI.getWorkbench( ) .getService( IContextService.class ); if ( contextActivation != null ) { contextService.deactivateContext( contextActivation ); contextActivation = null; } } }
/** * Registers the shell as the same type as its parent with the context * support. This ensures that it does not modify the current state of the * application. */ private final void registerShellType() { final Shell shell = getShell(); final IContextService contextService = (IContextService) editor.getEditorSite().getWorkbenchWindow().getWorkbench().getService(IContextService.class); contextService.registerShell(shell, contextService.getShellType((Shell) shell.getParent())); }
/** * @see org.eclipse.ui.console.IConsolePageParticipant#deactivated() */ public void deactivated() { if (fContextActivation != null){ IContextService contextService = (IContextService) PlatformUI.getWorkbench().getAdapter(IContextService.class); contextService.deactivateContext(fContextActivation); fContextActivation = null; ((EmacsPlusConsole)console).offLine(); } }
public void getContexts(ITextEditor editor) { IContextService contextService = (IContextService) editor.getSite().getService(IContextService.class); @SuppressWarnings("unchecked") // Eclipse documents the collection type Collection<String> col = contextService.getActiveContextIds(); Iterator<String> it = col.iterator(); while (it.hasNext()) { System.out.println("context: " + it.next()); //$NON-NLS-1$ } }
private void clearContext() { if (this.repeatc != null) { ((IContextService)PlatformUI.getWorkbench().getService(IContextService.class)).deactivateContext(repeatc); this.repeatc = null; } }
/** * Registers the shell as the same type as its parent with the context * support. This ensures that it does not modify the current state of the * application. */ private final void registerShellType() { final Shell shell = getShell(); final IContextService contextService = (IContextService) EditorUtils.getActiveWorkbenchWindow().getService( IContextService.class); contextService.registerShell(shell, contextService.getShellType((Shell) shell.getParent())); }
@Override public void start(final BundleContext context) throws Exception { super.start(context); UMLDiagramEditorPlugin.getInstance().setElementInitializers(new ElementInitializers()); // TODO: remove this in Luna final IContextService contextService = (IContextService) PlatformUI.getWorkbench().getService( IContextService.class); contextService.activateContext(NIEM_UML_PAPYRUS_EDITORS_CONTEXT); }
private void activateBatchEditorContext() { IContextService contextService = getSite().getService(IContextService.class); if (contextService != null) { contextService.activateContext(EDITOR_CONTEXT_MENU_ID); } }
private void activateBashEditorContext() { IContextService contextService = getSite().getService(IContextService.class); if (contextService != null) { contextService.activateContext(EDITOR_CONTEXT_MENU_ID); } }
private void activateEditorContext() { IContextService contextService = getSite().getService(IContextService.class); if (contextService != null) { contextService.activateContext(getEditorInstanceContextId()); } }
/** * Allows to create the viewer and initialise it. */ @Override public void createPartControl(Composite parent) { preferences = InstanceScope.INSTANCE.getNode(Notepad4e.PLUGIN_ID); // Listen to any change to the preferences of the plugin. preferences.addPreferenceChangeListener(this); clipboard = new Clipboard(Display.getCurrent()); tabFolder = new CTabFolder(parent, SWT.MULTI | SWT.WRAP); addPluginDisposeListener(); addCloseTabListener(); addSwapTabListener(); addRenameTabListener(); addTabSelectionListener(); restoreViewFromPreviousSession(); Job autosaveJob = new Job("ScheduledAutosave") { @Override protected IStatus run(IProgressMonitor monitor) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { savePluginState(); } }); schedule(SAVE_INTERVAL_MILLIS); return Status.OK_STATUS; } }; autosaveJob.schedule(SAVE_INTERVAL_MILLIS); PlatformUI.getWorkbench().getHelpSystem().setHelp(tabFolder, "Notepad4e.viewer"); IContextService contextService = getSite().getService(IContextService.class); contextService.activateContext("notepad4e.context"); IHandlerService handlerService = getSite().getService(IHandlerService.class); // Associate each shortcut command with the shortcut handler. for (NotepadAction notepadAction : NotepadAction.values()) { if (notepadAction.getCommandID() != null) { handlerService.activateHandler(notepadAction.getCommandID(), shortcutHandler); } } makeActions(); contributeToActionBars(); }
protected void createPage0() { Composite composite = new Composite(getContainer(), SWT.NONE); final Layout layout = new FillLayout(); composite.setLayout(layout); keyViewer = new TreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); keyViewer.setContentProvider(new EntryTreeCP()); keyViewer.setLabelProvider( wrapLabelProvider(new EntryTreeLP())); keyViewer.setComparator(new ViewerComparator()); try { keyViewer.setInput(getEditorInput()); } catch(VersionError e) { keyViewer.setInput(null); final Shell shell = getSite().getShell(); final String title = "Version Error"; final S msg = new S(); msg.addf("This HSSD editor supports resource version up to '%s', ", e.supportedVersion()); msg.addf("but the resource reports version '%s'.%n%n", e.actualVersion()); msg.addf("You probably need to upgrade your HSSD editor!"); MessageDialog.openError(shell, title, msg.toString()); } // Create the help context id for the keyViewer's control // PlatformUI.getWorkbench().getHelpSystem().setHelp(keyViewer.getControl(), "com.insweat.hssd.editor.viewer"); hookContextMenu(); makeActions(); hookDoubleClickAction(); hookDragAndDrop(); // contributeToActionBars(); int index = addPage(composite); setPageText(index, "EntryTree"); getSite().setSelectionProvider(keyViewer); keyViewer.getTree().addSelectionListener(new EditorSelectionSP( this, keyViewer, HSSDEditorSourceProvider.VAR_HSSD_SELECTION)); IContextService svc = (IContextService)getSite().getService(IContextService.class); svc.activateContext("com.insweat.hssd.editor.contexts.inHSSDEditor"); }
@Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { super.init(site, input); IContextService contextService = (IContextService) site.getService(IContextService.class); contextService.activateContext(CONTEXT); }