Examples of PHPStructuredTextViewerConfiguration


Examples of org.eclipse.php.internal.ui.editor.configuration.PHPStructuredTextViewerConfiguration

   *            the parent control
   * @return a configured source viewer
   */
  private SourceViewer createViewer(Composite parent) {
    SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
      StructuredTextViewerConfiguration baseConfiguration = new PHPStructuredTextViewerConfiguration();

      @Override
      public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
        return baseConfiguration
            .getConfiguredContentTypes(sourceViewer);
      }

      @Override
      public LineStyleProvider[] getLineStyleProviders(
          ISourceViewer sourceViewer, String partitionType) {
        return baseConfiguration.getLineStyleProviders(sourceViewer,
            partitionType);
      }
    };
    SourceViewer viewer = new StructuredTextViewer(parent, null, null,
        false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
View Full Code Here

Examples of org.eclipse.php.internal.ui.editor.configuration.PHPStructuredTextViewerConfiguration

    text.setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$

    // PHPStructuredTextViewerConfiguration configuration = new
    // PHPStructuredTextViewerConfiguration();
    SourceViewerConfiguration configuration = new StructuredTextViewerConfiguration() {
      StructuredTextViewerConfiguration baseConfiguration = new PHPStructuredTextViewerConfiguration();

      @Override
      public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
        return baseConfiguration
            .getConfiguredContentTypes(sourceViewer);
      }

      @Override
      public LineStyleProvider[] getLineStyleProviders(
          ISourceViewer sourceViewer, String partitionType) {
        return baseConfiguration.getLineStyleProviders(sourceViewer,
            partitionType);
      }
    };
    viewer.configure(configuration);
    viewer.setEditable(false);
View Full Code Here

Examples of org.eclipse.php.internal.ui.editor.configuration.PHPStructuredTextViewerConfiguration

      }

      // notifing the processors that the next request for completion is
      // an explicit request
      if (fViewerConfiguration != null) {
        PHPStructuredTextViewerConfiguration structuredTextViewerConfiguration = (PHPStructuredTextViewerConfiguration) fViewerConfiguration;
        IContentAssistProcessor[] all = structuredTextViewerConfiguration
            .getContentAssistProcessors(this,
                PHPPartitionTypes.PHP_DEFAULT);
        for (IContentAssistProcessor element : all) {
          if (element instanceof PHPCompletionProcessor) {
            ((PHPCompletionProcessor) element).setExplicit(true);
View Full Code Here

Examples of org.eclipse.php.internal.ui.editor.configuration.PHPStructuredTextViewerConfiguration

    if (!(configuration instanceof PHPStructuredTextViewerConfiguration)) {
      return;
    }
    fViewerConfiguration = configuration;

    PHPStructuredTextViewerConfiguration phpConfiguration = (PHPStructuredTextViewerConfiguration) configuration;
    IContentAssistant newPHPAssistant = phpConfiguration
        .getPHPContentAssistant(this, true);

    // Uninstall content assistant created in super:
    if (fContentAssistant != null) {
      fContentAssistant.uninstall();
    }

    // Assign, and configure our content assistant:
    fContentAssistant = newPHPAssistant;
    if (fContentAssistant != null) {
      fContentAssistant.install(this);
      if (fContentAssistant instanceof IContentAssistantExtension2
          && fContentAssistant instanceof IContentAssistantExtension4)
        fContentAssistantFacade = new ContentAssistantFacade(
            fContentAssistant);
      fContentAssistantInstalled = true;
    } else {
      // 248036 - disable the content assist operation if no content
      // assistant
      enableOperation(CONTENTASSIST_PROPOSALS, false);
    }

    fOutlinePresenter = phpConfiguration.getOutlinePresenter(this);
    if (fOutlinePresenter != null) {
      fOutlinePresenter.install(this);
    }

    fHierarchyPresenter = phpConfiguration
        .getHierarchyPresenter(this, true);
    if (fHierarchyPresenter != null) {
      fHierarchyPresenter.install(this);
    }
  }
View Full Code Here

Examples of org.eclipse.php.internal.ui.editor.configuration.PHPStructuredTextViewerConfiguration

        boolean activated = true;
        if (type != PHPPartitionTypes.PHP_DEFAULT) {
          if (fViewer instanceof PHPStructuredTextViewer) {
            PHPStructuredTextViewer phpViewer = (PHPStructuredTextViewer) fViewer;
            if (phpViewer.getViewerConfiguration() instanceof PHPStructuredTextViewerConfiguration) {
              PHPStructuredTextViewerConfiguration viewerConfiguration = (PHPStructuredTextViewerConfiguration) phpViewer
                  .getViewerConfiguration();
              IContentAssistProcessor[] processors = viewerConfiguration
                  .getProcessorMap().get(type);
              if (processors != null) {
                StringBuffer sb = new StringBuffer();
                for (int i = 0; i < processors.length; i++) {
                  sb.append(computeAllAutoActivationTriggers(processors[i]));
View Full Code Here

Examples of org.eclipse.php.internal.ui.editor.configuration.PHPStructuredTextViewerConfiguration

                .equals(property)
            || PHPCoreConstants.CODEASSIST_AUTOINSERT
                .equals(property)) {
          ISourceViewer sourceViewer = getSourceViewer();
          if (sourceViewer != null) {
            PHPStructuredTextViewerConfiguration configuration = (PHPStructuredTextViewerConfiguration) getSourceViewerConfiguration();
            if (configuration != null) {
              StructuredContentAssistant contentAssistant = (StructuredContentAssistant) configuration
                  .getPHPContentAssistant(sourceViewer);

              IPreferencesService preferencesService = Platform
                  .getPreferencesService();
              contentAssistant
View Full Code Here

Examples of org.eclipse.php.internal.ui.editor.configuration.PHPStructuredTextViewerConfiguration

      // since Coloring in preview is mixed up we should
      // re-configure this after setting new document
      if (newDocument instanceof IStructuredDocument) {
        tp.setDocument(newDocument);
        tp.configure(new PHPStructuredTextViewerConfiguration());
      }

      tp.setEnabled(enabled);

      return enabled;
View Full Code Here

Examples of org.eclipse.php.internal.ui.editor.configuration.PHPStructuredTextViewerConfiguration

      if (fSourceViewer == null)
        fSourceViewer = new ArrayList();
      fSourceViewer.add(textViewer);

      ((SourceViewer) textViewer)
          .configure(new PHPStructuredTextViewerConfiguration());
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.