/** Build the maximizeButton */ protected void buildMaximizeButton() { maximizeButton = new Button(); titleBar.addWidget(maximizeButton); maximizeButton.addButtonPressedListener( new IButtonPressedListener() { public void buttonPressed(ButtonPressedEvent e) { throw new UnsupportedOperationException("Maximize Window: Not implemented yet"); } }); }
/** Build the closeButton */ protected void buildCloseButton() { closeButton = new Button(); titleBar.addWidget(closeButton); closeButton.setText("X"); closeButton.addButtonPressedListener( new IButtonPressedListener() { public void buttonPressed(ButtonPressedEvent e) { fireWindowClosedEvent(); // close(); } }); closeButton.setTraversable(false); }
/** * Constructs the title bar. * * @param closeBtn flag indicating the existence of a close button * @param maximizeBtn flag indicating the existence of a maximize button * @param minimizeBtn flag indicating the existence of a minimize button */ protected void buildTitleBar(boolean closeBtn, boolean maximizeBtn, boolean minimizeBtn) { titleBar.setLayoutManager(new RowLayout(true)); title = new Label(); titleBar.addWidget(title); title.setText("Frame"); if (minimizeBtn) { buildMinimizeButton(); } if (maximizeBtn) { buildMaximizeButton(); } if (closeBtn) { buildCloseButton(); } }