Example usage for com.google.gwt.user.client.ui HorizontalPanel add

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

Introduction

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

Prototype

@Override
    public void add(Widget w) 

Source Link

Usage

From source file:at.ait.dme.yuma.suite.apps.map.client.georeferencing.ControlPointEditForm.java

License:EUPL

public ControlPointEditForm(AnnotationPanel panel, AnnotationTreeNode annotation,
        ControlPointLayer controlPointLayer) {
    super(panel, annotation, null);

    // Reference to control point layer
    this.controlPointLayer = controlPointLayer;

    // Place name (will be geo-coded)
    HorizontalPanel placeNamePanel = new HorizontalPanel();

    Label placeNameLabel = new Label("Place: ");
    placeNameLabel.setStyleName("cp-Editor-Label");
    placeNamePanel.add(placeNameLabel);

    placeName = new TextBox();
    placeName.setStyleName("cp-Editor-Field");
    placeName.addKeyDownHandler(new AbstractKeyboardHandler(1000) {
        @Override//from   w  w  w.j  av a2 s . c  om
        public void onSpace() {
            doAsyncGeocoding(placeName.getText());
        }

        @Override
        public void onIdle() {
            doAsyncGeocoding(placeName.getText());
        }
    });

    placeNamePanel.add(placeName);

    // Lon (determined automatically - field disabled)
    HorizontalPanel lonPanel = new HorizontalPanel();

    Label lonLabel = new Label("Lon: ");
    lonLabel.setStyleName("cp-Editor-Label");
    lonPanel.add(lonLabel);

    lon = new TextBox();
    lon.setEnabled(false);
    lon.setStyleName("cp-Editor-Field");
    lonPanel.add(lon);

    // Lat (determined automatically - field disabled)
    HorizontalPanel latPanel = new HorizontalPanel();

    Label latLabel = new Label("Lat: ");
    latLabel.setStyleName("cp-Editor-Label");
    latPanel.add(latLabel);

    lat = new TextBox();
    lat.setEnabled(false);
    lat.setStyleName("cp-Editor-Field");
    latPanel.add(lat);

    // X/Y (determined automatically - field disabled)
    HorizontalPanel xyPanel = new HorizontalPanel();

    Label xyLabel = new Label("X/Y: ");
    xyLabel.setStyleName("cp-Editor-Label");
    xyPanel.add(xyLabel);

    xy = new TextBox();
    xy.setEnabled(false);
    xy.setStyleName("cp-Editor-Field");
    xyPanel.add(xy);

    if (annotation != null) {
        placeName.setText(annotation.getTitle());
        GeoPoint p = (GeoPoint) ((ImageFragment) annotation.getAnnotation().getFragment()).getShape();
        lon.setText(Double.toString(p.getLng()));
        lat.setText(Double.toString(p.getLat()));
        setXY(p.getX(), p.getY());
    }

    // Assemble the main FlowPanel
    FlowPanel form = new FlowPanel();
    form.setStyleName("cp-Editor");
    form.add(placeNamePanel);
    form.add(lonPanel);
    form.add(latPanel);
    form.add(xyPanel);
    form.add(createButtonsPanel(panel, annotation));
    form.setStyleName("imageAnnotation-form");
    initWidget(form);

    controlPointLayer.setControlPointForm(this);
    if (annotation != null) {
        controlPointLayer.showActiveFragmentPanel((ImageAnnotation) annotation.getAnnotation(), false);
    } else {
        controlPointLayer.showActiveFragmentPanel(null, false);
    }
}

From source file:at.ait.dme.yuma.suite.apps.map.client.georeferencing.ControlPointEditForm.java

License:EUPL

