Search in sources :

Example 1 with CollapseAllAction

use of org.eclipse.ui.internal.navigator.actions.CollapseAllAction in project polymap4-core by Polymap4.

the class CommonNavigatorActionGroup method makeActions.

/**
 */
private void makeActions() {
    FrameList frameList = commonViewer.getFrameList();
    backAction = new BackAction(frameList);
    forwardAction = new ForwardAction(frameList);
    upAction = new UpAction(frameList);
    frameList.addPropertyChangeListener(new IPropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent event) {
            if (event.getProperty().equals(FrameList.P_RESET)) {
                upAction.setEnabled(false);
                backAction.setEnabled(false);
                forwardAction.setEnabled(false);
            }
            commonNavigator.updateTitle();
            IActionBars actionBars = commonNavigator.getViewSite().getActionBars();
            updateToolBar(actionBars.getToolBarManager());
        }
    });
    IHandlerService service = (IHandlerService) commonNavigator.getSite().getService(IHandlerService.class);
    INavigatorViewerDescriptor viewerDescriptor = commonViewer.getNavigatorContentService().getViewerDescriptor();
    boolean hideLinkWithEditorAction = viewerDescriptor.getBooleanConfigProperty(INavigatorViewerDescriptor.PROP_HIDE_LINK_WITH_EDITOR_ACTION);
    if (!hideLinkWithEditorAction) {
        toggleLinkingAction = new LinkEditorAction(commonNavigator, commonViewer, linkHelperService);
        // $NON-NLS-1$
        ImageDescriptor syncIcon = getImageDescriptor("elcl16/synced.gif");
        toggleLinkingAction.setImageDescriptor(syncIcon);
        toggleLinkingAction.setHoverImageDescriptor(syncIcon);
        service.activateHandler(toggleLinkingAction.getActionDefinitionId(), new ActionHandler(toggleLinkingAction));
    }
    boolean hideCollapseAllAction = viewerDescriptor.getBooleanConfigProperty(INavigatorViewerDescriptor.PROP_HIDE_COLLAPSE_ALL_ACTION);
    if (!hideCollapseAllAction) {
        collapseAllAction = new CollapseAllAction(commonViewer);
        // $NON-NLS-1$
        ImageDescriptor collapseAllIcon = getImageDescriptor("elcl16/collapseall.gif");
        collapseAllAction.setImageDescriptor(collapseAllIcon);
        collapseAllAction.setHoverImageDescriptor(collapseAllIcon);
        collapseAllHandler = new CollapseAllHandler(commonViewer);
        service.activateHandler(CollapseAllHandler.COMMAND_ID, collapseAllHandler);
    }
    filterGroup = new FilterActionGroup(commonViewer);
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent) UpAction(org.eclipse.ui.internal.navigator.framelist.UpAction) FrameList(org.eclipse.ui.internal.navigator.framelist.FrameList) CollapseAllHandler(org.eclipse.ui.handlers.CollapseAllHandler) LinkEditorAction(org.eclipse.ui.internal.navigator.actions.LinkEditorAction) INavigatorViewerDescriptor(org.eclipse.ui.navigator.INavigatorViewerDescriptor) FilterActionGroup(org.eclipse.ui.internal.navigator.filters.FilterActionGroup) IHandlerService(org.eclipse.ui.handlers.IHandlerService) CollapseAllAction(org.eclipse.ui.internal.navigator.actions.CollapseAllAction) ForwardAction(org.eclipse.ui.internal.navigator.framelist.ForwardAction) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) BackAction(org.eclipse.ui.internal.navigator.framelist.BackAction) ActionHandler(org.eclipse.jface.commands.ActionHandler) IActionBars(org.eclipse.ui.IActionBars)

Aggregations

ActionHandler (org.eclipse.jface.commands.ActionHandler)1 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)1 IPropertyChangeListener (org.eclipse.jface.util.IPropertyChangeListener)1 PropertyChangeEvent (org.eclipse.jface.util.PropertyChangeEvent)1 IActionBars (org.eclipse.ui.IActionBars)1 CollapseAllHandler (org.eclipse.ui.handlers.CollapseAllHandler)1 IHandlerService (org.eclipse.ui.handlers.IHandlerService)1 CollapseAllAction (org.eclipse.ui.internal.navigator.actions.CollapseAllAction)1 LinkEditorAction (org.eclipse.ui.internal.navigator.actions.LinkEditorAction)1 FilterActionGroup (org.eclipse.ui.internal.navigator.filters.FilterActionGroup)1 BackAction (org.eclipse.ui.internal.navigator.framelist.BackAction)1 ForwardAction (org.eclipse.ui.internal.navigator.framelist.ForwardAction)1 FrameList (org.eclipse.ui.internal.navigator.framelist.FrameList)1 UpAction (org.eclipse.ui.internal.navigator.framelist.UpAction)1 INavigatorViewerDescriptor (org.eclipse.ui.navigator.INavigatorViewerDescriptor)1