Example usage for com.google.gwt.user.client.ui SplitLayoutPanel addWest

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

Introduction

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

Prototype

public void addWest(Widget widget, double size) 

Source Link

Document

Adds a widget to the west edge of the dock.

Usage

From source file:com.ephesoft.dcma.gwt.foldermanager.client.view.FolderManagementView.java

License:Open Source License

public void setInitialFolderManagementView(FolderManagementController controller, String parentFolderPath,
        String baseFolderUrl, Map<String, String> batchClassesMap) {
    Label footer = new Label();
    folderTableView = new FolderTableView(footer);

    folderTablePresenter = new FolderTablePresenter(controller, folderTableView, parentFolderPath,
            baseFolderUrl);//ww  w. ja va 2  s  .co m

    folderSystemTreeView = new FolderSystemTreeView();

    folderSystemTreePresenter = new FolderSystemTreePresenter(controller, folderSystemTreeView,
            parentFolderPath, footer);

    SplitLayoutPanel mainContentPanel = new SplitLayoutPanel();
    DockLayoutPanel leftLayoutPanel = new DockLayoutPanel(Unit.PCT);
    ScrollPanel treeScrollPanel = new ScrollPanel();
    treeScrollPanel.add(folderSystemTreeView);
    FolderSelectionWidget folderSelectionWidget = new FolderSelectionWidget(batchClassesMap,
            controller.getEventBus());
    leftLayoutPanel.addNorth(folderSelectionWidget, 10);
    leftLayoutPanel.add(treeScrollPanel);
    mainContentPanel.addWest(leftLayoutPanel, 200);
    DockLayoutPanel contentMainPanel = new DockLayoutPanel(Unit.PCT);
    contentMainPanel.add(folderTableView);
    contentMainPanel.addStyleName(FolderManagementConstants.WHITE_BACKGROUND);
    mainContentPanel.add(contentMainPanel);
    mainPanel.add(mainContentPanel);
    ScreenMaskUtility.unmaskScreen();
}

From source file:com.gmail.cjbooms.thesis.pythonappengine.client.PythonAppEngine.java

License:Open Source License

/**
 * This is the entry point method.//from www.  jav  a2s .  co  m
 */
public void onModuleLoad() {

    VerticalPanel menuAndToolBarPanel = new VerticalPanel();
    menuAndToolBarPanel.setWidth("100%");

    // Panel to house the Main Menu
    FlowPanel menuBarPanel = new FlowPanel();
    DOM.setElementAttribute(menuBarPanel.getElement(), "id", "main_menu_panel");
    menuBarPanel.add(new MainMenuWidget());
    menuBarPanel.setHeight("1");

    HTMLPanel titleBar = new HTMLPanel(TITLE);
    DOM.setElementAttribute(titleBar.getElement(), "id", "pa-header");

    menuAndToolBarPanel.add(titleBar);
    menuAndToolBarPanel.add(menuBarPanel);
    menuAndToolBarPanel.add(new Toolbar());

    rootPanel.addNorth(menuAndToolBarPanel, 7);

    // Panel to house a footer containing File Context
    HTML footer = new HTML();
    DOM.setElementAttribute(footer.getElement(), "id", "pa-footer");
    rootPanel.addSouth(footer, 2);

    //Build the Main Work Area Panel and Add to Root
    SplitLayoutPanel mainWorkAreaPanel = new SplitLayoutPanel();
    rootPanel.add(mainWorkAreaPanel);

    FileSystemTreeWidget fileSystemTreeWidget = new FileSystemTreeWidget("Available Projects", editor, footer);
    treeScrollPanel.add(fileSystemTreeWidget);
    mainWorkAreaPanel.addWest(treeScrollPanel, 200);

    //contentScrollPanel.setHeight("100%");

    editor.setWidth("100%");
    editor.setHeight("100%");

    //contentScrollPanel.setWidget(editor);
    mainWorkAreaPanel.add(editor);
    mainWorkAreaPanel.setHeight("100%");

    RootLayoutPanel.get().add(rootPanel);

}

