jp.sourceforge.tmdmaker.rcp.ApplicationActionBarAdvisor.java Source code

Java tutorial

Introduction

Here is the source code for jp.sourceforge.tmdmaker.rcp.ApplicationActionBarAdvisor.java

Source

/*
 * Copyright 2009-2013 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package jp.sourceforge.tmdmaker.rcp;

import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.ICoolBarManager;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;

/**
 * 
 * @author nakaG
 * 
 */
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
    /**
     * 
     * @param configurer
     */
    public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
        super(configurer);
    }

    /**
     * 
     * {@inheritDoc}
     * 
     * @see org.eclipse.ui.application.ActionBarAdvisor#makeActions(org.eclipse.ui.IWorkbenchWindow)
     */
    protected void makeActions(IWorkbenchWindow window) {
        register(ActionFactory.DELETE.create(window));
        register(ActionFactory.UNDO.create(window));
        register(ActionFactory.REDO.create(window));
        register(ActionFactory.SAVE.create(window));
        register(ActionFactory.NEW.create(window));
        register(ActionFactory.SAVE_AS.create(window));
        register(ActionFactory.COPY.create(window));
        register(ActionFactory.PASTE.create(window));
    }

    /**
     * 
     * {@inheritDoc}
     * 
     * @see org.eclipse.ui.application.ActionBarAdvisor#fillCoolBar(org.eclipse.jface.action.ICoolBarManager)
     */
    @Override
    protected void fillCoolBar(ICoolBarManager coolBar) {
        super.fillCoolBar(coolBar);
        coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    }
}