Examples of RulerColumnPreferenceAdapter


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

  protected void updateContributedRulerColumns(CompositeRuler ruler) {
    IColumnSupport support= (IColumnSupport)getAdapter(IColumnSupport.class);
    if (support == null)
      return;
   
    RulerColumnPreferenceAdapter adapter= null;
    if (fPreferenceStore != null)
      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

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

   */
  private void addRulerContributionActions(IMenuManager menu) {
    // store directly in generic editor preferences
    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);
        }
      };
View Full Code Here

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

  protected void updateContributedRulerColumns(CompositeRuler ruler) {
    IColumnSupport support= (IColumnSupport)getAdapter(IColumnSupport.class);
    if (support == null)
      return;

    RulerColumnPreferenceAdapter adapter= null;
    if (fPreferenceStore != null)
      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
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.