类org.eclipse.jface.text.DefaultInformationControl源码实例Demo

下面列出了怎么用org.eclipse.jface.text.DefaultInformationControl的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: eclipse-cs   文件: FileMatchPatternEditDialog.java
/**
 * Creates the content assistant.
 * 
 * @return the content assistant
 */
private SubjectControlContentAssistant createContentAssistant() {

  final SubjectControlContentAssistant contentAssistant = new SubjectControlContentAssistant();

  contentAssistant
          .setRestoreCompletionProposalSize(CheckstyleUIPlugin.getDefault().getDialogSettings());

  IContentAssistProcessor processor = new RegExContentAssistProcessor(true);
  contentAssistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
  contentAssistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
  contentAssistant.setInformationControlCreator(new IInformationControlCreator() {
    /*
     * @see org.eclipse.jface.text.IInformationControlCreator#
     * createInformationControl( org.eclipse.swt.widgets.Shell)
     */
    @Override
    public IInformationControl createInformationControl(Shell parent) {
      return new DefaultInformationControl(parent);
    }
  });

  return contentAssistant;
}
 
源代码2 项目: eclipse-cs   文件: CheckstyleMarkerFilterDialog.java
/**
 * Creates the content assistant.
 *
 * @return the content assistant
 */
private SubjectControlContentAssistant createContentAssistant() {

  final SubjectControlContentAssistant contentAssistant = new SubjectControlContentAssistant();

  contentAssistant.setRestoreCompletionProposalSize(
          CheckstyleUIPlugin.getDefault().getDialogSettings());

  IContentAssistProcessor processor = new RegExContentAssistProcessor(true);
  contentAssistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
  contentAssistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
  contentAssistant.setInformationControlCreator(new IInformationControlCreator() {
    /*
     * @see org.eclipse.jface.text.IInformationControlCreator# createInformationControl(
     * org.eclipse.swt.widgets.Shell)
     */
    @Override
    public IInformationControl createInformationControl(Shell parent) {
      return new DefaultInformationControl(parent);
    }
  });

  return contentAssistant;
}
 
源代码3 项目: eclipse-cs   文件: ResolvablePropertyEditDialog.java
/**
 * Creates the content assistant.
 *
 * @return the content assistant
 */
private SubjectControlContentAssistant createContentAssistant() {

  final SubjectControlContentAssistant contentAssistant = new SubjectControlContentAssistant();

  contentAssistant
          .setRestoreCompletionProposalSize(CheckstyleUIPlugin.getDefault().getDialogSettings());

  IContentAssistProcessor processor = new PropertiesContentAssistProcessor();
  contentAssistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
  contentAssistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
  contentAssistant.setInformationControlCreator(new IInformationControlCreator() {
    /*
     * @see IInformationControlCreator#createInformationControl(Shell)
     */
    @Override
    public IInformationControl createInformationControl(Shell parent) {
      return new DefaultInformationControl(parent);
    }
  });

  return contentAssistant;
}
 
源代码4 项目: eclipse-cs   文件: ConfigPropertyWidgetFile.java
/**
 * Creates the content assistant.
 * 
 * @return the content assistant
 */
private SubjectControlContentAssistant createContentAssistant() {

  final SubjectControlContentAssistant contentAssistant = new SubjectControlContentAssistant();

  contentAssistant
          .setRestoreCompletionProposalSize(CheckstyleUIPlugin.getDefault().getDialogSettings());

  IContentAssistProcessor processor = new PropertiesContentAssistProcessor();
  contentAssistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
  contentAssistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
  contentAssistant.setInformationControlCreator(new IInformationControlCreator() {
    /*
     * @see IInformationControlCreator#createInformationControl(Shell)
     */
    @Override
    public IInformationControl createInformationControl(Shell parent) {
      return new DefaultInformationControl(parent);
    }
  });

  return contentAssistant;
}
 
源代码5 项目: eclipse-cs   文件: ConfigPropertyWidgetRegex.java
/**
 * Creates the content assistant.
 * 
 * @return the content assistant
 */
private SubjectControlContentAssistant createContentAssistant() {

  final SubjectControlContentAssistant contentAssistant = new SubjectControlContentAssistant();

  contentAssistant
          .setRestoreCompletionProposalSize(CheckstyleUIPlugin.getDefault().getDialogSettings());

  IContentAssistProcessor processor = new RegExContentAssistProcessor(true);
  contentAssistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
  contentAssistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
  contentAssistant.setInformationControlCreator(new IInformationControlCreator() {
    /*
     * @see IInformationControlCreator#createInformationControl(Shell)
     */
    @Override
    public IInformationControl createInformationControl(Shell parent) {
      return new DefaultInformationControl(parent);
    }
  });

  return contentAssistant;
}
 
