Java 类org.eclipse.jface.text.source.IVerticalRulerColumn 实例源码

项目:gama    文件:GamlEditor.java   
@Override
protected void handlePreferenceStoreChanged(final PropertyChangeEvent event) {
    final LineNumberColumn c;
    super.handlePreferenceStoreChanged(event);
    if (event.getProperty().equals(PREFERENCE_COLOR_BACKGROUND)) {
        // this.fSourceViewerDecorationSupport.updateOverviewDecorations();

        this.getVerticalRuler().getControl()
                .setBackground(GamaColors.get(AutoStartup.EDITOR_BACKGROUND_COLOR.getValue()).color());

        final Iterator e = ((CompositeRuler) getVerticalRuler()).getDecoratorIterator();
        while (e.hasNext()) {
            final IVerticalRulerColumn column = (IVerticalRulerColumn) e.next();
            column.getControl()
                    .setBackground(GamaColors.get(AutoStartup.EDITOR_BACKGROUND_COLOR.getValue()).color());
            column.redraw();
        }
    }
}
项目:typescript.java    文件:TypeScriptEditor.java   
/**
 * Creates a new line number ruler column that is appropriately initialized.
 *
 * @return the created line number column
 */
protected IVerticalRulerColumn createLineNumberRulerColumn() {
    /*
     * Left for compatibility. See LineNumberColumn.
     */
    fLineNumberRulerColumn = LineNumberChangeRulerColumnPatch.create(getSharedColors());
    ((IChangeRulerColumn) fLineNumberRulerColumn).setHover(createChangeHover());
    initializeLineNumberRulerColumn(fLineNumberRulerColumn);
    return fLineNumberRulerColumn;
}
项目:APICloud-Studio    文件:ThemeableEditorExtension.java   
@SuppressWarnings("unchecked")
private void overrideRulerColors()
{
    IThemeableEditor editor = this.fEditor.get();

    // default to bg color of surrounding composite
    Color bg = null;
    // Use editor background color if we can
    if (editor != null)
    {
        ISourceViewer sv = editor.getISourceViewer();
        if (sv != null)
        {
            StyledText text = sv.getTextWidget();
            if (text != null)
            {
                bg = text.getBackground();
                // copy the color because for some reason it gets disposed
                bg = ThemePlugin.getDefault().getColorManager().getColor(bg.getRGB());
            }
        }

        // force the colors for all the ruler columns (specifically so we force the folding bg to match).
        CompositeRuler ruler = (CompositeRuler) editor.getIVerticalRuler();
        Iterator<IVerticalRulerColumn> iter = ruler.getDecoratorIterator();
        while (iter.hasNext())
        {
            IVerticalRulerColumn column = iter.next();
            column.getControl().setBackground(bg);
        }
    }

    if (fLineColumn != null)
    {
        fLineColumn.setBackground(bg);
    }
}
项目:APICloud-Studio    文件:AbstractThemeableEditor.java   
@Override
protected IVerticalRulerColumn createLineNumberRulerColumn()
{
    fLineNumberRulerColumn = new CommonLineNumberChangeRulerColumn(getSharedColors());
    ((IChangeRulerColumn) fLineNumberRulerColumn).setHover(createChangeHover());
    initializeLineNumberRulerColumn(fLineNumberRulerColumn);
    return fLineNumberRulerColumn;
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaEditor.java   
@Override
protected IVerticalRulerColumn createAnnotationRulerColumn(CompositeRuler ruler) {
    if (!getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_ANNOTATION_ROLL_OVER))
        return super.createAnnotationRulerColumn(ruler);

    AnnotationRulerColumn column= new AnnotationRulerColumn(VERTICAL_RULER_WIDTH, getAnnotationAccess());
    column.setHover(new JavaExpandHover(ruler, getAnnotationAccess(), new IDoubleClickListener() {

        public void doubleClick(DoubleClickEvent event) {
            // for now: just invoke ruler double click action
            triggerAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK);
        }

        private void triggerAction(String actionID) {
            IAction action= getAction(actionID);
            if (action != null) {
                if (action instanceof IUpdate)
                    ((IUpdate) action).update();
                // hack to propagate line change
                if (action instanceof ISelectionListener) {
                    ((ISelectionListener)action).selectionChanged(null, null);
                }
                if (action.isEnabled())
                    action.run();
            }
        }

    }));

    return column;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaEditor.java   
@Override
protected IVerticalRulerColumn createAnnotationRulerColumn(CompositeRuler ruler) {
    if (!getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_ANNOTATION_ROLL_OVER))
        return super.createAnnotationRulerColumn(ruler);

    AnnotationRulerColumn column= new AnnotationRulerColumn(VERTICAL_RULER_WIDTH, getAnnotationAccess());
    column.setHover(new JavaExpandHover(ruler, getAnnotationAccess(), new IDoubleClickListener() {

        public void doubleClick(DoubleClickEvent event) {
            // for now: just invoke ruler double click action
            triggerAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK);
        }

        private void triggerAction(String actionID) {
            IAction action= getAction(actionID);
            if (action != null) {
                if (action instanceof IUpdate)
                    ((IUpdate) action).update();
                // hack to propagate line change
                if (action instanceof ISelectionListener) {
                    ((ISelectionListener)action).selectionChanged(null, null);
                }
                if (action.isEnabled())
                    action.run();
            }
        }

    }));

    return column;
}
项目:birt    文件:ScriptEditor.java   
/**
 * Creates a new line number ruler column that is appropriately initialized.
 * @param annotationModel 
 * 
 * @return the created line number column
 */
private IVerticalRulerColumn createLineNumberRulerColumn( )
{
    LineNumberRulerColumn column = new LineNumberRulerColumn( );

    column.setForeground( JSSourceViewerConfiguration.getColorByCategory( PreferenceNames.P_LINENUMBER_COLOR ) );
    return column;
}
项目:birt    文件:ExpressionBuilder.java   
/**
 * Creates a new line number ruler column that is appropriately initialized.
 * 
 * @param annotationModel
 * 
 * @return the created line number column
 */
private IVerticalRulerColumn createLineNumberRulerColumn( )
{
    LineNumberRulerColumn column = new LineNumberRulerColumn( );

    column.setForeground( JSSourceViewerConfiguration.getColorByCategory( PreferenceNames.P_LINENUMBER_COLOR ) );
    return column;
}