From source file:com.google.gwt.examples.SplitLayoutPanelExample.java

License:Apache License

public void onModuleLoad() {
    // Create a three-pane layout with splitters. 
    SplitLayoutPanel p = new SplitLayoutPanel();
    p.addWest(new HTML("navigation"), 128);
    p.addNorth(new HTML("list"), 384);
    p.add(new HTML("details"));

    // Attach the LayoutPanel to the RootLayoutPanel. The latter will listen for
    // resize events on the window to ensure that its children are informed of
    // possible size changes.
    RootLayoutPanel rp = RootLayoutPanel.get();
    rp.add(p);/*w  ww  .  ja va  2s .  com*/
}

From source file:com.google.gwt.sample.showcase.client.content.panels.CwSplitLayoutPanel.java

License:Apache License

/**
 * Initialize this example.//ww w.  j a  v  a2 s.c o  m
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
    // Create a Split Panel
    SplitLayoutPanel splitPanel = new SplitLayoutPanel(5);
    splitPanel.ensureDebugId("cwSplitLayoutPanel");
    splitPanel.getElement().getStyle().setProperty("border", "3px solid #e7e7e7");

    // Add text all around.
    splitPanel.addNorth(new Label(constants.cwSplitLayoutPanelNorth1()), 50);
    splitPanel.addSouth(new Label(constants.cwSplitLayoutPanelSouth1()), 50);
    splitPanel.addEast(new Label(constants.cwSplitLayoutPanelEast()), 100);
    splitPanel.addWest(new Label(constants.cwSplitLayoutPanelWest()), 100);
    splitPanel.addNorth(new Label(constants.cwSplitLayoutPanelNorth2()), 50);
    splitPanel.addSouth(new Label(constants.cwSplitLayoutPanelSouth2()), 50);

    // Add scrollable text to the center.
    String centerText = constants.cwSplitLayoutPanelCenter();
    for (int i = 0; i < 3; i++) {
        centerText += " " + centerText;
    }
    Label centerLabel = new Label(centerText);
    ScrollPanel centerScrollable = new ScrollPanel(centerLabel);
    splitPanel.add(centerScrollable);

    // Return the content
    return splitPanel;
}

From source file:com.google.gwt.sample.stockwatcher.client.Panels.java

private Widget loadSplitLayoutPanel() {
    SplitLayoutPanel p = new SplitLayoutPanel();
    p.addWest(new HTML("navigation"), 128);
    p.addNorth(new HTML("list"), 384);
    p.add(new HTML(MUSSUM_IPSUM_LITERIS));
    p.setPixelSize(800, 500);/*from w  ww .j ava2 s. c  o  m*/
    return p;
}

From source file:com.mashery.examples.api.client.Examples.java

License:Open Source License

