Example usage for com.google.gwt.user.client.ui HorizontalSplitPanel HorizontalSplitPanel

List of usage examples for com.google.gwt.user.client.ui HorizontalSplitPanel HorizontalSplitPanel

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HorizontalSplitPanel HorizontalSplitPanel.

Prototype

public HorizontalSplitPanel() 

Source Link

Usage

From source file:net.s17fabu.vip.gwt.showcase.client.content.panels.CwHorizontalSplitPanel.java

License:Apache License

/**
 * Initialize this example.//  w w  w. j  av a  2 s  .  c o m
 */
@Override
public Widget onInitialize() {
    // Create a Horizontal Split Panel
    HorizontalSplitPanel hSplit = new HorizontalSplitPanel();
    hSplit.ensureDebugId("cwHorizontalSplitPanel");
    hSplit.setSize("500px", "350px");
    hSplit.setSplitPosition("30%");

    // Add some content
    String randomText = constants.cwHorizontalSplitPanelText();
    for (int i = 0; i < 2; i++) {
        randomText += randomText;
    }
    hSplit.setRightWidget(new HTML(randomText));
    hSplit.setLeftWidget(new HTML(randomText));

    // Wrap the split panel in a decorator panel
    DecoratorPanel decPanel = new DecoratorPanel();
    decPanel.setWidget(hSplit);

    // Return the content
    return decPanel;
}

From source file:org.apache.sling.explorer.client.SlingExplorerApplication.java

License:Apache License

private Widget createExplorerPanel() {
    HorizontalSplitPanel explorerPanel = new HorizontalSplitPanel();
    explorerPanel.setSize("100%", "100%");
    explorerPanel.setSplitPosition("20%");

    DisclosurePanel propertiesPanel = new DisclosurePanel(constants.propertiesDescripton(), true);
    propertiesPanel.add(resourceGrid.getPropertyGrid());
    propertiesPanel.setStyleName("application-DisclosurePanel");

    DisclosurePanel nodeChildrenPanel = new DisclosurePanel(constants.subResourcesDescription(), true);
    nodeChildrenPanel.add(resourceGrid.getResourceChildrenGrid());
    nodeChildrenPanel.setStyleName("application-DisclosurePanel");

    propertiesPanel.setAnimationEnabled(true);
    nodeChildrenPanel.setAnimationEnabled(true);

    FlexTable layout = new FlexTable();
    layout.setCellSpacing(6);/*w ww .  j  a  va2s.c  om*/
    layout.setWidget(0, 0, propertiesPanel);
    layout.setWidget(1, 0, nodeChildrenPanel);

    explorerPanel.setRightWidget(layout);
    explorerPanel.setLeftWidget(resourceTree);

    return explorerPanel;
}

From source file:org.freemedsoftware.gwt.client.screen.MainScreen.java

License:Open Source License

