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

项目: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;
}