private HorizontalPanel createButtonsPanel(AnnotationPanel panel, AnnotationTreeNode annotation) {
    HorizontalPanel buttonsPanel = new HorizontalPanel();

    PushButton saveButton = new PushButton(YUMACoreProperties.getConstants().save());
    if (annotation == null) {
        saveButton.addClickHandler(new SaveClickHandler(panel, null, this));
    } else {//from   w  w  w. j av  a 2s  .  c om
        saveButton.addClickHandler(new UpdateClickHandler(panel, annotation, null, this));
    }
    saveButton.setStyleName("imageAnnotation-form-button");
    buttonsPanel.add(saveButton);

    PushButton cancelButton = new PushButton(YUMACoreProperties.getConstants().cancel());
    cancelButton.setStyleName("imageAnnotation-form-button");
    cancelButton.addClickHandler(new CancelClickHandler(panel, annotation));
    buttonsPanel.add(cancelButton);

    return buttonsPanel;
}

From source file:at.ait.dme.yuma.suite.apps.map.client.georeferencing.ControlPointPanel.java

License:EUPL

@Override
protected Widget createHeader() {
    // The parent header panel
    FlowPanel header = new FlowPanel();

    // 'Help geo-Reference' label
    Label addAnnotationLabel = new Label(YUMACoreProperties.getConstants().helpGeoreference());
    addAnnotationLabel.setStyleName("imageAnnotation-add-annotation");
    header.add(addAnnotationLabel);//w w w. j  a  v  a2 s  .com

    // 'Help' link
    HTML help = new HTML(
            "<a target=\"_blank\" href=\"userguide_" + LocaleInfo.getCurrentLocale().getLocaleName()
                    + ".html\">" + YUMACoreProperties.getConstants().help() + "</a>");
    help.setStyleName("imageAnnotation-help");
    header.add(help);

    // Instructions text
    Label addAnnotationHint = new Label(YUMACoreProperties.getConstants().helpGeoreferenceHint());
    addAnnotationHint.setStyleName("imageAnnotation-add-annotation-hint");
    header.add(addAnnotationHint);

    // Button panel
    HorizontalPanel buttons = new HorizontalPanel();

    // 'Create Control Point' button
    createButton = new PushButton(YUMACoreProperties.getConstants().actionCreateCP());
    createButton.setStyleName("imageAnnotation-button");
    createButton.addClickHandler(new AnnotateClickHandler(this, null, null, false));
    createButton.setEnabled(!User.get().isAnonymous());
    buttons.add(createButton);

    if (YUMACoreProperties.getObjectURI().startsWith("http://georeferencer"))
        createButton.setEnabled(false);

    header.add(buttons);

    // Placeholder for the annotation form 
    header.add(editFormPanel);

    return header;
}

From source file:au.com.gworks.gwt.petstore.client.ProductCardView.java

License:Apache License

private void buildTitleFrame() {
    HorizontalPanel hp = titleBar.getWest();
    hp.add(itemIdLbl);
    hp.add(descLbl);//from   ww  w.j  a  va  2s .  com
    Element hpe = hp.getElement();
    DOM.setAttribute(hpe, "id", "productCardTitleInfo");

    hp = titleBar.getEast();
    hpe = hp.getElement();
    hp.add(listPriceLbl);
    addToCartBtn.setVisible(false);
    hp.add(addToCartBtn);
    DOM.setAttribute(hpe, "id", "productCardListPrice");

    addToCartBtn.addClickListener(this);
}

From source file:bingo.client.Bingo.java

License:Open Source License

/**
 * This is the entry point method./* w w w  .  j av a2s  .  c o  m*/
 */
