Package hidb2.gui

Source Code of hidb2.gui.ApplicationWorkbenchWindowAdvisor

/**
* This file is part of HIDB2.
*
* HIDB2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* HIDB2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Lesser Public License for more details.
*
* You should have received a copy of the GNU Lesser Public License
* along with HIDB2.  If not, see <http://www.gnu.org/licenses/>.
*/
package hidb2.gui;

import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;

public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor
  {

  public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer)
    {
    super(configurer);
    }

  public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer)
    {
    return new ApplicationActionBarAdvisor(configurer);
    }

  public void preWindowOpen()
    {
    IWorkbenchWindowConfigurer configurer = getWindowConfigurer();

    Rectangle rscreen = Display.getDefault().getBounds();

    // Taken into account at first RUN
    configurer.setInitialSize(new Point(Math.max(640, rscreen.width), Math.max(480, rscreen.height)));

    configurer.setShowCoolBar(true);
    configurer.setShowStatusLine(true);
    configurer.setTitle("HIDB2");
    }
  }
TOP

Related Classes of hidb2.gui.ApplicationWorkbenchWindowAdvisor

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.