Package org.eclipse.ui

Examples of org.eclipse.ui.IPropertyListener


        // when
        editorTracker.start();
        editorTracker.addListener(markdownListener);
        editorTracker.editorShown(editorPart);
        IPropertyListener propertyListener = propertyListenerCaptor.getValue();
        given(editorPart.isDirty()).willReturn(false);
        propertyListener.propertyChanged(editorPart, IEditorPart.PROP_DIRTY);

        // then
        verify(markdownListener, times(2)).notifyEditorFile(editorIFile);
        verifyNoMoreInteractions(markdownListener);
    }
View Full Code Here


        // when
        editorTracker.start();
        editorTracker.addListener(markdownListener);
        editorTracker.editorShown(editorPart);
        IPropertyListener propertyListener = propertyListenerCaptor.getValue();
        given(editorPart.isDirty()).willReturn(false);
        propertyListener.propertyChanged(editorPart, IEditorPart.PROP_INPUT);

        // then
        verify(markdownListener, times(1)).notifyEditorFile(editorIFile);
        verifyNoMoreInteractions(markdownListener);
    }
View Full Code Here

        // when
        editorTracker.start();
        editorTracker.addListener(markdownListener);
        editorTracker.editorShown(editorPart);
        IPropertyListener propertyListener = propertyListenerCaptor.getValue();
        given(editorPart.isDirty()).willReturn(true);
        propertyListener.propertyChanged(editorPart, IEditorPart.PROP_DIRTY);

        // then
        verify(markdownListener, times(1)).notifyEditorFile(editorIFile);
        verifyNoMoreInteractions(markdownListener);
    }
View Full Code Here

      apiEditor.init(apiSite, apiInput);
    } catch (PartInitException e) {
      ComponenteditorPlugin.getDefault().log(e);
    }
    createInnerPartControl(this.getParentSashForm(), apiEditor);
    apiEditor.addPropertyListener(new IPropertyListener() {
      public void propertyChanged(Object source, int propertyId) {
        ApiTab.this.getComponentEditorPart().publicHandlePropertyChange(propertyId);
      }
    });
  }
View Full Code Here

      templateEditor.init(htmlSite, htmlInput);
    } catch (PartInitException e) {
      ComponenteditorPlugin.getDefault().log(e);
    }
    _templateContainer = createInnerPartControl(getParentSashForm(), templateEditor);
    templateEditor.addPropertyListener(new IPropertyListener() {
      public void propertyChanged(Object source, int propertyId) {
        HtmlWodTab.this.getComponentEditorPart().publicHandlePropertyChange(propertyId);
      }
    });
    if (wodInput != null && ((ComponentEditorFileEditorInput)wodInput).getFile().exists()) {
      wodEditor = new WodEditor();
      IEditorSite wodSite = this.getComponentEditorPart().publicCreateSite(wodEditor);
      try {
        wodEditor.init(wodSite, wodInput);
      } catch (PartInitException e) {
        ComponenteditorPlugin.getDefault().log(e);
      }
      _wodContainer = createInnerPartControl(getParentSashForm(), wodEditor);
      _wodContainer.setBackground(_wodContainer.getDisplay().getSystemColor(SWT.COLOR_WHITE));
      wodEditor.addPropertyListener(new IPropertyListener() {
        public void propertyChanged(Object source, int propertyId) {
          HtmlWodTab.this.getComponentEditorPart().publicHandlePropertyChange(propertyId);
        }
      });
      wodEditor.getSelectionProvider().addSelectionChangedListener(new ISelectionChangedListener() {
View Full Code Here

      wooEditor.init(wooSite, wooInput);
    } catch (PartInitException e) {
      ComponenteditorPlugin.getDefault().log(e);
    }
    createInnerPartControl(this.getParentSashForm(), wooEditor);
    wooEditor.addPropertyListener(new IPropertyListener() {
      public void propertyChanged(Object source, int propertyId) {
        WooTab.this.getComponentEditorPart().publicHandlePropertyChange(propertyId);
      }
    });
  }
View Full Code Here

  public void createPartControl(Composite parent) {
    try {
      // Don't split when EditorInput isn't IFileEditorInput
      if(!(getEditorInput() instanceof IFileEditorInput)){
        _editor.init(getEditorSite(), getEditorInput());
        _editor.addPropertyListener(new IPropertyListener() {
          public void propertyChanged(Object source, int propertyId) {
            firePropertyChange(propertyId);
          }
        });
        _editor.createPartControl(parent);
        return;
      }
     
      SashForm sash = null;
      if(_isHorizontal){
        sash = new SashForm(parent,SWT.VERTICAL);
      } else {
        sash = new SashForm(parent,SWT.HORIZONTAL);
      }
      _site = new SplitEditorSite(_editor, getEditorSite());
      _editor.init(_site, getEditorInput());
      _editor.addPropertyListener(new IPropertyListener() {
        public void propertyChanged(Object source, int propertyId) {
          firePropertyChange(propertyId);
        }
      });
      _editor.createPartControl(sash);
View Full Code Here

    else if (type.equals("tab")) {
      _editor = new MultiPageHTMLEditor(this, createHTMLSourceEditor(getSourceViewerConfiguration()));
    }
    else {
      _editor = createHTMLSourceEditor(getSourceViewerConfiguration());
      _editor.addPropertyListener(new IPropertyListener() {
        public void propertyChanged(Object source, int propertyId) {
          firePropertyChange(propertyId);
        }
      });
    }
View Full Code Here

  public ClojureEditor() {
        setPreferenceStore(CCWPlugin.getDefault().getCombinedPreferenceStore());
    setSourceViewerConfiguration(new ClojureSourceViewerConfiguration(getPreferenceStore(), this));
        setDocumentProvider(new ClojureDocumentProvider());
        setHelpContextId(EDITOR_REFERENCE_HELP_CONTEXT_ID);
        addPropertyListener(new IPropertyListener() {
      @Override
      public void propertyChanged(Object source, int propId) {
        if (propId == IEditorPart.PROP_INPUT) {
          updatePartNameAndDescription();
          outlinePage.setInput(getEditorInput());
View Full Code Here

     *            the id of the property that changed
     */
    public void firePropertyChange(final int propertyId) {
        Object[] array = propChangeListeners.getListeners();
        for (int i = 0; i < array.length; i++) {
            final IPropertyListener l = (IPropertyListener) array[i];
            SafeRunner.run(new SafeRunnable() {

                public void run() {
                    l.propertyChanged(this, propertyId);
                }

                public void handleException(Throwable e) {
                    super.handleException(e);
                    // If an unexpected exception happens, remove it
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IPropertyListener

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.