源代码6 项目: solidity-ide   文件: CustomCSSHelpHoverProvider.java
@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 = 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);
	}
}
 
源代码8 项目: xtext-eclipse   文件: XbaseHoverProvider.java
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
	if (BrowserInformationControl.isAvailable(parent)) {
		String font = "org.eclipse.jdt.ui.javadocfont";
		IXtextBrowserInformationControl iControl = new XbaseInformationControl(parent, font,
				tooltipAffordanceString, xbaseHoverConfiguration) {
			@Override
			public IInformationControlCreator getInformationPresenterControlCreator() {
				return fInformationPresenterControlCreator;
			}
		};
		addLinkListener(iControl);
		return iControl;
	} else {
		return new DefaultInformationControl(parent, tooltipAffordanceString);
	}
}
 
源代码9 项目: tlaplus   文件: TLASourceViewerConfiguration.java
/**
   * Content assistant
   */
  public IContentAssistant getContentAssistant(ISourceViewer sourceViewer)
  {
      ContentAssistant assistant = new ContentAssistant();
      assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
      assistant.setContentAssistProcessor(new TLACompletionProcessor(), IDocument.DEFAULT_CONTENT_TYPE);
      assistant.setContentAssistProcessor(new PCalCompletionProcessor(), TLAPartitionScanner.TLA_PCAL);
      assistant.enableColoredLabels(true);
      assistant.enableAutoActivation(true);
      assistant.setAutoActivationDelay(500);
assistant.setInformationControlCreator(new IInformationControlCreator() {
	public IInformationControl createInformationControl(final Shell parent) {
		return new DefaultInformationControl(parent, (DefaultInformationControl.IInformationPresenter) null);
	}
});
assistant.setSorter(new ICompletionProposalSorter() {
	public int compare(ICompletionProposal p1, ICompletionProposal p2) {
		return 0;
	}
});
      assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
      assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
      assistant.setContextInformationPopupBackground(TLAEditorActivator.getDefault().getTLAColorProvider().getColor(
              TLAColorProvider.CONTENT_ASSIST_BACKGROUND_KEY));
      return assistant;
  }
 
源代码10 项目: typescript.java   文件: HoverControlCreator.java
@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);
	}
}
 
源代码12 项目: statecharts   文件: HelpHoverProvider.java
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
	if (BrowserInformationControl.isAvailable(parent)) {
		String font = "org.eclipse.jdt.ui.javadocfont";

		boolean areHoverDocsScrollable = true;

		// resizable flag of BrowserInformationControl causes the scrollbar to be always
		// enabled.
		BrowserInformationControl iControl = new BrowserInformationControl(parent, font,
				areHoverDocsScrollable) {
			@Override
			public IInformationControlCreator getInformationPresenterControlCreator() {
				return fInformationPresenterControlCreator;
			}
		};
		addLinkListener(iControl);
		return iControl;
	} else {
		return new DefaultInformationControl(parent, tooltipAffordanceString);
	}
}
 
源代码13 项目: gama   文件: GamlHoverProvider.java
@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);
	}
}
 
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);
	}
}
 
源代码17 项目: Pydev   文件: PyEditProjection.java
@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);
    }
}
 
源代码18 项目: http4e   文件: HConfiguration.java
/**
 * @Override
 */
public IInformationControlCreator getInformationControlCreator( ISourceViewer sourceViewer){
   return new IInformationControlCreator() {
      public IInformationControl createInformationControl( Shell parent){
         return new DefaultInformationControl(parent, getInformationPresenter());
      }
   };
}
 
源代码19 项目: xtext-eclipse   文件: AbstractHover.java
@Override
public IInformationControlCreator getHoverControlCreator() {
	return new IInformationControlCreator() {
		@Override
		public IInformationControl createInformationControl(Shell parent) {
			return new DefaultInformationControl(parent, EditorsUI.getTooltipAffordanceString());
		}
	};
}
 
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	if (BrowserInformationControl.isAvailable(parent)) {
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
		String font = "org.eclipse.jdt.ui.javadocfont"; // FIXME: mPreferenceConstants.APPEARANCE_JAVADOC_FONT;
		IXtextBrowserInformationControl control = new XtextBrowserInformationControl(parent, font, tbm);
		configureControl(control, tbm, font);
		return control;
	} else {
		return new DefaultInformationControl(parent,true);
	}
}
 
源代码21 项目: xtext-eclipse   文件: XtextQuickAssistAssistant.java
protected AbstractReusableInformationControlCreator createInformationControlCreator() {
	return new AbstractReusableInformationControlCreator() {
		@Override
		public IInformationControl doCreateInformationControl(Shell parent) {
			return new DefaultInformationControl(parent, (IInformationPresenter) null);
		}
	};
}
 
