Package org.eclipse.ui.texteditor

Examples of org.eclipse.ui.texteditor.ChainedPreferenceStore$PropertyChangeListener


    return colorComposite;
  }

  private Control createPreviewer(Composite parent) {
        final IPreferenceStore chainedStore = new ChainedPreferenceStore(new IPreferenceStore[] {
            EditorsUI.getPreferenceStore(),
            getPreferenceStore(),
            });
       
    fPreviewViewer= new SourceViewer(parent, null, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
    fPreviewViewer.configure(new PerlSourceViewerConfiguration(chainedStore, null));
    fPreviewViewer.getTextWidget().setFont(JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT));
    fPreviewViewer.setEditable(false);

    initializeViewerColors(fPreviewViewer, chainedStore);

    String content= loadPreviewContentFromFile("ColorSettingPreviewCode.txt");

    IDocument document= new Document(content);
    new PerlPartitioner(PerlEditorPlugin.getDefault().getLog(), document);

    fPreviewViewer.setDocument(document);

    chainedStore.addPropertyChangeListener(new IPropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent event) {
                if (fPreviewViewer == null || fPreviewViewer.getTextWidget() == null)
                    return;
               
        String p= event.getProperty();
View Full Code Here


  }
 
  public IPreferenceStore getCombinedPreferenceStore() {
    if (fCombinedPreferenceStore == null) {
      IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore();
      fCombinedPreferenceStore = new ChainedPreferenceStore(
          new IPreferenceStore[] { getPreferenceStore(),
              generalTextStore });
    }
    return fCombinedPreferenceStore;
  }
View Full Code Here

        return null;
    }

    public static ChainedPreferenceStore getErlangEditorPreferenceStore() {
        final IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore();
        return new ChainedPreferenceStore(new IPreferenceStore[] {
                ErlideUIPlugin.getDefault().getPreferenceStore(), generalTextStore });
    }
View Full Code Here

        setSourceViewerConfiguration(cfg);
    }

    public static IPreferenceStore getErlangEditorPreferenceStore() {
        final IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore();
        return new ChainedPreferenceStore(new IPreferenceStore[] {
                ErlideUIPlugin.getDefault().getPreferenceStore(), generalTextStore });
    }
View Full Code Here

        } else {
            colors = colors0;
        }

        final IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore();
        final IPreferenceStore store = topStore == null ? new ChainedPreferenceStore(
                new IPreferenceStore[] { generalTextStore })
                : new ChainedPreferenceStore(new IPreferenceStore[] { topStore,
                        generalTextStore });

        final SourceViewer viewer = new SourceViewer(parent, null, null, false,
                SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
        final IDocument document = new Document(content);
View Full Code Here

        setSourceViewerConfiguration( new LdifSourceViewerConfiguration( this, true ) );
        setDocumentProvider( new LdifDocumentProvider() );

        IPreferenceStore editorStore = EditorsUI.getPreferenceStore();
        IPreferenceStore browserStore = LdifEditorActivator.getDefault().getPreferenceStore();
        IPreferenceStore combinedStore = new ChainedPreferenceStore( new IPreferenceStore[]
            { browserStore, editorStore } );
        setPreferenceStore( combinedStore );

        setHelpContextId( LdifEditorConstants.PLUGIN_ID + "." + "tools_ldif_editor" ); //$NON-NLS-1$ //$NON-NLS-2$
    }