public void onModuleLoad() {
    Label titleLabel = new Label();
    titleLabel.setText(strings.title());
    RootPanel.get("title").add(titleLabel);

    // This is the general notification text box
    RootPanel.get("message").add(message);

    // Cheking if the user has already an user id
    final String cookie = Cookies.getCookie(COOKIE_ID);

    // Validating the cookie
    bingoService.statusUserId(cookie, new AsyncCallback<Integer>() {
        @Override
        public void onFailure(Throwable caught) {
            message.setText(caught.getMessage());
            Cookies.removeCookie(COOKIE_ID);
        }

        @Override
        public void onSuccess(Integer status) {
            // TODO: Control the logged status (I should not get a user if s/he is already logged)
            if (status.intValue() == BingoService.NO_LOGGED || status.intValue() == BingoService.LOGGED) {
                bingoService.getUserId(new AsyncCallback<String>() {
                    @Override
                    public void onFailure(Throwable caught) {
                        message.setText(strings.errorUserCreation());
                    }

                    @Override
                    public void onSuccess(String result) {
                        userId = result;
                    }
                });

                message.setHTML("");

                // Showing image to enter
                ImageResource imageResource = BingoResources.INSTANCE.entry();
                Image entryImage = new Image(imageResource.getSafeUri());
                RootPanel.get("buttons").add(entryImage);

                // Selecting behavior (admin / voter) 
                HorizontalPanel entryPoint = new HorizontalPanel();

                entryPoint.setStyleName("mainSelectorPanel");
                entryPoint.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
                entryPoint.setSpacing(50);

                // 
                // CREATING A BINGO
                //
                VerticalPanel leftPanel = new VerticalPanel();
                leftPanel.setStyleName("selectorPanel");

                Label leftPanelTitle = new Label();
                leftPanelTitle.setStyleName("selectorPanelTitle");
                leftPanelTitle.setText(strings.leftPanelTitle());
                leftPanel.add(leftPanelTitle);
                leftPanel.setCellHorizontalAlignment(leftPanelTitle, HasHorizontalAlignment.ALIGN_CENTER);

                Grid leftSubPanel = new Grid(2, 2);
                leftSubPanel.setWidget(0, 0, new Label(strings.createBingoName()));
                final TextBox bingoNameBox = new TextBox();
                leftSubPanel.setWidget(0, 1, bingoNameBox);

                leftSubPanel.setWidget(1, 0, new Label(strings.createBingoPassword()));
                final PasswordTextBox bingoPasswordBox = new PasswordTextBox();
                leftSubPanel.setWidget(1, 1, bingoPasswordBox);
                leftPanel.add(leftSubPanel);

                final Button createButton = new Button("Create");
                createButton.addClickHandler(new ClickHandler() {
                    public void onClick(ClickEvent event) {
                        bingoService.createBingo(userId, bingoNameBox.getText(), bingoPasswordBox.getText(),
                                new AsyncCallback<String>() {
                                    @Override
                                    public void onFailure(Throwable caught) {
                                        message.setText(caught.getMessage());
                                    }

                                    @Override
                                    public void onSuccess(final String gameId) {
                                        final BingoGrid bingoGrid = new BingoGrid();
                                        initAdminGrid(userId, bingoGrid, false);
                                        RootPanel.get("bingoTable").clear();
                                        RootPanel.get("bingoTable").add(bingoGrid);
                                        message.setText(strings.welcomeMessageCreation());

                                        // Setting the cookie
                                        Date expirationDate = new Date();
                                        expirationDate.setHours(expirationDate.getHours() + EXPIRATION_VALUE);
                                        Cookies.setCookie(COOKIE_ID, userId, expirationDate);
                                    }
                                });
                    }
                });
                leftPanel.add(createButton);
                leftPanel.setCellHorizontalAlignment(createButton, HasHorizontalAlignment.ALIGN_CENTER);
                entryPoint.add(leftPanel);

                // 
                // JOINING
                //
                VerticalPanel rightPanel = new VerticalPanel();
                rightPanel.setStyleName("selectorPanel");

                Label rightPanelTitle = new Label();
                rightPanelTitle.setStyleName("selectorPanelTitle");
                rightPanelTitle.setText(strings.rightPanelTitle());
                rightPanel.add(rightPanelTitle);
                rightPanel.setCellHorizontalAlignment(rightPanelTitle, HasHorizontalAlignment.ALIGN_CENTER);

                Grid rightSubPanel = new Grid(2, 2);
                rightSubPanel.setWidget(0, 0, new Label(strings.joinToBingoName()));
                final ListBox joinExistingBingoBox = new ListBox();
                bingoService.getBingos(new AsyncCallback<String[][]>() {
                    @Override
                    public void onFailure(Throwable caught) {
                        joinExistingBingoBox.addItem(strings.noBingos());
                    }

                    @Override
                    public void onSuccess(String[][] result) {
                        if (result == null) {
                            joinExistingBingoBox.addItem(strings.noBingos());
                        } else {
                            for (int i = 0; i < result.length; i++) {
                                String gameName = result[i][0];
                                String gameId = result[i][1];
                                joinExistingBingoBox.addItem(gameName, gameId);
                            }
                        }
                    }
                });
                rightSubPanel.setWidget(0, 1, joinExistingBingoBox);

                rightSubPanel.setWidget(1, 0, new Label(strings.joinToBingoPassword()));
                final PasswordTextBox joinBingoPasswordBox = new PasswordTextBox();
                rightSubPanel.setWidget(1, 1, joinBingoPasswordBox);
                rightPanel.add(rightSubPanel);

                final Button joinButton = new Button("Join");
                joinButton.addClickHandler(new ClickHandler() {
                    public void onClick(ClickEvent event) {
                        int index = joinExistingBingoBox.getSelectedIndex();
                        if (index < 0)
                            message.setText(strings.noSelectedItem());
                        else {
                            final String gameId = joinExistingBingoBox.getValue(index);
                            if (gameId == null)
                                message.setText(strings.noSelectedItem());
                            else {
                                bingoService.joinBingo(userId, gameId, joinBingoPasswordBox.getText(),
                                        new AsyncCallback<Void>() {
                                            @Override
                                            public void onFailure(Throwable caught) {
                                                message.setText(caught.getMessage());
                                            }

                                            @Override
                                            public void onSuccess(Void result) {
                                                final BingoGrid bingoGrid = new BingoGrid();
                                                initUserGrid(bingoGrid);
                                                RootPanel.get("bingoTable").clear();
                                                RootPanel.get("bingoTable").add(bingoGrid);

                                                message.setText(strings.welcomeMessageJoin());

                                                // Setting the cookie
                                                Date expirationDate = new Date();
                                                expirationDate
                                                        .setHours(expirationDate.getHours() + EXPIRATION_VALUE);
                                                Cookies.setCookie(COOKIE_ID, userId, expirationDate);
                                            }
                                        });
                            }
                        }
                    }
                });
                rightPanel.add(joinButton);
                rightPanel.setCellHorizontalAlignment(joinButton, HasHorizontalAlignment.ALIGN_CENTER);
                entryPoint.add(rightPanel);

                RootPanel.get("bingoTable").add(entryPoint);

            } else if (status.intValue() == BingoService.ADMIN) {
                message.setText("Detected cookie: " + cookie + " as admin");
                userId = cookie;

                bingoService.statusBingo(userId, new AsyncCallback<Integer>() {
                    @Override
                    public void onFailure(Throwable caught) {
                        message.setText(caught.getMessage());
                    }

                    @Override
                    public void onSuccess(Integer result) {
                        int status = result.intValue();
                        final BingoGrid bingoGrid = new BingoGrid();
                        if (status == BingoService.RUNNING) {
                            initAdminGrid(userId, bingoGrid, false);
                            message.setText(strings.welcomeMessageCreation());
                        } else if (status == BingoService.FINISHED) {
                            initAdminGrid(userId, bingoGrid, true);
                            message.setText(strings.finishMessage());
                        }
                        RootPanel.get("bingoTable").clear();
                        RootPanel.get("bingoTable").add(bingoGrid);
                    }
                });

            } else if (status.intValue() == BingoService.PARTICIPANT) {
                message.setText("Detected cookie: " + cookie + " as participant");
                userId = cookie;

                final BingoGrid bingoGrid = new BingoGrid();
                initUserGrid(bingoGrid);
                updateUserGrid(bingoGrid, null);
                RootPanel.get("bingoTable").clear();
                RootPanel.get("bingoTable").add(bingoGrid);
            }
        }
    });
}

