Package org.eclipse.ui.texteditor.rulers

Examples of org.eclipse.ui.texteditor.rulers.RulerColumnDescriptor


      adapter= new RulerColumnPreferenceAdapter(getPreferenceStore(), PREFERENCE_RULER_CONTRIBUTIONS);
   
    RulerColumnRegistry registry= RulerColumnRegistry.getDefault();
    List descriptors= registry.getColumnDescriptors();
    for (Iterator it= descriptors.iterator(); it.hasNext();) {
      final RulerColumnDescriptor descriptor= (RulerColumnDescriptor) it.next();
      support.setColumnVisible(descriptor, adapter == null || adapter.isEnabled(descriptor));
    }
  }
View Full Code Here


   
    if (PREFERENCE_RULER_CONTRIBUTIONS.equals(property)) {
      String[] difference= StringSetSerializer.getDifference((String) event.getOldValue(), (String) event.getNewValue());
      IColumnSupport support= (IColumnSupport) getAdapter(IColumnSupport.class);
      for (int i= 0; i < difference.length; i++) {
        RulerColumnDescriptor desc= RulerColumnRegistry.getDefault().getColumnDescriptor(difference[i]);
        if (desc != null &&  support.isColumnSupported(desc)) {
          boolean newState= !support.isColumnVisible(desc);
          support.setColumnVisible(desc, newState);
        }
      }
View Full Code Here

    private IContributedRulerColumn getVisibleColumn(CompositeRuler ruler, RulerColumnDescriptor descriptor) {
      for (Iterator it= ruler.getDecoratorIterator(); it.hasNext();) {
        IVerticalRulerColumn column= (IVerticalRulerColumn)it.next();
        if (column instanceof IContributedRulerColumn) {
          IContributedRulerColumn rulerColumn= (IContributedRulerColumn)column;
          RulerColumnDescriptor rcd= rulerColumn.getDescriptor();
          if (descriptor.equals(rcd))
            return rulerColumn;
        }
      }
      return null;
View Full Code Here

      List all= fRegistry.getColumnDescriptors();
      int newPos= all.indexOf(descriptor);
      for (Iterator it= ruler.getDecoratorIterator(); it.hasNext();) {
        IVerticalRulerColumn column= (IVerticalRulerColumn) it.next();
        if (column instanceof IContributedRulerColumn) {
          RulerColumnDescriptor rcd= ((IContributedRulerColumn)column).getDescriptor();
          if (rcd != null && all.indexOf(rcd) > newPos)
            break;
        } else if ("org.eclipse.jface.text.source.projection.ProjectionRulerColumn".equals(column.getClass().getName())) { //$NON-NLS-1$
          // projection column is always the rightmost column
          break;
View Full Code Here

      fSourceViewerDecorationSupport.install(getPreferenceStore());

    IColumnSupport columnSupport= (IColumnSupport)getAdapter(IColumnSupport.class);
   
    if (isLineNumberRulerVisible()) {
      RulerColumnDescriptor lineNumberColumnDescriptor= RulerColumnRegistry.getDefault().getColumnDescriptor(LineNumberColumn.ID);
      if (lineNumberColumnDescriptor != null)
        columnSupport.setColumnVisible(lineNumberColumnDescriptor, true);
    }

    if (isPrefQuickDiffAlwaysOn())
View Full Code Here

    IColumnSupport columnSupport= (IColumnSupport)getAdapter(IColumnSupport.class);
   
    // only handle visibility of the combined column, but not the number/change only state
    if (show && fLineColumn == null) {
      RulerColumnDescriptor lineNumberColumnDescriptor= RulerColumnRegistry.getDefault().getColumnDescriptor(LineNumberColumn.ID);
      if (lineNumberColumnDescriptor != null)
        columnSupport.setColumnVisible(lineNumberColumnDescriptor, true);
    } else if (!show && fLineColumn != null && !isLineNumberRulerVisible()) {
      columnSupport.setColumnVisible(fLineColumn.getDescriptor(), false);
      fLineColumn= null;
View Full Code Here

      /*
       * @see org.eclipse.ui.texteditor.rulers.ColumnSupport#initializeColumn(org.eclipse.ui.texteditor.rulers.AbstractContributedRulerColumn)
       */
      protected void initializeColumn(IContributedRulerColumn column) {
        super.initializeColumn(column);
        RulerColumnDescriptor descriptor= column.getDescriptor();
        IVerticalRuler ruler= internalGetVerticalRuler();
        if (ruler instanceof CompositeRuler) {
          if (AnnotationColumn.ID.equals(descriptor.getId())) {
            ((AnnotationColumn)column).setDelegate(createAnnotationRulerColumn((CompositeRuler) ruler));
          } else if (LineNumberColumn.ID.equals(descriptor.getId())) {
            fLineColumn= ((LineNumberColumn) column);
            fLineColumn.setForwarder(new LineNumberColumn.ICompatibilityForwarder() {
              public IVerticalRulerColumn createLineNumberRulerColumn() {
                return AbstractDecoratedTextEditor.this.createLineNumberRulerColumn();
              }
View Full Code Here

      if (LINE_NUMBER_RULER.equals(property)) {
        // only handle visibility of the combined column, but not the number/change only state
        IColumnSupport columnSupport= (IColumnSupport)getAdapter(IColumnSupport.class);
        if (isLineNumberRulerVisible() && fLineColumn == null) {
          RulerColumnDescriptor lineNumberColumnDescriptor= RulerColumnRegistry.getDefault().getColumnDescriptor(LineNumberColumn.ID);
          if (lineNumberColumnDescriptor != null)
            columnSupport.setColumnVisible(lineNumberColumnDescriptor, true);
        } else if (!isLineNumberRulerVisible() && fLineColumn != null && !fLineColumn.isShowingChangeInformation()) {
          columnSupport.setColumnVisible(fLineColumn.getDescriptor(), false);
          fLineColumn= null;
View Full Code Here

    if (fLineColumn != null)
      fLineColumn.hideRevisionInformation();

    super.doSetInput(input);
   
    RulerColumnDescriptor lineNumberColumnDescriptor= RulerColumnRegistry.getDefault().getColumnDescriptor(LineNumberColumn.ID);
    if (lineNumberColumnDescriptor != null) {
      IColumnSupport columnSupport= (IColumnSupport)getAdapter(IColumnSupport.class);
      columnSupport.setColumnVisible(lineNumberColumnDescriptor, isLineNumberRulerVisible() || isPrefQuickDiffAlwaysOn());
    }
  }
View Full Code Here

    final IColumnSupport support= (IColumnSupport) getAdapter(IColumnSupport.class);
    IPreferenceStore store= EditorsUI.getPreferenceStore();
    final RulerColumnPreferenceAdapter adapter= new RulerColumnPreferenceAdapter(store, AbstractTextEditor.PREFERENCE_RULER_CONTRIBUTIONS);
    List descriptors= RulerColumnRegistry.getDefault().getColumnDescriptors();
    for (Iterator t= descriptors.iterator(); t.hasNext();) {
      final RulerColumnDescriptor descriptor= (RulerColumnDescriptor) t.next();
      if (!descriptor.isIncludedInMenu() || !support.isColumnSupported(descriptor))
        continue;
      final boolean isVisible= support.isColumnVisible(descriptor);
      IAction action= new Action(MessageFormat.format(TextEditorMessages.AbstractDecoratedTextEditor_show_ruler_label, new Object[] {descriptor.getName()}), IAction.AS_CHECK_BOX) {
        public void run() {
          if (descriptor.isGlobal())
            // column state is modified via preference listener of AbstractTextEditor
            adapter.setEnabled(descriptor, !isVisible);
          else
            // directly modify column for this editor instance
            support.setColumnVisible(descriptor, !isVisible);
        }
      };
      action.setChecked(isVisible);
      action.setImageDescriptor(descriptor.getIcon());
      menu.appendToGroup(ITextEditorActionConstants.GROUP_RULERS, action);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.texteditor.rulers.RulerColumnDescriptor

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.