Search in sources :

Example 1 with ILinkViewerListener

use of org.whole.lang.e4.ui.actions.ILinkViewerListener in project whole by wholeplatform.

the class DerivedViewPart method createPartControl.

@Override
public void createPartControl(Composite parent) {
    super.createPartControl(parent);
    getComponent().addLinkViewerListener(new ILinkViewerListener() {

        public void viewerLinked(IEntityPartViewer viewer, IEntityPartViewer toViewer) {
            redirectCommandStackActions(viewer);
        }

        public void viewerUnlinked(IEntityPartViewer viewer) {
            redirectCommandStackActions(viewer);
        }

        protected void redirectCommandStackActions(IEntityPartViewer viewer) {
            undoAction.redirect(viewer);
            redoAction.redirect(viewer);
        }

        public void contentsDerived(IEntityPartViewer viewer, IBindingManager selection, IEntity result) {
            if (disableEditing)
                viewer.setInteractive(result, false, true, false);
        }
    });
    linkToEditorAction.setLinkable(getComponent().getSelectionLinkable());
}
Also used : IEntity(org.whole.lang.model.IEntity) IBindingManager(org.whole.lang.bindings.IBindingManager) ILinkViewerListener(org.whole.lang.e4.ui.actions.ILinkViewerListener) IEntityPartViewer(org.whole.lang.ui.viewers.IEntityPartViewer)

Example 2 with ILinkViewerListener

use of org.whole.lang.e4.ui.actions.ILinkViewerListener in project whole by wholeplatform.

the class OutlineTreeViewPart method createPartControl.

@Override
public void createPartControl(Composite parent) {
    super.createPartControl(parent);
    getComponent().addLinkViewerListener(new ILinkViewerListener() {

        public void viewerLinked(IEntityPartViewer viewer, IEntityPartViewer toViewer) {
            redirectCommandStackActions(viewer);
        }

        public void viewerUnlinked(IEntityPartViewer viewer) {
            redirectCommandStackActions(viewer);
        }

        protected void redirectCommandStackActions(IEntityPartViewer viewer) {
            undoAction.redirect(viewer);
            redoAction.redirect(viewer);
        }

        public void contentsDerived(IEntityPartViewer viewer, IBindingManager selection, IEntity result) {
        }
    });
}
Also used : IEntity(org.whole.lang.model.IEntity) IBindingManager(org.whole.lang.bindings.IBindingManager) ILinkViewerListener(org.whole.lang.e4.ui.actions.ILinkViewerListener) IEntityPartViewer(org.whole.lang.ui.viewers.IEntityPartViewer)

Aggregations

IBindingManager (org.whole.lang.bindings.IBindingManager)2 ILinkViewerListener (org.whole.lang.e4.ui.actions.ILinkViewerListener)2 IEntity (org.whole.lang.model.IEntity)2 IEntityPartViewer (org.whole.lang.ui.viewers.IEntityPartViewer)2