From source file:bingo.client.Bingo.java

License:Open Source License

private void initAdminGrid(final String userId, final BingoGrid bingoGrid, final boolean hasFinished) {
    final Timer timer = new Timer() {
        int totalParticipants = 0;

        @Override//from  ww  w .  j  a v  a 2 s .  c  om
        public void run() {
            bingoService.getTotalParticipants(userId, new AsyncCallback<Integer>() {
                @Override
                public void onFailure(Throwable caught) {
                }

                @Override
                public void onSuccess(Integer result) {
                    totalParticipants = result.intValue();
                }
            });

            bingoService.getVotes(userId, new AsyncCallback<int[][]>() {
                @Override
                public void onFailure(Throwable caught) {
                    message.setText(caught.getMessage());
                }

                @Override
                public void onSuccess(int[][] result) {
                    if (result == null) {
                        result = new int[BingoGrid.ROW][BingoGrid.COL];
                        for (int i = 0; i < BingoGrid.ROW; i++)
                            for (int j = 0; j < BingoGrid.COL; j++)
                                result[i][j] = 0;
                    }

                    for (int row = 0; row < BingoGrid.ROW; ++row)
                        for (int col = 0; col < BingoGrid.COL; ++col) {
                            bingoGrid.setVoteString(row, col, String.valueOf(result[row][col]),
                                    String.valueOf(totalParticipants));
                        }
                }
            });
        }
    };

    // If the game is not finished, repeat; if so, run once
    if (!hasFinished)
        timer.scheduleRepeating(ADMIN_TIMER);
    else
        timer.run();

    HorizontalPanel panel = new HorizontalPanel();
    panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    final Button finishButton = new Button();

    // If the game is not finished, allow finishing it; if so, allow download data
    if (!hasFinished)
        finishButton.setText(strings.finishBingo());
    else
        finishButton.setText(strings.download());

    finishButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (!hasFinished)
                bingoService.finishBingo(userId, new AsyncCallback<Void>() {
                    @Override
                    public void onFailure(Throwable caught) {
                        message.setText(caught.getMessage());
                    }

                    @Override
                    public void onSuccess(Void result) {
                        message.setText(strings.finishedBingo());
                        finishButton.setText(strings.download());
                        timer.cancel();
                    }
                });

            bingoService.getVotes(userId, new AsyncCallback<int[][]>() {
                @Override
                public void onFailure(Throwable caught) {
                    message.setText(caught.getMessage());
                }

                @Override
                public void onSuccess(int[][] result) {
                    // Create a popup dialog box
                    final DialogBox box = new DialogBox();
                    box.setText(strings.info());
                    box.setAnimationEnabled(true);

                    final Button boxAcceptButton = new Button(strings.accept());
                    boxAcceptButton.addClickHandler(new ClickHandler() {
                        @Override
                        public void onClick(ClickEvent event) {
                            box.hide();
                        }
                    });

                    Label boxLabel = new Label();
                    boxLabel.setText(strings.finishMessage());
                    HTML voteData = new HTML();
                    if (result == null) {
                        result = new int[BingoGrid.ROW][BingoGrid.COL];
                        for (int i = 0; i < BingoGrid.ROW; i++)
                            for (int j = 0; j < BingoGrid.COL; j++)
                                result[i][j] = 0;
                    }

                    String cellKey = "";
                    String cellString = "";
                    String voteDataString = "";
                    for (int row = 0; row < BingoGrid.ROW; ++row)
                        for (int col = 0; col < BingoGrid.COL; ++col) {
                            cellKey = "cell" + row + col;
                            cellString = strings.map().get(cellKey);
                            voteDataString += "&nbsp;&nbsp;&nbsp;" + cellString + " = " + result[row][col]
                                    + "<br>";
                        }
                    voteData.setHTML(voteDataString);
                    voteData.addStyleName("boxData");

                    VerticalPanel boxPanel = new VerticalPanel();
                    boxPanel.addStyleName("boxPanel");
                    boxPanel.add(boxLabel);
                    boxPanel.add(voteData);

                    HorizontalPanel buttonsPanel = new HorizontalPanel();
                    buttonsPanel.add(boxAcceptButton);
                    boxPanel.add(buttonsPanel);
                    boxPanel.setCellHorizontalAlignment(buttonsPanel, HasHorizontalAlignment.ALIGN_CENTER);

                    box.setWidget(boxPanel);
                    box.center();
                }
            });
        }
    });
    panel.add(finishButton);

    final Button terminateButton = new Button(strings.terminateButton());
    terminateButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            // Create a popup dialog box
            final DialogBox box = new DialogBox();
            box.setText(strings.warning());
            box.setAnimationEnabled(true);

            final Button boxCancelButton = new Button(strings.cancel());
            boxCancelButton.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    box.hide();
                }
            });
            final Button boxAcceptButton = new Button(strings.accept());
            boxAcceptButton.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    bingoService.terminateBingo(userId, new AsyncCallback<Void>() {
                        @Override
                        public void onFailure(Throwable caught) {
                            message.setText(caught.getMessage());
                        }

                        @Override
                        public void onSuccess(Void result) {
                            message.setText(strings.terminatedBingo());
                            timer.cancel();
                        }

                    });
                    box.hide();
                }
            });

            final Label boxLabel = new Label();
            boxLabel.setText(strings.terminateMessage());

            VerticalPanel boxPanel = new VerticalPanel();

            boxPanel.addStyleName("boxPanel");
            boxPanel.add(boxLabel);

            HorizontalPanel buttonsPanel = new HorizontalPanel();
            buttonsPanel.add(boxCancelButton);
            buttonsPanel.add(boxAcceptButton);
            boxPanel.add(buttonsPanel);

            box.setWidget(boxPanel);
            box.center();
        }
    });
    panel.add(terminateButton);

    RootPanel.get("buttons").clear();
    RootPanel.get("buttons").add(panel);
}