@Override
public void onModuleLoad() {
    DockLayoutPanel mainPanel = new DockLayoutPanel(Unit.PX);
    RootLayoutPanel.get().add(mainPanel);

    DockLayoutPanel headerPanel = new DockLayoutPanel(Unit.PX);
    mainPanel.addNorth(headerPanel, 80d);

    FlexTable rightPanel = new FlexTable();
    headerPanel.addEast(rightPanel, 250d);
    rightPanel.setCellPadding(4);//from w  w w . j a v a2  s  .co  m
    rightPanel.setSize("100%", "100%");
    rightPanel.getCellFormatter().setHeight(0, 0, "100%");
    rightPanel.getCellFormatter().setWidth(1, 0, "100%");
    rightPanel.getCellFormatter().setAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT,
            HasVerticalAlignment.ALIGN_TOP);
    ((FlexTable.FlexCellFormatter) rightPanel.getCellFormatter()).setColSpan(0, 0, 2);

    final FlowPanel userPanel = new FlowPanel();
    rightPanel.setWidget(0, 0, userPanel);

    LoginServiceAsync loginSvc = GWT.create(LoginService.class);
    loginSvc.getUserEmail(new AsyncCallback<String>() {

        @Override
        public void onSuccess(final String email) {
            final Anchor loginLink = new Anchor();
            loginLink.setHref(email == null ? "/examples/login" : "/examples/login?logout=true");
            loginLink.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    String callbackURL = Window.Location.createUrlBuilder().buildString();
                    StringBuilder buf = new StringBuilder("/examples/login?callbackURL=");
                    buf.append(URL.encodeQueryString(callbackURL));
                    if (email != null)
                        buf.append("&logout=true");

                    loginLink.setHref(buf.toString());
                }
            });

            if (email == null) {
                loginLink.setHTML("Sign&nbsp;in");
            } else {
                loginLink.setHTML("Sign&nbsp;out");
                userPanel.add(new InlineLabel(email));
                userPanel.add(new InlineHTML("&nbsp;|&nbsp;"));
            }

            userPanel.add(loginLink);
        }

        @Override
        public void onFailure(Throwable caught) {
            userPanel.add(new Label(caught.getLocalizedMessage()));
        }
    });

    mapWidget = new PopupMapWidget();
    rightPanel.setWidget(1, 1, mapWidget);

    Grid logoPanel = new Grid(1, 2);
    logoPanel.setCellSpacing(8);
    logoPanel.getRowFormatter().setVerticalAlign(0, HasVerticalAlignment.ALIGN_TOP);
    headerPanel.add(logoPanel);

    Image masheryLogoImg = new Image("resources/img/mashery.gif");
    Anchor masheryLink = new Anchor();
    masheryLink.setTitle("Mashery, Inc.");
    masheryLink.setHref("http://developer.mashery.com");
    masheryLink.getElement().appendChild(masheryLogoImg.getElement());
    logoPanel.setWidget(0, 0, masheryLink);

    InlineLabel logoLabel = new InlineLabel("Mashery Examples");
    logoLabel.getElement().getStyle().setFontWeight(FontWeight.BOLD);
    logoLabel.getElement().getStyle().setFontSize(28d, Unit.PT);
    logoLabel.getElement().getStyle().setColor("#c1080a");
    logoPanel.setWidget(0, 1, logoLabel);

    SplitLayoutPanel centerPanel = new SplitLayoutPanel();
    mainPanel.add(centerPanel);

    final StackLayoutPanel examplesPanel = new StackLayoutPanel(Unit.PX);
    centerPanel.addWest(examplesPanel, 200d);

    contentPanel = new DeckPanel();
    centerPanel.add(contentPanel);
    contentPanel.getElement().getStyle().setPaddingLeft(8d, Unit.PX);
    contentPanel.setAnimationEnabled(true);

    addExample(new Example("quova", "Quova") {
        @Override
        public Widget createContent() {
            return new QuovaExample(mapWidget);
        }
    }, examplesPanel);

    addExample(new Example("etsy", "Etsy") {
        @Override
        public Widget createContent() {
            return new EtsyExample(mapWidget);
        }
    }, examplesPanel);

    addExample(new Example("weatherbug", "WeatherBug") {
        @Override
        public Widget createContent() {
            return new WeatherBugExample(mapWidget);
        }
    }, examplesPanel);

    addExample(new Example("hotwire", "Hotwire") {
        @Override
        public Widget createContent() {
            return new HotwireExample(mapWidget);
        }
    }, examplesPanel);

    addExample(new Example("active", "Active") {
        @Override
        public Widget createContent() {
            return new ActiveExample(mapWidget);
        }
    }, examplesPanel);

    String historyToken = History.getToken();
    Integer index = exampleIndex.get(historyToken);
    if (index == null)
        index = 0;

    examplesPanel.showWidget(index);
    showExample(index);

    examplesPanel.addSelectionHandler(new SelectionHandler<Integer>() {
        @Override
        public void onSelection(SelectionEvent<Integer> event) {
            int index = event.getSelectedItem();
            Example example = examples.get(index);
            if (example != null)
                History.newItem(example.getId());
        }
    });

    History.addValueChangeHandler(new ValueChangeHandler<String>() {
        @Override
        public void onValueChange(ValueChangeEvent<String> event) {
            String historyToken = event.getValue();
            Integer index = exampleIndex.get(historyToken);
            if (index != null) {
                examplesPanel.showWidget(index);
                showExample(index);
            }
        }
    });
}

