Examples of IKeyBindingService


Examples of org.eclipse.ui.IKeyBindingService

     * Contributes the common global actions.
     * @param part WorkbenchPart such as a view or editor
     * @param bars Actionbar used to register global actions
     */
    public void contributeGlobalActions( IWorkbenchPart part, IActionBars bars ) {
        IKeyBindingService service = part.getSite().getKeyBindingService();
        bars.setGlobalActionHandler(ActionFactory.BACK.getId(), getBACKWARD_HISTORYAction());
        bars.setGlobalActionHandler(ActionFactory.FORWARD.getId(), getFORWARD_HISTORYAction());
        bars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getUNDOAction());
        bars.setGlobalActionHandler(ActionFactory.REDO.getId(), getREDOAction());
        bars.setGlobalActionHandler(ActionFactory.CUT.getId(), getCUTAction(part));
        bars.setGlobalActionHandler(ActionFactory.COPY.getId(), getCOPYAction(part));
        bars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getPASTEAction(part));
        bars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getDELETEAction());
       
        ISelectionProvider selection = part.getSite().getSelectionProvider();
        if( selection != null ){
            bars.setGlobalActionHandler(ActionFactory.PROPERTIES.getId(), getPropertiesAction(part,selection));
        }
       
        if(actionCLOSE == null)
          actionCLOSE = ActionFactory.CLOSE.create(part.getSite().getWorkbenchWindow());
        service.registerAction(actionCLOSE);
        bars.setGlobalActionHandler(ActionFactory.CLOSE.getId(), actionCLOSE);

        if(actionSAVE == null)
          actionSAVE = ActionFactory.SAVE.create(part.getSite().getWorkbenchWindow());
        service.registerAction(actionSAVE);
        bars.setGlobalActionHandler(ActionFactory.SAVE.getId(), actionSAVE);

        if(actionCLOSE_ALL == null)
          actionCLOSE_ALL = ActionFactory.CLOSE_ALL.create(part.getSite().getWorkbenchWindow());
        bars.setGlobalActionHandler(ActionFactory.CLOSE_ALL.getId(), actionCLOSE_ALL);
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

            throw new NullPointerException("part must not be null"); //$NON-NLS-1$
        redoLock.lock();
        try {
            redoAction = action;
            redoAction.setActionDefinitionId("org.eclipse.ui.edit.redo"); //$NON-NLS-1$
            IKeyBindingService service = part.getSite().getKeyBindingService();
            service.registerAction(redoAction);
        } finally {
            redoLock.unlock();
        }
    }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

            throw new NullPointerException("part must not be null"); //$NON-NLS-1$
        undoLock.lock();
        try{
            undoAction = action;
            undoAction.setActionDefinitionId("org.eclipse.ui.edit.undo"); //$NON-NLS-1$
            IKeyBindingService service = part.getSite().getKeyBindingService();
            service.registerAction(undoAction);
        }finally{
            undoLock.unlock();
        }
    }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

            throw new NullPointerException("part must not be null"); //$NON-NLS-1$
        forwardLock.lock();
        try{
            forwardAction = action;
            forwardAction.setActionDefinitionId("org.eclipse.ui.navigate.forward"); //$NON-NLS-1$
            IKeyBindingService service = part.getSite().getKeyBindingService();
            service.registerAction(forwardAction);
        }finally{
            forwardLock.unlock();
        }
    }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

        }
    }

    public void registerActionsWithPart( IWorkbenchPart part ) {

        IKeyBindingService service = part.getSite().getKeyBindingService();
        service.registerAction(getBACKWARD_HISTORYAction());
        service.registerAction(getFORWARD_HISTORYAction());
        service.registerAction(getCOPYAction(part));
        service.registerAction(getCUTAction(part));
        service.registerAction(getDELETEAction());
        service.registerAction(getPASTEAction(part));
        service.registerAction(getREDOAction());
        service.registerAction(getUNDOAction());
       
        addToolScope(part.getSite());
    }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

        addToolScope(part.getSite());
    }
   
    public void unregisterActions( IWorkbenchPart  part ){

        IKeyBindingService service = part.getSite().getKeyBindingService();

        service.unregisterAction(getBACKWARD_HISTORYAction());
        service.unregisterAction(getFORWARD_HISTORYAction());
        service.unregisterAction(getCOPYAction(part));
        service.unregisterAction(getCUTAction(part));
        service.unregisterAction(getDELETEAction());
        service.unregisterAction(getPASTEAction(part));
        service.unregisterAction(getREDOAction());
        service.unregisterAction(getUNDOAction());
       
        service.setScopes(new String[0]);
    }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

            throw new NullPointerException("part must not be null"); //$NON-NLS-1$
        backwardLock.lock();
        try{
            backwardAction = action;
            backwardAction.setActionDefinitionId("org.eclipse.ui.navigate.back"); //$NON-NLS-1$
            IKeyBindingService service = part.getSite().getKeyBindingService();
            service.registerAction(backwardAction);
        }finally{
            backwardLock.unlock();
        }

    }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

            throw new NullPointerException("part must not be null"); //$NON-NLS-1$
        cutLock.lock();
        try{
            cutAction = action;
            cutAction.setActionDefinitionId("org.eclipse.ui.edit.cut"); //$NON-NLS-1$
            IKeyBindingService service = part.getSite().getKeyBindingService();
            service.registerAction(cutAction);
        }finally{
            cutLock.unlock();
        }
    }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

                copyAction.setActionDefinitionId("org.eclipse.ui.edit.copy"); //$NON-NLS-1$
            }
            if (copyAction instanceof CopyAction) {
                ((CopyAction) copyAction).setPart(part);
            }
            IKeyBindingService service = part.getSite().getKeyBindingService();
            service.registerAction(copyAction);
            return copyAction;
        }finally{
            copyLock.unlock();
        }
    }
View Full Code Here

Examples of org.eclipse.ui.IKeyBindingService

            throw new NullPointerException("part must not be null"); //$NON-NLS-1$
        copyLock.lock();
        try{
            copyAction = action;
            copyAction.setActionDefinitionId("org.eclipse.ui.edit.copy"); //$NON-NLS-1$
            IKeyBindingService service = part.getSite().getKeyBindingService();
            service.registerAction(copyAction);
        }finally{
            copyLock.unlock();
        }
    }
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.