View Full Code Here

    /*
     * @see org.epic.core.util.ScriptExecutor#getCommandLineOpts(java.util.List)
     */
    protected List getCommandLineOpts(List additionalOptions)
    {
        IPreferenceStore store = new ChainedPreferenceStore(new IPreferenceStore[] {
            EditorsUI.getPreferenceStore(),
            PerlEditorPlugin.getDefault().getPreferenceStore() });

        int numSpaces = store.getInt(PreferenceConstants.INSERT_TABS_ON_INDENT);
        boolean useSpaces = store.getBoolean(PreferenceConstants.SPACES_INSTEAD_OF_TABS);
        int tabWidth = useSpaces ? numSpaces : store.getInt(PreferenceConstants.EDITOR_TAB_WIDTH);
        int pageSize = store.getInt(PreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN);

        boolean cuddleElse = store.getBoolean(SourceFormatterPreferences.CUDDLED_ELSE);
        boolean bracesLeft = store.getBoolean(SourceFormatterPreferences.BRACES_LEFT);
        boolean lineUpParentheses =
            store.getBoolean(SourceFormatterPreferences.LINE_UP_WITH_PARENTHESES);
        boolean swallowOptionalBlankLines =
            store.getBoolean(SourceFormatterPreferences.SWALLOW_OPTIONAL_BLANK_LINES);

        // int containerTightnessBraces =
        // store.getInt(SourceFormatterPreferences.CONTAINER_TIGHTNESS_BRACES);
        // int containerTightnessParentheses =
        // store.getInt(SourceFormatterPreferences.CONTAINER_TIGHTNESS_PARENTHESES);
        // int containerTightnessSquareBrackets =
        // store.getInt(SourceFormatterPreferences.CONTAINER_TIGHTNESS_SQUARE_BRACKETS);

        List args = new ArrayList();

        // args.add("perltidy");
        args.add("-q");
        args.add("--indent-columns=" + tabWidth);
        args.add("--maximum-line-length=" + pageSize);
        // cmdList.add("--brace-tightness=" + containerTightnessBraces);
        // cmdList.add("--paren-tightness=" + containerTightnessParentheses);
        // cmdList.add("--square-bracket-tightness=" + containerTightnessSquareBrackets);

        if (!useSpaces)
        {
            args.add("--entab-leading-whitespace=" + tabWidth);
        }

        if (cuddleElse)
        {
            args.add("--cuddled-else");
        }

        if (bracesLeft)
        {
            args.add("--opening-brace-on-new-line");
        }

        if (lineUpParentheses)
        {
            args.add("--line-up-parentheses");
        }

        if (swallowOptionalBlankLines)
        {
            args.add("--swallow-optional-blank-lines");
        }

        // Read additional options
        args.addAll(CommandLineTokenizer.tokenize(
            store.getString(SourceFormatterPreferences.PERLTIDY_OPTIONS)));

        // Add additionally passed options
        if (additionalOptions != null)
        {
            args.addAll(additionalOptions);
View Full Code Here

  public HTMLSourceEditor(HTMLConfiguration config) {
    super();
    config.setEditorPart(this);
    colorProvider = HTMLPlugin.getDefault().getColorProvider();
    setSourceViewerConfiguration(config);
    setPreferenceStore(new ChainedPreferenceStore(
        new IPreferenceStore[]{
            getPreferenceStore(),
            HTMLPlugin.getDefault().getPreferenceStore()
        }));
   
View Full Code Here

 
  public CSSEditor(){
    super();
    colorProvider = HTMLPlugin.getDefault().getColorProvider();
    setSourceViewerConfiguration(new CSSConfiguration(colorProvider));
    setPreferenceStore(new ChainedPreferenceStore(
        new IPreferenceStore[]{
            getPreferenceStore(),
            HTMLPlugin.getDefault().getPreferenceStore()
        }));
   
View Full Code Here

 
  public JavaScriptEditor(){
    super();
    colorProvider = HTMLPlugin.getDefault().getColorProvider();
    setSourceViewerConfiguration(new JavaScriptConfiguration(colorProvider));
    setPreferenceStore(new ChainedPreferenceStore(
        new IPreferenceStore[]{
            getPreferenceStore(),
            HTMLPlugin.getDefault().getPreferenceStore()
        }));
   
View Full Code Here

TOP

Related Classes of org.eclipse.ui.texteditor.ChainedPreferenceStore$PropertyChangeListener

Copyright © 2018 www.massapicom. 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.