From source file:com.nitrous.gwt.earth.client.demo.MouseListenerDemo.java

License:Apache License

/**
 * The Google earth API has loaded, start the application
 *//*  w ww .  j  a  va  2  s.co m*/
private void onApiLoaded() {
    // the table that will be used to render mouse event information
    table = new CellTable<MouseEventInfo>();
    TextColumn<MouseEventInfo> eventType = new TextColumn<MouseEventInfo>() {
        @Override
        public String getValue(MouseEventInfo object) {
            return object.getEventType();
        }
    };
    eventType.setSortable(false);
    TextColumn<MouseEventInfo> eventDetail = new TextColumn<MouseEventInfo>() {
        @Override
        public String getValue(MouseEventInfo object) {
            KmlMouseEvent event = object.getMouseEvent();
            return "Button=" + event.getButton() + " Latitude=" + event.getLatitude() + " Longitude="
                    + event.getLongitude() + " X=" + event.getClientX() + " Y=" + event.getClientY();
        }
    };
    eventDetail.setSortable(false);
    TextColumn<MouseEventInfo> eventTime = new TextColumn<MouseEventInfo>() {
        @Override
        public String getValue(MouseEventInfo object) {
            return dateTimeFormat.format(object.getTimestamp());
        }
    };
    eventTime.setSortable(false);

    // add the columns
    table.addColumn(eventTime, "Time");
    table.addColumn(eventType, "Type");
    table.addColumn(eventDetail, "Detail");
    table.setWidth("100%");

    // set the data model into the table
    dataProvider = new ListDataProvider<MouseEventInfo>();
    dataProvider.addDataDisplay(table);

    // construct the UI widget
    earth = new GoogleEarthWidget();

    // register a listener to be notified when the earth plug-in has loaded
    earth.addPluginReadyListener(new GEPluginReadyListener() {
        public void pluginReady(GEPlugin ge) {
            // show map content once the plugin has loaded
            loadMapContent();
        }

        public void pluginInitFailure() {
            // failure!
            Window.alert("Failed to initialize Google Earth Plug-in");
        }
    });

    scrollPanel = new ScrollPanel();
    scrollPanel.setHeight("100%");
    scrollPanel.add(table);

    HorizontalPanel header = new HorizontalPanel();
    header.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    mouseLocation = new HTML("");
    header.add(mouseLocation);

    SplitLayoutPanel split = new SplitLayoutPanel();
    split.addWest(scrollPanel, 450);
    split.add(earth);

    DockLayoutPanel dockLayout = new DockLayoutPanel(Unit.PX);
    dockLayout.addNorth(header, 30D);
    dockLayout.add(split);
    RootLayoutPanel.get().add(dockLayout);

    // begin loading the Google Earth Plug-in
    earth.init();
}

From source file:eml.studio.client.mvp.view.MonitorView.java

License:Open Source License