From source file:br.usp.icmc.gazetteer.client.view.impl.Mapa.java

License:Apache License

public void addButtons() {

    addPoint(map);//from  w  w  w .j a va  2 s . c  om
    addLineString(map);
    addPolygon(map);
    deleteFeatures(map);
    components.addStyleName("button_map");
    components.add(rbNavigate);
    components.add(rbDrawPoint);
    components.add(rbDrawLine);
    components.add(rbDrawPolygon);
    components.add(cbClickOut);
    final HorizontalPanel hpCbClickOut = new HorizontalPanel();
    hpCbClickOut.add(new HTML("         "));
    components.add(hpCbClickOut);

    rbNavigate.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            desativeAll();
        }
    });
    rbDrawPoint.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            desativeAll();
            clearAllPoint();
            drawPointFeatureControl.activate();
        }
    });
    rbDrawLine.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            desativeAll();
            clearAllPoint();
            drawLineFeatureControl.activate();

        }
    });
    rbDrawPolygon.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            desativeAll();
            clearAllPoint();
            drawPolygonFeatureControl.activate();
        }
    });
    cbClickOut.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            desativeAll();
            clearAllPoint();
            deleteFeatureControl.activate();
        }
    });

}

From source file:bufferings.ktr.wjr.client.ui.WjrPopupPanel.java