源代码22 项目: xtext-eclipse   文件: XbaseHoverProvider.java
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	if (XbaseInformationControl.isAvailable(parent)) {
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
		String font = "org.eclipse.jdt.ui.javadocfont";
		IXtextBrowserInformationControl control = new XbaseInformationControl(parent, font, tbm,
				xbaseHoverConfiguration);
		configureControl(control, tbm, font);
		return control;
	} else {
		return new DefaultInformationControl(parent, true);
	}
}
 
源代码23 项目: texlipse   文件: TexSourceViewerConfiguration.java
public IInformationControlCreator getInformationControlCreator
(ISourceViewer sourceViewer) {
    return new IInformationControlCreator() {
        public IInformationControl createInformationControl(Shell parent) {
            return new DefaultInformationControl(parent, presenter);
        }
    };
}
 
源代码24 项目: xds-ide   文件: ModulaSourceViewerConfiguration.java
/**
 * {@inheritDoc}
 */
@Override
public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) {
    IInformationControlCreator icc = new IInformationControlCreator() {
        public IInformationControl createInformationControl(Shell parent) {
            return new DefaultInformationControl(parent, true);
        }
    }; 
    InformationPresenter ip = new InformationPresenter(icc);
    ModulaInformationProvider mip = new ModulaInformationProvider(this);
    ip.setInformationProvider(mip, IModulaPartitions.M2_CONTENT_TYPE_DEFAULT);
    return ip;
    
}
 
源代码25 项目: typescript.java   文件: PresenterControlCreator.java
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	if (BrowserInformationControl.isAvailable(parent)) {
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
		TypeScriptBrowserInformationControl control = new TypeScriptBrowserInformationControl(
				parent, null, tbm);
		tbm.update(true);
		addLinkListener(control);
		return control;
	} else {
		return new DefaultInformationControl(parent, true);
	}
}
 
源代码26 项目: typescript.java   文件: AbstractTypeScriptHover.java
@Override
public IInformationControlCreator getHoverControlCreator() {
	return new IInformationControlCreator() {
		@Override
		public IInformationControl createInformationControl(Shell parent) {
			return new DefaultInformationControl(parent, EditorsUI.getTooltipAffordanceString());
		}
	};
}
 
源代码27 项目: typescript.java   文件: AbstractTypeScriptHover.java
@Override
public IInformationControlCreator getInformationPresenterControlCreator() {
	return new IInformationControlCreator() {
		@Override
		public IInformationControl createInformationControl(Shell shell) {
			return new DefaultInformationControl(shell, true);
		}
	};
}
 
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {

		IPreferenceStore store= JavaScriptPlugin.getDefault().getPreferenceStore();
		JavaScriptTextTools textTools= JavaScriptPlugin.getDefault().getJavaTextTools();
		IColorManager manager= textTools.getColorManager();					
		

		ContentAssistant assistant= new ContentAssistant();
		assistant.setContentAssistProcessor(fProcessor, IDocument.DEFAULT_CONTENT_TYPE);
			// Register the same processor for strings and single line comments to get code completion at the start of those partitions.
		assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_STRING);
		assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_CHARACTER);
		assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_SINGLE_LINE_COMMENT);
		assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_MULTI_LINE_COMMENT);
		assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVASCRIPT_TEMPLATE_LITERAL);
		assistant.setContentAssistProcessor(fProcessor, IJavaScriptPartitions.JAVA_DOC);

		assistant.enableAutoInsert(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOINSERT));
		assistant.enableAutoActivation(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION));
		assistant.setAutoActivationDelay(store.getInt(PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY));
		assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
		assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
		assistant.setInformationControlCreator(new IInformationControlCreator() {
			public IInformationControl createInformationControl(Shell parent) {
				return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(true));
			}
		});

		Color background= getColor(store, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND, manager);			
		assistant.setContextInformationPopupBackground(background);
		assistant.setContextSelectorBackground(background);
		assistant.setProposalSelectorBackground(background);

		Color foreground= getColor(store, PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND, manager);
		assistant.setContextInformationPopupForeground(foreground);
		assistant.setContextSelectorForeground(foreground);
		assistant.setProposalSelectorForeground(foreground);
		
		return assistant;
	}
 
源代码29 项目: gama   文件: GamlProposalProvider.java
@Override
public IInformationControlCreator getInformationControlCreator() {
	return parent -> {
		final IInformationControl control = new DefaultInformationControl(parent, true);
		return control;

	};
}
 
源代码30 项目: APICloud-Studio   文件: AbstractCommonTextHover.java
public IInformationControlCreator getHoverControlCreator()
{
	return new IInformationControlCreator()
	{
		public IInformationControl createInformationControl(Shell parent)
		{
			return new DefaultInformationControl(parent, AbstractCommonTextHover.this.getTooltipAffordanceString());
		}
	};
}
 
 类所在包
 同包方法