@Override
public Widget createMainLayout() {
    SplitLayoutPanel splitLayout = new SplitLayoutPanel();

    StackLayoutPanel stack = new StackLayoutPanel(Unit.EM);
    stack.setStyleName("sp");
    ScrollPanel leftcrp = new ScrollPanel();
    leftcrp.setSize("100%", "100%");
    VerticalPanel vPanel = new VerticalPanel();
    vPanel.setWidth("100%");

    programTree = ProgramTreeLoader.load(AppController.email);
    datasetTree = DatasetTreeLoader.load(AppController.email);
    jobTree = JobTreeLoader.load(AppController.email);
    resultTree = new SearchTree();
    initTabPanel();// w  ww. ja v  a 2  s  . c  o  m
    DisclosurePanel distackleft = new DisclosureStackPanel("Search").asWidget();
    searchGrid = new SearchGrid(programTree, datasetTree, jobTree, resultTree);
    distackleft.setContent(searchGrid);
    SimplePanel tabSimPanel = new SimplePanel();
    tabSimPanel.add(tabPanel);

    vPanel.add(tabSimPanel);
    vPanel.add(distackleft);
    leftcrp.add(vPanel);
    stack.add(leftcrp, "", 0);

    StackLayoutPanel stackright = new StackLayoutPanel(Unit.EM);
    stackright.setStyleName("sp");
    DisclosurePanel distackright1 = new DisclosureStackPanel(Constants.studioUIMsg.jobPanelTitle()).asWidget();
    DisclosurePanel distackright2 = new DisclosureStackPanel(Constants.studioUIMsg.modulePanelTitle())
            .asWidget();
    ScrollPanel scvp = new ScrollPanel();
    VerticalPanel verticalPanel = new VerticalPanel();
    verticalPanel.setWidth("100%");

    HorizontalPanel btnPanel = new HorizontalPanel();
    historyBtn.removeStyleName("gwt-Button");
    historyBtn.addStyleName("history-button-style");
    submitBtn.setEnabled(false);
    submitBtn.removeStyleName("gwt-Button");
    submitBtn.addStyleName("button-style");
    clearBtn.removeStyleName("gwt-Button");
    clearBtn.addStyleName("button-style");
    cloneBtn.removeStyleName("gwt-Button");
    cloneBtn.addStyleName("button-style");
    refreshBtn.removeStyleName("gwt-Button");
    refreshBtn.addStyleName("button-style");
    stopBtn.removeStyleName("gwt-Button");
    stopBtn.addStyleName("button-style");

    btnPanel.add(historyBtn);
    btnPanel.add(new HTML("&nbsp;&nbsp;"));
    btnPanel.add(submitBtn);
    btnPanel.add(new HTML("&nbsp;&nbsp;"));
    btnPanel.add(clearBtn);
    btnPanel.add(new HTML("&nbsp;&nbsp;"));
    btnPanel.add(cloneBtn);
    btnPanel.add(new HTML("&nbsp;&nbsp;"));
    btnPanel.add(stopBtn);
    btnPanel.add(new HTML("&nbsp;&nbsp;"));
    btnPanel.add(refreshBtn);

    btnPanel2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    btnPanel2.add(btnPanel);
    btnPanel2.addStyleName("btnPanel");

    splitLayout.addWest(stack, 200);

    jobDescGrid = new MonitorJobDescGrid();

    distackright1.setContent(jobDescGrid);
    distackright2.setContent(propPanel);
    verticalPanel.add(distackright1);
    verticalPanel.add(distackright2);
    scvp.add(verticalPanel);
    stackright.add(scvp, "", 0);
    splitLayout.addEast(stackright, 287);

    // Use different controllers in different classes
    setController(new MonitorController(Constants.CONTROLLER_WIDTH, Constants.CONTROLLER_HEIGHT));
    rebuiltLayoutPanel(getController());
    splitLayout.add(layoutPanel);

    return splitLayout;
}

From source file:org.apache.luke.client.LukeInspector.java

License:Apache License

