com.google.gwt.user.client.ui.DockLayoutPanel Java Examples

The following examples show how to use com.google.gwt.user.client.ui.DockLayoutPanel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebClient.java    From swellrt with Apache License 2.0 6 votes vote down vote up
private void setupUi() {
  // Set up UI
  DockLayoutPanel self = BINDER.createAndBindUi(this);
  RootPanel.get("app").add(self);
  // DockLayoutPanel forcibly conflicts with sensible layout control, and
  // sticks inline styles on elements without permission. They must be
  // cleared.
  self.getElement().getStyle().clearPosition();
  splitPanel.setWidgetMinSize(searchPanel, 300);
  AttachmentManagerProvider.init(AttachmentManagerImpl.getInstance());

  if (LogLevel.showDebug()) {
    logPanel.enable();
  } else {
    logPanel.removeFromParent();
  }

  setupSearchPanel();
  setupWavePanel();

  FocusManager.init();
}
 
Example #2
Source File: WebClient.java    From incubator-retired-wave with Apache License 2.0 6 votes vote down vote up
private void setupUi() {
  // Set up UI
  DockLayoutPanel self = BINDER.createAndBindUi(this);
  RootPanel.get("app").add(self);
  // DockLayoutPanel forcibly conflicts with sensible layout control, and
  // sticks inline styles on elements without permission. They must be
  // cleared.
  self.getElement().getStyle().clearPosition();
  splitPanel.setWidgetMinSize(searchPanel, 300);
  AttachmentManagerProvider.init(AttachmentManagerImpl.getInstance());

  if (LogLevel.showDebug()) {
    logPanel.enable();
  } else {
    logPanel.removeFromParent();
  }

  setupSearchPanel();
  setupWavePanel();

  FocusManager.init();
}
 
Example #3
Source File: GwtMockitoWidgetBaseClassesTest.java    From gwtmockito with Apache License 2.0 6 votes vote down vote up
@Test
public void testPanels() throws Exception {
  invokeAllAccessibleMethods(new AbsolutePanel() {});
  invokeAllAccessibleMethods(new CellPanel() {});
  invokeAllAccessibleMethods(new ComplexPanel() {});
  invokeAllAccessibleMethods(new DeckLayoutPanel() {});
  invokeAllAccessibleMethods(new DeckPanel() {});
  invokeAllAccessibleMethods(new DecoratorPanel() {});
  invokeAllAccessibleMethods(new DockLayoutPanel(Unit.PX) {});
  invokeAllAccessibleMethods(new DockPanel() {});
  invokeAllAccessibleMethods(new FlowPanel() {});
  invokeAllAccessibleMethods(new FocusPanel() {});
  invokeAllAccessibleMethods(new HorizontalPanel() {});
  invokeAllAccessibleMethods(new HTMLPanel("") {});
  invokeAllAccessibleMethods(new LayoutPanel() {});
  invokeAllAccessibleMethods(new PopupPanel() {});
  invokeAllAccessibleMethods(new RenderablePanel("") {});
  invokeAllAccessibleMethods(new ResizeLayoutPanel() {});
  invokeAllAccessibleMethods(new SimpleLayoutPanel() {});
  invokeAllAccessibleMethods(new SimplePanel() {});
  invokeAllAccessibleMethods(new SplitLayoutPanel() {});
  invokeAllAccessibleMethods(new StackPanel() {});
  invokeAllAccessibleMethods(new VerticalPanel() {});
}
 
Example #4
Source File: ExtendedDockPanel.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Extended dock panel
 */
public ExtendedDockPanel() {	    
    
	dockPanel = new DockLayoutPanel(Unit.PX);
	folderSelectPopup = new FolderSelectPopup();
	enableKeyShorcuts();

	// Object initialization
	topPanel = new TopPanel();
	leftBorderPanel = new VerticalBorderPanel();
	rightBorderPanel = new VerticalBorderPanel();
	bottomPanel = new BottomPanel();

	// Desktop panels initialization
	desktop = new Desktop();

	// Search panels initialization
	search = new Search();

	// Dashboard panel initialization
	dashboard = new Dashboard();

	// Administration panel initialization
	administration = new Administration();

	// set inner component's size
	setWidgetsSize();

	actualView = UIDockPanelConstants.DESKTOP;

	// Creates the dockPanel
	dockPanel.addNorth(topPanel, TopPanel.PANEL_HEIGHT);
	dockPanel.addSouth(bottomPanel, BottomPanel.PANEL_HEIGHT);
	dockPanel.addWest(leftBorderPanel, VERTICAL_BORDER_PANEL_WIDTH);
	dockPanel.addEast(rightBorderPanel, VERTICAL_BORDER_PANEL_WIDTH);
	dockPanel.add(desktop);

	Window.addResizeHandler(new ResizeHandler() {
		@Override
		public void onResize(ResizeEvent event) {
			setWidgetsSize();
			Main.get().mainPanel.topPanel.toolBar.windowResized(); // splitter changes
		}
	});

	initWidget(dockPanel);
}
 
