@Override public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI .getTooltipAffordanceString(); if (BrowserInformationControl.isAvailable(parent)) { String font = "org.eclipse.jdt.ui.javadocfont"; BrowserInformationControl iControl = new BrowserInformationControl( parent, font, false) { @Override public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; addLinkListener(iControl); return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
@Override public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = "Press F2 for focus"; if (BrowserInformationControl.isAvailable(parent)) { String font = JFaceResources.DIALOG_FONT; BrowserInformationControl iControl = new BrowserInformationControl( parent, font, tooltipAffordanceString) { /* * @see org.eclipse.jface.text.IInformationControlExtension5# * getInformationPresenterControlCreator() */ @Override public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; addLinkListener(iControl); return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
/** * Install everything necessary to get document folding working and enable * document folding * * @param sourceViewer */ private void installProjectionSupport() { ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer(); fProjectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors()); fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); //$NON-NLS-1$ fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); //$NON-NLS-1$ fProjectionSupport.setHoverControlCreator(new IInformationControlCreator() { public IInformationControl createInformationControl(Shell parent) { return new DefaultInformationControl(parent); } }); fProjectionSupport.install(); if (isFoldingEnabled()) { projectionViewer.doOperation(ProjectionViewer.TOGGLE); } }
@Override public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = ""; //"Press 'F2' for focus";//EditorsUI.getTooltipAffordanceString(); if (BrowserInformationControl.isAvailable(parent)) { String font = "org.eclipse.jdt.ui.javadocfont"; // FIXME: PreferenceConstants.APPEARANCE_JAVADOC_FONT; IXtextBrowserInformationControl iControl = new XtextBrowserInformationControl(parent, font, tooltipAffordanceString) { /* * @see org.eclipse.jface.text.IInformationControlExtension5#getInformationPresenterControlCreator() */ @Override public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; addLinkListener(iControl); return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
@Override public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { ContentAssistant assistant = new ContentAssistant(); assistant.setDocumentPartitioning(this.getConfiguredDocumentPartitioning(sourceViewer)); CompletionProposalToggler toggler = new CompletionProposalToggler(); assistant.setContentAssistProcessor(toggler, IDocument.DEFAULT_CONTENT_TYPE); assistant.setContentAssistProcessor(toggler, EditorConstants.PARTITION_TYPE_BRAINFUCK_CODE); assistant.addCompletionListener(toggler); assistant.setStatusLineVisible(true); assistant.setRepeatedInvocationMode(true); assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE); assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY); assistant.setAutoActivationDelay(500); assistant.enableAutoActivation(false); assistant.setInformationControlCreator(new AbstractReusableInformationControlCreator() { @Override protected IInformationControl doCreateInformationControl(Shell parent) { return new DefaultInformationControl(parent); } }); assistant.setContentAssistProcessor(null, EditorConstants.PARTITION_TYPE_MULTILINE_COMMENT); return assistant; }
@Override public IInformationControl doCreateInformationControl(final Shell parent) { final String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (BrowserInformationControl.isAvailable(parent)) { final String font = "org.eclipse.jdt.ui.javadocfont"; // FIXME: // PreferenceConstants.APPEARANCE_JAVADOC_FONT; final IXtextBrowserInformationControl iControl = new GamlInformationControl(parent, font, tooltipAffordanceString) { }; addLinkListener(iControl); return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
@Override public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = "Press F2 for focus"; if (BrowserInformationControl.isAvailable(parent)) { String font = JFaceResources.DIALOG_FONT; BrowserInformationControl iControl = new BrowserInformationControl( parent, font, tooltipAffordanceString) { /* * @see org.eclipse.jface.text.IInformationControlExtension5# * getInformationPresenterControlCreator() */ @Override public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; // addLinkListener(iControl); return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public IInformationControl doCreateInformationControl(Shell parent) { if (BrowserInformationControl.isAvailable(parent)) { ToolBarManager tbm = new ToolBarManager(SWT.FLAT); CustomBrowserInformationControl iControl = new CustomBrowserInformationControl(parent, null, tbm); iControl.setBackgroundColor(documentationHover.getBackgroundColor()); iControl.setForegroundColor(documentationHover.getForegroundColor()); documentationHover.populateToolbarActions(tbm, iControl); tbm.update(true); documentationHover.installLinkListener(iControl); return iControl; } else { return new DefaultInformationControl(parent, true); } }
public IInformationControl doCreateInformationControl(Shell parent) { if (CustomBrowserInformationControl.isAvailable(parent)) { CustomBrowserInformationControl iControl = new CustomBrowserInformationControl(parent, null, EditorsUI.getTooltipAffordanceString()) { public IInformationControlCreator getInformationPresenterControlCreator() { return informationPresenterControlCreator; } }; iControl.setBackgroundColor(getBackgroundColor()); iControl.setForegroundColor(getForegroundColor()); return iControl; } else { // return new ThemedInformationControl(parent, null, EditorsUI.getTooltipAffordanceString()); return new DefaultInformationControl(parent, true); } }
@Override public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString= fAdditionalInfoAffordance ? JavaPlugin.getAdditionalInfoAffordanceString() : EditorsUI.getTooltipAffordanceString(); if (BrowserInformationControl.isAvailable(parent)) { String font= PreferenceConstants.APPEARANCE_JAVADOC_FONT; BrowserInformationControl iControl= new BrowserInformationControl(parent, font, tooltipAffordanceString) { /* * @see org.eclipse.jface.text.IInformationControlExtension5#getInformationPresenterControlCreator() */ @Override public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; addLinkListener(iControl); return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { // Create content assistant ContentAssistant assistant = new ContentAssistant(); // required to display additional info assistant.setInformationControlCreator(new IInformationControlCreator() { public IInformationControl createInformationControl(Shell parent) { return new DefaultInformationControl(parent, true); } }); processor.setFile(file); // Set this processor for each supported content type assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_TAG); assistant.setContentAssistProcessor(processor, XMLPartitionScanner.XML_DEFAULT); assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE); // Return the content assistant return assistant; }
@Override public void createPartControl(Composite parent) { super.createPartControl(parent); try { ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer(); fProjectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors()); fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); fProjectionSupport.setHoverControlCreator(new IInformationControlCreator() { @Override public IInformationControl createInformationControl(Shell shell) { return new DefaultInformationControl(shell); } }); fProjectionSupport.install(); if (isFoldingEnabled()) { projectionViewer.doOperation(ProjectionViewer.TOGGLE); } } catch (Exception e) { Log.log(e); } }
@Override public IInformationControl createInformationControl(Shell parent) { if (ReducedBrowserInformationControl.isAvailableFor(parent)) { ReducedBrowserInformationControl control = new ReducedBrowserInformationControl(parent); return control; } else { return new DefaultInformationControl(parent, true); } }
@Override public IInformationControlCreator getHoverControlCreator() { return new IInformationControlCreator() { @Override public IInformationControl createInformationControl(Shell parent) { return new DefaultInformationControl(parent, EditorsUI.getTooltipAffordanceString()); } }; }
@Override public IInformationControl doCreateInformationControl(Shell shell) { if (SimpleBrowserInformationControl.isAvailableFor(shell)){ SimpleBrowserInformationControl control = new SimpleBrowserInformationControl(shell,20); if (lazyBuilder!=null){ control.setBrowserEGradleLinkListener(new DefaultEGradleLinkListener(lazyBuilder.getFgColor(), lazyBuilder.getBgColor(), lazyBuilder.getCommentColor(), lazyBuilder.getBuilder())); } return control; } return new DefaultInformationControl(shell, true); }
@Override public IInformationControl createInformationControl(Shell parent) { if (SimpleBrowserInformationControl.isAvailableFor(parent)) { SimpleBrowserInformationControl control = new SimpleBrowserInformationControl(parent); control.setBrowserEGradleLinkListener( new DefaultEGradleLinkListener(fgColor, bgColor, commentColorWeb, builder)); return control; } else { return new DefaultInformationControl(parent, true); } }
public IInformationControl doCreateInformationControl(Shell parent) { if (de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl.isAvailable(parent)) { ToolBarManager tbm = new ToolBarManager(SWT.FLAT); de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl iControl = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl(parent, FONT, tbm); final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl); tbm.add(openDeclarationAction); final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider(); IInputChangedListener inputChangeListener = new IInputChangedListener() { public void inputChanged(Object newInput) { if (newInput == null) { selectionProvider.setSelection(new StructuredSelection()); } else if (newInput instanceof de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput) { de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput input = (de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput) newInput; Object inputElement = input.getInputElement(); selectionProvider.setSelection(new StructuredSelection(inputElement)); // If there is an element of type EObject in the input element, the button to open // the declaration will be set enable boolean isEObjectInput = inputElement instanceof EObject; openDeclarationAction.setEnabled(isEObjectInput); if (isEObjectInput) { String simpleName = inputElement.getClass().getSimpleName(); simpleName = simpleName.substring(0, simpleName.length() - 4); openDeclarationAction.setText("Open " + simpleName); } else openDeclarationAction.setText("Open Declaration"); } } }; iControl.addInputChangeListener(inputChangeListener); tbm.update(true); return iControl; } else { return new DefaultInformationControl(parent, true); } }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl.isAvailable(parent)) { de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl iControl = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public DwprofileQuickAssistAssistant(de.darwinspl.preferences.resource.dwprofile.IDwprofileResourceProvider resourceProvider, de.darwinspl.preferences.resource.dwprofile.ui.IDwprofileAnnotationModelProvider annotationModelProvider) { setQuickAssistProcessor(new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileQuickAssistProcessor(resourceProvider, annotationModelProvider)); setInformationControlCreator(new AbstractReusableInformationControlCreator() { public IInformationControl doCreateInformationControl(Shell parent) { return new DefaultInformationControl(parent, (IInformationPresenter) null); } }); }
public IInformationControl doCreateInformationControl(Shell parent) { if (eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl.isAvailable(parent)) { ToolBarManager tbm = new ToolBarManager(SWT.FLAT); eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl iControl = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl(parent, FONT, tbm); final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl); tbm.add(openDeclarationAction); final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider(); IInputChangedListener inputChangeListener = new IInputChangedListener() { public void inputChanged(Object newInput) { if (newInput == null) { selectionProvider.setSelection(new StructuredSelection()); } else if (newInput instanceof eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput) { eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput input = (eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput) newInput; Object inputElement = input.getInputElement(); selectionProvider.setSelection(new StructuredSelection(inputElement)); // If there is an element of type EObject in the input element, the button to open // the declaration will be set enable boolean isEObjectInput = inputElement instanceof EObject; openDeclarationAction.setEnabled(isEObjectInput); if (isEObjectInput) { String simpleName = inputElement.getClass().getSimpleName(); simpleName = simpleName.substring(0, simpleName.length() - 4); openDeclarationAction.setText("Open " + simpleName); } else openDeclarationAction.setText("Open Declaration"); } } }; iControl.addInputChangeListener(inputChangeListener); tbm.update(true); return iControl; } else { return new DefaultInformationControl(parent, true); } }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl.isAvailable(parent)) { eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl iControl = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public HyexpressionQuickAssistAssistant(eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionResourceProvider resourceProvider, eu.hyvar.feature.expression.resource.hyexpression.ui.IHyexpressionAnnotationModelProvider annotationModelProvider) { setQuickAssistProcessor(new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionQuickAssistProcessor(resourceProvider, annotationModelProvider)); setInformationControlCreator(new AbstractReusableInformationControlCreator() { public IInformationControl doCreateInformationControl(Shell parent) { return new DefaultInformationControl(parent, (IInformationPresenter) null); } }); }
public HyvalidityformulaQuickAssistAssistant(eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaResourceProvider resourceProvider, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.IHyvalidityformulaAnnotationModelProvider annotationModelProvider) { setQuickAssistProcessor(new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaQuickAssistProcessor(resourceProvider, annotationModelProvider)); setInformationControlCreator(new AbstractReusableInformationControlCreator() { public IInformationControl doCreateInformationControl(Shell parent) { return new DefaultInformationControl(parent, (IInformationPresenter) null); } }); }
public IInformationControl doCreateInformationControl(Shell parent) { if (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl.isAvailable(parent)) { ToolBarManager tbm = new ToolBarManager(SWT.FLAT); eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl iControl = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl(parent, FONT, tbm); final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl); tbm.add(openDeclarationAction); final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider(); IInputChangedListener inputChangeListener = new IInputChangedListener() { public void inputChanged(Object newInput) { if (newInput == null) { selectionProvider.setSelection(new StructuredSelection()); } else if (newInput instanceof eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput) { eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput input = (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput) newInput; Object inputElement = input.getInputElement(); selectionProvider.setSelection(new StructuredSelection(inputElement)); // If there is an element of type EObject in the input element, the button to open // the declaration will be set enable boolean isEObjectInput = inputElement instanceof EObject; openDeclarationAction.setEnabled(isEObjectInput); if (isEObjectInput) { String simpleName = inputElement.getClass().getSimpleName(); simpleName = simpleName.substring(0, simpleName.length() - 4); openDeclarationAction.setText("Open " + simpleName); } else openDeclarationAction.setText("Open Declaration"); } } }; iControl.addInputChangeListener(inputChangeListener); tbm.update(true); return iControl; } else { return new DefaultInformationControl(parent, true); } }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl.isAvailable(parent)) { eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl iControl = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public HydatavalueQuickAssistAssistant(eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueResourceProvider resourceProvider, eu.hyvar.dataValues.resource.hydatavalue.ui.IHydatavalueAnnotationModelProvider annotationModelProvider) { setQuickAssistProcessor(new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueQuickAssistProcessor(resourceProvider, annotationModelProvider)); setInformationControlCreator(new AbstractReusableInformationControlCreator() { public IInformationControl doCreateInformationControl(Shell parent) { return new DefaultInformationControl(parent, (IInformationPresenter) null); } }); }
public IInformationControl doCreateInformationControl(Shell parent) { if (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl.isAvailable(parent)) { ToolBarManager tbm = new ToolBarManager(SWT.FLAT); eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl iControl = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl(parent, FONT, tbm); final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl); tbm.add(openDeclarationAction); final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider(); IInputChangedListener inputChangeListener = new IInputChangedListener() { public void inputChanged(Object newInput) { if (newInput == null) { selectionProvider.setSelection(new StructuredSelection()); } else if (newInput instanceof eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput) { eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput input = (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput) newInput; Object inputElement = input.getInputElement(); selectionProvider.setSelection(new StructuredSelection(inputElement)); // If there is an element of type EObject in the input element, the button to open // the declaration will be set enable boolean isEObjectInput = inputElement instanceof EObject; openDeclarationAction.setEnabled(isEObjectInput); if (isEObjectInput) { String simpleName = inputElement.getClass().getSimpleName(); simpleName = simpleName.substring(0, simpleName.length() - 4); openDeclarationAction.setText("Open " + simpleName); } else openDeclarationAction.setText("Open Declaration"); } } }; iControl.addInputChangeListener(inputChangeListener); tbm.update(true); return iControl; } else { return new DefaultInformationControl(parent, true); } }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl.isAvailable(parent)) { eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl iControl = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public HymappingQuickAssistAssistant(eu.hyvar.feature.mapping.resource.hymapping.IHymappingResourceProvider resourceProvider, eu.hyvar.feature.mapping.resource.hymapping.ui.IHymappingAnnotationModelProvider annotationModelProvider) { setQuickAssistProcessor(new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingQuickAssistProcessor(resourceProvider, annotationModelProvider)); setInformationControlCreator(new AbstractReusableInformationControlCreator() { public IInformationControl doCreateInformationControl(Shell parent) { return new DefaultInformationControl(parent, (IInformationPresenter) null); } }); }
public IInformationControl doCreateInformationControl(Shell parent) { if (eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl.isAvailable(parent)) { ToolBarManager tbm = new ToolBarManager(SWT.FLAT); eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl iControl = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl(parent, FONT, tbm); final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl); tbm.add(openDeclarationAction); final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider(); IInputChangedListener inputChangeListener = new IInputChangedListener() { public void inputChanged(Object newInput) { if (newInput == null) { selectionProvider.setSelection(new StructuredSelection()); } else if (newInput instanceof eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput) { eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput input = (eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput) newInput; Object inputElement = input.getInputElement(); selectionProvider.setSelection(new StructuredSelection(inputElement)); // If there is an element of type EObject in the input element, the button to open // the declaration will be set enable boolean isEObjectInput = inputElement instanceof EObject; openDeclarationAction.setEnabled(isEObjectInput); if (isEObjectInput) { String simpleName = inputElement.getClass().getSimpleName(); simpleName = simpleName.substring(0, simpleName.length() - 4); openDeclarationAction.setText("Open " + simpleName); } else openDeclarationAction.setText("Open Declaration"); } } }; iControl.addInputChangeListener(inputChangeListener); tbm.update(true); return iControl; } else { return new DefaultInformationControl(parent, true); } }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl.isAvailable(parent)) { eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl iControl = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public IInformationControl doCreateInformationControl(Shell parent) { if (eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl.isAvailable(parent)) { ToolBarManager tbm = new ToolBarManager(SWT.FLAT); eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl iControl = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl(parent, FONT, tbm); final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl); tbm.add(openDeclarationAction); final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider(); IInputChangedListener inputChangeListener = new IInputChangedListener() { public void inputChanged(Object newInput) { if (newInput == null) { selectionProvider.setSelection(new StructuredSelection()); } else if (newInput instanceof eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsDocBrowserInformationControlInput) { eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsDocBrowserInformationControlInput input = (eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsDocBrowserInformationControlInput) newInput; Object inputElement = input.getInputElement(); selectionProvider.setSelection(new StructuredSelection(inputElement)); // If there is an element of type EObject in the input element, the button to open // the declaration will be set enable boolean isEObjectInput = inputElement instanceof EObject; openDeclarationAction.setEnabled(isEObjectInput); if (isEObjectInput) { String simpleName = inputElement.getClass().getSimpleName(); simpleName = simpleName.substring(0, simpleName.length() - 4); openDeclarationAction.setText("Open " + simpleName); } else openDeclarationAction.setText("Open Declaration"); } } }; iControl.addInputChangeListener(inputChangeListener); tbm.update(true); return iControl; } else { return new DefaultInformationControl(parent, true); } }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl.isAvailable(parent)) { eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl iControl = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public HyconstraintsQuickAssistAssistant(eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsResourceProvider resourceProvider, eu.hyvar.feature.constraint.resource.hyconstraints.ui.IHyconstraintsAnnotationModelProvider annotationModelProvider) { setQuickAssistProcessor(new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsQuickAssistProcessor(resourceProvider, annotationModelProvider)); setInformationControlCreator(new AbstractReusableInformationControlCreator() { public IInformationControl doCreateInformationControl(Shell parent) { return new DefaultInformationControl(parent, (IInformationPresenter) null); } }); }
public IInformationControl doCreateInformationControl(Shell parent) { if (eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl.isAvailable(parent)) { ToolBarManager tbm = new ToolBarManager(SWT.FLAT); eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl iControl = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl(parent, FONT, tbm); final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl); tbm.add(openDeclarationAction); final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider(); IInputChangedListener inputChangeListener = new IInputChangedListener() { public void inputChanged(Object newInput) { if (newInput == null) { selectionProvider.setSelection(new StructuredSelection()); } else if (newInput instanceof eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestDocBrowserInformationControlInput) { eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestDocBrowserInformationControlInput input = (eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestDocBrowserInformationControlInput) newInput; Object inputElement = input.getInputElement(); selectionProvider.setSelection(new StructuredSelection(inputElement)); // If there is an element of type EObject in the input element, the button to open // the declaration will be set enable boolean isEObjectInput = inputElement instanceof EObject; openDeclarationAction.setEnabled(isEObjectInput); if (isEObjectInput) { String simpleName = inputElement.getClass().getSimpleName(); simpleName = simpleName.substring(0, simpleName.length() - 4); openDeclarationAction.setText("Open " + simpleName); } else openDeclarationAction.setText("Open Declaration"); } } }; iControl.addInputChangeListener(inputChangeListener); tbm.update(true); return iControl; } else { return new DefaultInformationControl(parent, true); } }
public IInformationControl doCreateInformationControl(Shell parent) { String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString(); if (eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl.isAvailable(parent)) { eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl iControl = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl(parent, FONT, tooltipAffordanceString) { public IInformationControlCreator getInformationPresenterControlCreator() { return fInformationPresenterControlCreator; } }; return iControl; } else { return new DefaultInformationControl(parent, tooltipAffordanceString); } }
public HymanifestQuickAssistAssistant(eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestResourceProvider resourceProvider, eu.hyvar.mspl.manifest.resource.hymanifest.ui.IHymanifestAnnotationModelProvider annotationModelProvider) { setQuickAssistProcessor(new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestQuickAssistProcessor(resourceProvider, annotationModelProvider)); setInformationControlCreator(new AbstractReusableInformationControlCreator() { public IInformationControl doCreateInformationControl(Shell parent) { return new DefaultInformationControl(parent, (IInformationPresenter) null); } }); }