public void onModuleLoad() {
    final RootPanel rootPanel = RootPanel.get();

    CaptionPanel cptnpnlNewPanel = new CaptionPanel("New panel");
    cptnpnlNewPanel.setCaptionHTML("Luke version 5.0");
    rootPanel.add(cptnpnlNewPanel, 10, 10);
    cptnpnlNewPanel.setSize("959px", "652px");

    TabPanel tabPanel = new TabPanel();
    cptnpnlNewPanel.setContentWidget(tabPanel);
    tabPanel.setSize("5cm", "636px");

    //LuceneIndexLoader.loadIndex(pName, this);

    SplitLayoutPanel splitLayoutPanel = new SplitLayoutPanel();
    tabPanel.add(splitLayoutPanel, "Index overview", false);
    tabPanel.setVisible(true);//from   ww  w  .j  av  a  2 s  .  com
    splitLayoutPanel.setSize("652px", "590px");

    SplitLayoutPanel splitLayoutPanel_1 = new SplitLayoutPanel();
    splitLayoutPanel.addNorth(splitLayoutPanel_1, 288.0);

    Label lblIndexStatistics = new Label("Index statistics");
    lblIndexStatistics.setDirectionEstimator(true);
    lblIndexStatistics.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    splitLayoutPanel_1.addNorth(lblIndexStatistics, 26.0);

    VerticalPanel verticalPanel = new VerticalPanel();
    splitLayoutPanel_1.addWest(verticalPanel, 125.0);

    Label lblTest = new Label("Index name:");
    verticalPanel.add(lblTest);
    lblTest.setWidth("109px");

    Label lblTest_1 = new Label("# fields:");
    verticalPanel.add(lblTest_1);

    Label lblNumber = new Label("# documents:");
    verticalPanel.add(lblNumber);
    lblNumber.setWidth("101px");

    Label lblTerms = new Label("# terms:");
    verticalPanel.add(lblTerms);

    Label lblHasDeletions = new Label("Has deletions?");
    verticalPanel.add(lblHasDeletions);

    Label lblNewLabel = new Label("Optimised?");
    verticalPanel.add(lblNewLabel);

    Label lblIndexVersion = new Label("Index version:");
    verticalPanel.add(lblIndexVersion);

    SplitLayoutPanel splitLayoutPanel_2 = new SplitLayoutPanel();
    splitLayoutPanel.addWest(splitLayoutPanel_2, 240.0);

    // Create name column.
    TextColumn<Field> nameColumn = new TextColumn<Field>() {
        @Override
        public String getValue(Field field) {
            return field.getName();
        }
    };

    // Make the name column sortable.
    nameColumn.setSortable(true);

    // Create termCount column.
    TextColumn<Field> termCountColumn = new TextColumn<Field>() {
        @Override
        public String getValue(Field contact) {
            return contact.getTermCount();
        }
    };

    // Create decoder column.
    TextColumn<Field> decoderColumn = new TextColumn<Field>() {
        @Override
        public String getValue(Field contact) {
            return contact.getDecoder();
        }
    };

    final CellTable<Field> cellTable = new CellTable<Field>();

    cellTable.addColumn(nameColumn, "Name");
    cellTable.addColumn(termCountColumn, "Term count");
    cellTable.addColumn(decoderColumn, "Decoder");

    cellTable.setRowCount(FieldsDummyData.Fields.size(), true);
    // Set the range to display. In this case, our visible range is smaller than
    // the data set.
    cellTable.setVisibleRange(0, 3);

    // Create a data provider.
    AsyncDataProvider<Field> dataProvider = new AsyncDataProvider<Field>() {
        @Override
        protected void onRangeChanged(HasData<Field> display) {
            final Range range = display.getVisibleRange();

            // Get the ColumnSortInfo from the table.
            final ColumnSortList sortList = cellTable.getColumnSortList();

            // This timer is here to illustrate the asynchronous nature of this data
            // provider. In practice, you would use an asynchronous RPC call to
            // request data in the specified range.
            new Timer() {
                @Override
                public void run() {
                    int start = range.getStart();
                    int end = start + range.getLength();
                    // This sorting code is here so the example works. In practice, you
                    // would sort on the server.
                    Collections.sort(FieldsDummyData.Fields, new Comparator<Field>() {
                        public int compare(Field o1, Field o2) {
                            if (o1 == o2) {
                                return 0;
                            }

                            // Compare the name columns.
                            int diff = -1;
                            if (o1 != null) {
                                diff = (o2 != null) ? o1.getName().compareTo(o2.getName()) : 1;
                            }
                            return sortList.get(0).isAscending() ? diff : -diff;
                        }
                    });
                    List<Field> dataInRange = FieldsDummyData.Fields.subList(start, end);

                    // Push the data back into the list.
                    cellTable.setRowData(start, dataInRange);
                }
            }.schedule(2000);
        }
    };

    // Connect the list to the data provider.
    dataProvider.addDataDisplay(cellTable);

    // Add a ColumnSortEvent.AsyncHandler to connect sorting to the
    // AsyncDataPRrovider.
    AsyncHandler columnSortHandler = new AsyncHandler(cellTable);
    cellTable.addColumnSortHandler(columnSortHandler);

    // We know that the data is sorted alphabetically by default.
    cellTable.getColumnSortList().push(nameColumn);

    splitLayoutPanel_2.add(cellTable);

    SplitLayoutPanel splitLayoutPanel_3 = new SplitLayoutPanel();
    splitLayoutPanel.addEast(splitLayoutPanel_3, 215.0);

    StackPanel stackPanel = new StackPanel();
    rootPanel.add(stackPanel, 714, 184);
    stackPanel.setSize("259px", "239px");

    FlowPanel flowPanel = new FlowPanel();
    stackPanel.add(flowPanel, "Open index", false);
    flowPanel.setSize("100%", "100%");

    TextBox textBox = new TextBox();
    flowPanel.add(textBox);

    Button btnNewButton = new Button("...");
    btnNewButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            DirectoryLister directoryLister = new DirectoryLister();
            directoryLister.setPopupPosition(rootPanel.getAbsoluteLeft() + rootPanel.getOffsetWidth() / 2,
                    rootPanel.getAbsoluteTop() + rootPanel.getOffsetHeight() / 2);
            directoryLister.show();

        }
    });
    flowPanel.add(btnNewButton);

    // exception handling
    // credits: http://code.google.com/p/mgwt/source/browse/src/main/java/com/googlecode/mgwt/examples/showcase/client/ShowCaseEntryPoint.java?repo=showcase
    GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {

        @Override
        public void onUncaughtException(Throwable e) {
            Window.alert("uncaught: " + e.getMessage());
            String s = buildStackTrace(e, "RuntimeExceotion:\n");
            Window.alert(s);
            e.printStackTrace();

        }
    });

}