License:Apache License

/**
 * Constructs the WjrPopupPanel.//ww w  .  jav  a  2  s.  co m
 */
public WjrPopupPanel() {
    HorizontalPanel mainPanel = new HorizontalPanel();
    mainPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    mainPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    mainPanel.setSpacing(5);
    mainPanel.setStyleName(UI_STATE_HIGHLIGHT);
    mainPanel.setSize("200px", "30px");
    mainPanel.setVisible(false);
    mainPanel.getElement().getStyle().setPosition(Position.ABSOLUTE);
    mainPanel.getElement().getStyle().setPropertyPx("left", -9999);
    mainPanel.getElement().setId(DOM.createUniqueId());

    label = new Label();
    label.setStyleName(UI_WIDGET);
    mainPanel.add(label);

    initWidget(mainPanel);
    RootPanel.get().add(this);
}

From source file:burrito.client.crud.CrudIndexPanel.java

License:Apache License

protected void init(List<CrudEntityInfo> result) {
    Label descLabel;/*www.java2 s .c  o  m*/
    wrapper.add((descLabel = new Label(messages.chooseEntity())));
    if (result.isEmpty()) {
        wrapper.add((descLabel = new Label(messages.noEntitiesToEdit())));
        wrapper.add(new VerticalSpacer(10));
    }
    descLabel.addStyleName("k5-CrudPanel-indexDesc");
    for (CrudEntityInfo crudEntityInfo : result) {
        HorizontalPanel fp = new HorizontalPanel();
        String underscore = crudEntityInfo.getEntityName().replace('.', '_');
        Hyperlink entityName = new Hyperlink(CrudLabelHelper.getString(underscore),
                crudEntityInfo.getEntityName());
        entityName.addStyleName("k5-CrudPanel-entityName");
        fp.add(entityName);
        String desc = CrudLabelHelper.getNullableString(underscore + "_desc");
        if (desc != null) {
            HTML descHtml = new HTML("&nbsp;-&nbsp;" + desc);
            descHtml.addStyleName("k5-CrudPanel-entityDesc");
            fp.add(descHtml);
        }
        wrapper.add(fp);
        wrapper.add(new VerticalSpacer(10));
    }

    wrapper.add(new VerticalSpacer(30));
    wrapper.add(new Label(messages.administrativeTasksHeader()));

    wrapper.add(new VerticalSpacer(10));
    wrapper.add(new Hyperlink(messages.reindex(), "reindex"));

}

