applicationwindow_coolbar.jvt

来自「SWT_designer安装软件」· JVT 代码 · 共 115 行

JVT
115
字号
import
org.eclipse.jface.action.MenuManager
org.eclipse.jface.action.StatusLineManager
org.eclipse.jface.action.CoolBarManager
org.eclipse.jface.window.ApplicationWindow
org.eclipse.swt.SWT
org.eclipse.swt.graphics.Point
org.eclipse.swt.widgets.Composite
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Display
org.eclipse.swt.widgets.Shell

method
	/**
	 * Create the application window
	 */
	public %TypeName% () {
		super(null);
		createActions();
		addCoolBar(SWT.FLAT);
		addMenuBar();
		addStatusLine();
	}

method
	/**
	 * Create contents of the application window
	 * @param parent
	 */
	@Override
	protected Control createContents(Composite parent) {
		Composite container = new Composite(parent, SWT.NONE);
		%SWTContainerLayout%
		return container;
	}

method
	/**
	 * Create the actions
	 */
	private void createActions() {
		// Create the actions
	}

method
	/**
	 * Create the menu manager
	 * @return the menu manager
	 */
	@Override
	protected MenuManager createMenuManager() {
		MenuManager menuManager = new MenuManager("menu");
		return menuManager;
	}

method
	/**
	 * Create the coolbar manager
	 * @return the coolbar manager
	 */
	@Override
	protected CoolBarManager createCoolBarManager(int style) {
		CoolBarManager coolBarManager = new CoolBarManager(style);
		return coolBarManager;
	}

method
	/**
	 * Create the status line manager
	 * @return the status line manager
	 */
	@Override
	protected StatusLineManager createStatusLineManager() {
		StatusLineManager statusLineManager = new StatusLineManager();
		statusLineManager.setMessage(null, "");
		return statusLineManager;
	}

method
	/**
	 * Launch the application
	 * @param args
	 */
	public static void main(String args[]) {
		try {
			%TypeName% window = new %TypeName%();
			window.setBlockOnOpen(true);
			window.open();
			Display.getCurrent().dispose();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

method
	/**
	 * Configure the shell
	 * @param newShell
	 */
	@Override
	protected void configureShell(Shell newShell) {
		super.configureShell(newShell);
		newShell.setText("New Application");
	}

method
	/**
	 * Return the initial size of the window
	 */
	@Override
    protected Point getInitialSize() {
        return new Point(%DefaultFormSize%);
    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?