public MainScreen() {
    final DockPanel mainPanel = new DockPanel();
    initWidget(mainPanel);//from   w w  w .  jav  a  2 s.  co  m
    mainPanel.setSize("100%", "100%");

    // CurrentState.retrieveUserConfiguration(true);
    CurrentState.retrieveSystemConfiguration(true);

    // populateLeftNavigationPanel();

    JsonUtil.debug("MainScreen: call populateDefaultProvider");
    populateDefaultProvider();

    JsonUtil.debug("MainScreen: call populateDefaultFacility");
    JsonUtil.debug("MainScreen: assign object to CurrentState static object");
    CurrentState.assignMainScreen(this);

    /*
     * Top Header panel to use top header shortcuts e.g logoff,add patient
     * etc
     */

    VerticalPanel topHeaderPanel = new VerticalPanel();
    topHeaderPanel.ensureDebugId("topHeaderPanel");
    topHeaderPanel.setStyleName(AppConstants.STYLE_HEADER_PANEL);
    topHeaderPanel.setWidth("100%");

    Image logoImage = new Image();
    logoImage.setUrl("resources/images/FreemedHeader.jpg");
    logoImage.setSize("100%", "55px");
    topHeaderPanel.add(logoImage);
    topHeaderPanel.setCellHorizontalAlignment(logoImage, HasHorizontalAlignment.ALIGN_CENTER);
    topHeaderPanel.setCellWidth(logoImage, "100%");

    HorizontalPanel topHeaderHorPanel = new HorizontalPanel();
    topHeaderHorPanel.setWidth("100%");

    HorizontalPanel facilityInfoPanel = new HorizontalPanel();
    facilityInfoPanel.setStyleName(AppConstants.STYLE_HEADER_PANEL);

    // adding userInfoPanel at top left
    HorizontalPanel userInfoPanel = new HorizontalPanel();
    userInfoPanel.setStyleName(AppConstants.STYLE_HEADER_PANEL);
    Image userImage = new Image();
    userImage.setUrl("resources/images/user-icon.png");
    userImage.setSize("13px", "100%");
    userInfoPanel.add(userImage);
    userInfoPanel.add(loginUserInfo);// Adding loginuserinfo link
    setLoginUserInfo();
    // Adding UserInfoPanel into top headerhorpanel
    HorizontalPanel hp = new HorizontalPanel();

    Image homeImage = new Image();
    homeImage.setUrl("resources/images/home-icon.png");
    homeImage.setSize("15px", "100%");
    facilityInfoPanel.add(homeImage);
    facilityInfoPanel.add(facilityInfo);

    HTML separator = new HTML("|");
    separator.setWidth("8px");
    separator.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    hp.add(userInfoPanel);
    hp.add(separator);
    hp.add(facilityInfoPanel);
    // Adding UserInfoPanel into top headerhorpanel
    topHeaderHorPanel.add(hp);
    topHeaderHorPanel.setCellHorizontalAlignment(hp, HasHorizontalAlignment.ALIGN_LEFT);
    topHeaderHorPanel.setCellHorizontalAlignment(facilityInfoPanel, HasHorizontalAlignment.ALIGN_LEFT);
    // topHeaderHorPanel.setCellWidth(facilityInfoPanel, "20%");

    // adding shortcuts panel at top right corder

    shortCutsPanel = new HorizontalPanel();

    // Adding shortCutsPanel into top header
    topHeaderHorPanel.add(shortCutsPanel);
    topHeaderHorPanel.setCellHorizontalAlignment(shortCutsPanel, HasHorizontalAlignment.ALIGN_RIGHT);

    // Adding tophorpanel into top topheaderpanel
    topHeaderPanel.add(topHeaderHorPanel);
    topHeaderPanel.setCellWidth(topHeaderHorPanel, "100%");

    // Adding top header to main panel
    mainPanel.add(topHeaderPanel, DockPanel.NORTH);
    mainPanel.setCellWidth(topHeaderPanel, "100%");
    mainPanel.setCellHeight(topHeaderPanel, "3%");

    /*
     * SimplePanel to hold (hopefully) a horizontal sub menu, going to try
     * to use the Menu Bar items to call each sub-menu -JA
     */

    JsonUtil.debug("MainScreen: create accordion panel");

    // Creating Left Navigation area with decorated stack panel
    stackPanel = new AccordionPanel();
    stackPanel.setWidth("100%");
    // stackPanel.setHeight("100%");

    {
        JsonUtil.debug("MainScreen: add main pane");
        mainAccPanel = new VerticalPanel();
        mainAccPanel.setStyleName("accordion-panel");
        mainAccPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        // adding Main Panel(System) into stack panel
        // stackPanel.add(mainAccPanel,
        // getHeaderString(AppConstants.SYSTEM_CATEGORY, null), true);

        JsonUtil.debug("MainScreen: add patient pane");
        patientAccPanel = new VerticalPanel();
        patientAccPanel.setStyleName("accordion-panel");
        patientAccPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        // adding Patient Panel into stack panel
        // stackPanel.add(patientAccPanel,
        // getHeaderString(AppConstants.PATIENT_CATEGORY, null), true);

        JsonUtil.debug("MainScreen: add document pane");
        documentAccPanel = new VerticalPanel();
        documentAccPanel.setStyleName("accordion-panel");
        documentAccPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        // adding Documents Panel into stack panel
        // stackPanel.add(documentAccPanel,
        // getHeaderString(AppConstants.DOCUMENTS_CATEGORY, null), true);
        JsonUtil.debug("MainScreen: add Billing pane");
        billingAccPanel = new VerticalPanel();
        billingAccPanel.setStyleName("accordion-panel");
        billingAccPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        // adding Billing Panel into stack panel
        // stackPanel.add(billingAccPanel,
        // getHeaderString(AppConstants.BILLING_CATEGORY, null), true);

        JsonUtil.debug("MainScreen: add Reporting pane");
        reportingAccPanel = new VerticalPanel();
        reportingAccPanel.setStyleName("accordion-panel");
        reportingAccPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        // adding Reporting Panel into stack panel
        // stackPanel.add(reportingAccPanel,
        // getHeaderString(AppConstants.REPORTING_CATEGORY, null), true);

        JsonUtil.debug("MainScreen: add utilities pane");
        utilitiesAccPanel = new VerticalPanel();
        utilitiesAccPanel.setStyleName("accordion-panel");
        utilitiesAccPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

        // adding Utilities Panel into stack panel
        // stackPanel.add(utilitiesAccPanel,
        // getHeaderString(AppConstants.UTILITIES_CATEGORY, null), true);

        // Disable for now
        // accordionPanel.selectPanel("Main");
    }
    JsonUtil.debug("MainScreen: create container hpanel for accordion and tabs");

    HorizontalPanel menuAndContent = new HorizontalPanel();
    menuAndContent.setSize("100%", "100%");

    // Jam them together, no space.
    menuAndContent.setSpacing(0);
    // menuAndContent.setCellWidth(accordionPanel, "250px");

    JsonUtil.debug("MainScreen: add accordion and tab panel to container");
    menuAndContent.add(stackPanel);
    stackPanel.ensureDebugId("cwStackPanel");

    // defining left navigation area width
    menuAndContent.setCellWidth(stackPanel, "12%");

    JsonUtil.debug("MainScreen: create tabPanel");
    tabPanel = new DecoratedTabPanel();

    tabPanel.setSize("100%", "100%");
    tabPanel.setAnimationEnabled(true);
    menuAndContent.add(tabPanel);
    // defining content area width
    menuAndContent.setCellWidth(tabPanel, "88%");

    menuAndContent.setCellHorizontalAlignment(tabPanel, HasHorizontalAlignment.ALIGN_LEFT);
    JsonUtil.debug("MainScreen: add container to dock panel");
    mainPanel.add(menuAndContent, DockPanel.CENTER);

    JsonUtil.debug("MainScreen: add dashboard panel to tabs and select");
    // tabPanel.add(dashboard, "Dashboard");
    tabPanel.add(dashboardScreenNew, "Dashboard");

    tabPanel.selectTab(0);
    JsonUtil.debug("MainScreen: pass tabPanel to static CurrentState");
    CurrentState.assignTabPanel(tabPanel);

    // Get configuration
    CurrentState.retrieveUserConfiguration(true, new Command() {
        public void execute() {
            JsonUtil.debug("MainScreen: Set State of dashboard");
            dashboardScreenNew.loadWidgets();
            dashboardScreenNew.reloadDashboard();
        }
    });

    // Expand out main tabpanel to take up all extra room
    JsonUtil.debug("MainScreen: expand tabpanel");
    // mainPanel.setCellWidth(tabPanel, "100%");
    // mainPanel.setCellHeight(tabPanel, "100%");

    final HTML poweredByLabel = new HTML(_("Powered By FreeMED&trade;"));
    poweredByLabel.setStyleName(AppConstants.STYLE_LABEL_SMALL);
    mainPanel.add(poweredByLabel, DockPanel.SOUTH);
    mainPanel.setCellHorizontalAlignment(poweredByLabel, HasHorizontalAlignment.ALIGN_CENTER);

    JsonUtil.debug("MainScreen: split panel");
    statusBarContainer = new HorizontalSplitPanel();
    mainPanel.add(statusBarContainer, DockPanel.SOUTH);
    statusBarContainer.setSize("100%", "30px");
    statusBarContainer.setSplitPosition("50%");

    JsonUtil.debug("MainScreen: status bar");
    statusBar1 = new Label(_("Ready"));
    statusBar1.setStyleName("statusBar");
    statusBarContainer.add(statusBar1);
    CurrentState.assignStatusBar(statusBar1);
    statusBar2 = new Label("-");
    statusBar2.setStyleName("statusBar");
    statusBarContainer.add(statusBar2);
    if (Util.isStubbedMode()) {
        statusBar2.setText("STUBBED / TEST MODE");
    }
    populateDefaultFacility();

    // Create notification toaster
    JsonUtil.debug("MainScreen: create toaster");
    if (CurrentState.getToaster() == null) {
        Toaster toaster = new Toaster();
        CurrentState.assignToaster(toaster);
        toaster.setTimeout(7);
    }

    // Handle system notifications
    // notifications.setState(getCurrentState());
    JsonUtil.debug("MainScreen: start notifications");
    notifications.start();

    if (Util.getProgramMode() == ProgramMode.STUBBED)
        initNavigations();

    tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
        @Override
        public void onSelection(SelectionEvent<Integer> arg0) {
            if (tabPanel.getWidget(arg0.getSelectedItem()) instanceof ScreenInterface) {
                ScreenInterface screenInterface = ((ScreenInterface) tabPanel
                        .getWidget(arg0.getSelectedItem()));
                String className = screenInterface.getClass().getName();
                className = className.substring(className.lastIndexOf('.') + 1);
                CurrentState.assignCurrentPageHelp(className);
            }
        }
    });

    // Force showing the screen
    // show();
}