From source file:org.apache.oozie.tools.workflowgenerator.client.OozieWorkflowGenerator.java

License:Apache License

/**
 * onModuleLoad is the entry point method.
 *//*from   w ww  .j a va  2  s. c  o  m*/
@SuppressWarnings("deprecation")
public void onModuleLoad() {

    widgets = new ArrayList<NodeWidget>();
    nodeCount = new EnumMap<OozieWorkflowGenerator.NodeType, Integer>(NodeType.class);

    // start DiagramController (gwt-links library)
    controller = new OozieDiagramController(1300, 600);
    //controller.showGrid(true); // Display a background grid

    // start PickUpDragContoller (gwt-Drag-and-Drop library)
    dragController = new PickupDragController(controller.getView(), true);

    // register the dragController in GWT-Links
    controller.registerDragController(dragController);

    // panel for Property Table
    propPanel = new AbsolutePanel();

    // stack Layout for left-side tree-view
    StackLayoutPanel stack = new StackLayoutPanel(Unit.EM);

    // create left tree-view panel
    stack.add(initNodeTree(), new HTML("Nodes"), 2);
    stack.add(initWrkflowTree(), new HTML("Workflow"), 2);

    initWidget();

    // Create a three-pane layout with splitters.
    SplitLayoutPanel p = new SplitLayoutPanel();

    Panel east = new AbsolutePanel();

    // Create a top panel under menu to hold button (e.g, generate xml)
    AbsolutePanel btnpanl = new AbsolutePanel();
    Button btn = createXMLButton();
    btnpanl.add(btn);

    // p.addNorth(initMenu(), 30);
    // p.addEast(east, 250);

    p.addSouth(propPanel, 300);
    p.addWest(stack, 150);
    p.addSouth(btnpanl, 30);
    //((OozieDiagramController) controller).setXmlPanel(east);
    p.add(controller.getView());

    // Attach the LayoutPanel to the RootLayoutPanel.
    RootLayoutPanel rp = RootLayoutPanel.get();
    rp.add(p);

}