From source file:burrito.client.crud.widgets.CrudRichTextArea.java

License:Apache License

private Widget createCommandsArea() {
    HorizontalPanel hp = new HorizontalPanel();
    this.bold = new ToggleButton(new Image(GWT.getModuleBaseURL() + "images/format-text-bold.png"),
            new ClickHandler() {

                public void onClick(ClickEvent event) {
                    formatter.toggleBold();
                }/*from  ww w .j  ava 2  s .c  o  m*/
            });
    bold.setTitle(labels.bold());
    hp.add(bold);

    this.italics = new ToggleButton(new Image(GWT.getModuleBaseURL() + "images/format-text-italic.png"),
            new ClickHandler() {

                public void onClick(ClickEvent event) {
                    formatter.toggleItalic();
                }
            });
    italics.setTitle(labels.italic());
    hp.add(italics);

    this.strikethrough = new ToggleButton(
            new Image(GWT.getModuleBaseURL() + "images/format-text-strikethrough.png"), new ClickHandler() {

                public void onClick(ClickEvent event) {
                    formatter.toggleStrikethrough();
                }
            });
    strikethrough.setTitle(labels.strikethrough());
    hp.add(strikethrough);

    this.underline = new ToggleButton(new Image(GWT.getModuleBaseURL() + "images/format-text-underline.png"),
            new ClickHandler() {

                public void onClick(ClickEvent event) {
                    formatter.toggleUnderline();
                }
            });
    underline.setTitle(labels.underline());
    hp.add(underline);

    PushButton image = new PushButton(new Image(GWT.getModuleBaseURL() + "images/image-x-generic.png"),
            new ClickHandler() {

                public void onClick(ClickEvent event) {
                    imagePicker.center();
                    imagePicker.show();
                }
            });
    image.setTitle(labels.insertImage());
    hp.add(image);

    PushButton link = new PushButton(labels.link(), new ClickHandler() {

        public void onClick(ClickEvent event) {
            formatter.createLink(Window.prompt(labels.pasteLinkHere(), null));
        }
    });
    link.setTitle(labels.insertLink());
    hp.add(link);

    for (CrudRichTextPlugin control : PLUGGED_IN_CONTROLLERS) {
        hp.add(control.getWidget(formatter));
    }

    return hp;

}