Example #5
Source File: GwtMockitoTestRunner.java    From gwtmockito with Apache License 2.0 4 votes vote down vote up
/**
 * Returns a collection of classes whose non-abstract methods should always be replaced with
 * no-ops. By default, this list includes {@link Composite}, {@link DOM} {@link UIObject},
 * {@link Widget}, {@link Image}, and most subclasses of {@link Panel}. It will also include any
 * classes specified via the {@link WithClassesToStub} annotation on the test class. This makes
 * it much safer to test code that uses or extends these types.
 * <p>
 * This list can be customized via {@link WithClassesToStub} or by defining a new test runner
 * extending {@link GwtMockitoTestRunner} and overriding this method. This allows users to
 * explicitly stub out particular classes that are causing problems in tests. If you override this
 * method, you will probably want to retain the classes that are stubbed here by doing something
 * like this:
 *
 * <pre>
 * &#064;Override
 * protected Collection&lt;Class&lt;?&gt;&gt; getClassesToStub() {
 *   Collection&lt;Class&lt;?&gt;&gt; classes = super.getClassesToStub();
 *   classes.add(MyBaseWidget.class);
 *   return classes;
 * }
 * </pre>
 *
 * @return a collection of classes whose methods should be stubbed with no-ops while running tests
 */
protected Collection<Class<?>> getClassesToStub() {
  Collection<Class<?>> classes = new LinkedList<Class<?>>();
  classes.add(Composite.class);
  classes.add(DOM.class);
  classes.add(UIObject.class);
  classes.add(Widget.class);

  classes.add(DataGrid.class);
  classes.add(HTMLTable.class);
  classes.add(Image.class);

  classes.add(AbsolutePanel.class);
  classes.add(CellList.class);
  classes.add(CellPanel.class);
  classes.add(CellTable.class);
  classes.add(ComplexPanel.class);
  classes.add(DeckLayoutPanel.class);
  classes.add(DeckPanel.class);
  classes.add(DecoratorPanel.class);
  classes.add(DockLayoutPanel.class);
  classes.add(DockPanel.class);
  classes.add(FlowPanel.class);
  classes.add(FocusPanel.class);
  classes.add(HorizontalPanel.class);
  classes.add(HTMLPanel.class);
  classes.add(LayoutPanel.class);
  classes.add(Panel.class);
  classes.add(PopupPanel.class);
  classes.add(RenderablePanel.class);
  classes.add(ResizeLayoutPanel.class);
  classes.add(SimpleLayoutPanel.class);
  classes.add(SimplePanel.class);
  classes.add(SplitLayoutPanel.class);
  classes.add(StackPanel.class);
  classes.add(VerticalPanel.class);
  classes.add(ValueListBox.class);

  WithClassesToStub annotation = unitTestClass.getAnnotation(WithClassesToStub.class);
  if (annotation != null) {
    classes.addAll(Arrays.asList(annotation.value()));
  }

  return classes;
}
 
Example #6
Source File: MainLayoutViewImpl.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Inject
public MainLayoutViewImpl(final Header header, Footer footer, MessageCenter messageCenter, PlaceManager placeManager) {

    this.messageCenter = messageCenter;
    this.header = header;
    this.placeManager = placeManager;

    mainContentPanel = new LayoutPanel();
    mainContentPanel.setStyleName("main-content-panel");
    mainContentPanel.addStyleName("animated");

    // see http://www.w3.org/TR/wai-aria/states_and_properties#aria-live
    mainContentPanel.getElement().setAttribute("role", "region");
    mainContentPanel.getElement().setAttribute("aria-live", "polite");
    mainContentPanel.getElement().setId("main-content-area");

    headerPanel = new LayoutPanel();
    headerPanel.setStyleName("header-panel");
    headerPanel.getElement().setId("header");

    footerPanel = new LayoutPanel();
    footerPanel.setStyleName("footer-panel");
    footerPanel.getElement().setId("footer");

    panel = new DockLayoutPanel(Style.Unit.PX);
    panel.getElement().setAttribute("id", "container");

    panel.addNorth(headerPanel, 80);
    panel.addSouth(footerPanel, 42);
    panel.add(mainContentPanel);

    getHeaderPanel().add(header.asWidget());
    getFooterPanel().add(footer.asWidget());

    // the application window
    window = new DefaultWindow("");
   // window.addStyleName("animated");

    window.addCloseHandler(new CloseHandler<PopupPanel>() {
        @Override
        public void onClose(CloseEvent<PopupPanel> event) {

            Console.getPlaceManager().revealRelativePlace(-1);
            // clearing the slot:
            // this is necessary to signal GWTP that the slot is not used
            // without subsequent attempts to reveal the same place twice would not succeed
            Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                @Override
                public void execute() {
                    presenter.clearSlot(MainLayoutPresenter.TYPE_Popup);
                }
            });

           /* window.removeStyleName(ACTIVE_CSS);
            window.addStyleName(INACTIVE_CSS);*/
        }
    });

    window.setWidth(640);
    window.setHeight(480);
    window.setAutoHideOnHistoryEventsEnabled(true);
    //window.setGlassStyleName("application-panel-glass");
    window.setGlassEnabled(true);
}
 
Example #7
Source File: MonitorView.java    From EasyML with Apache License 2.0 3 votes vote down vote up
@Override
public Widget asWidget() {

	DockLayoutPanel dockLayout = new DockLayoutPanel(Unit.PX);

	dockLayout.addNorth(headerView, 35);
	dockLayout.add(mainLayout);

	return dockLayout;
}