Example usage for com.google.gwt.user.client.ui HasVerticalAlignment ALIGN_MIDDLE

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

Introduction

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

Prototype

VerticalAlignmentConstant ALIGN_MIDDLE

To view the source code for com.google.gwt.user.client.ui HasVerticalAlignment ALIGN_MIDDLE.

Click Source Link

Document

Specifies that the widget's contents should be aligned in the middle.

Usage

From source file:org.geowe.client.local.main.GeocodingPanelWidget.java

License:Open Source License

@Override
public Widget asWidget() {

    if (panel == null) {
        panel = new ContentPanel();
        panel.setBorders(true);//w  ww.  ja  va2 s.c  o m
        panel.setPixelSize(490, 47);
        panel.setHeaderVisible(false);
        panel.setPosition(300, 0);
        panel.getElement().getStyle().setPosition(Position.ABSOLUTE);

        StyleInjector.inject(".statusBarStyle { " + "position: absolute; " + "bottom: 35 px;"
                + "background: #E0ECF8;" + "border-radius: 5px 10px;" + "opacity: 0.8}");
        panel.setStyleName("geocodingPanelStyle");

        final HorizontalPanel horizontalGroup = new HorizontalPanel();
        horizontalGroup.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
        horizontalGroup.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        horizontalGroup.setSpacing(5);
        horizontalGroup.getElement().getStyle().setBackgroundColor("#E0ECF8");

        addressTextField.setWidth("320px");
        addressTextField.setEmptyText(UIMessages.INSTANCE.gcAddressTextField());
        addressTextField.getElement().setId("autocompletar");

        addressTextField.addKeyDownHandler(new KeyDownHandler() {
            @Override
            public void onKeyDown(final KeyDownEvent event) {
                if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
                    searchGeocoding(addressTextField.getText());
                }
            }
        });

        horizontalGroup.add(addressTextField);
        horizontalGroup.add(getSearchButton());
        horizontalGroup.add(getW3WLocationButton());
        horizontalGroup.add(getLocationMenuButton());
        panel.setWidget(horizontalGroup);
        panel.setVisible(false);
    }
    return panel;
}

From source file:org.geowe.client.local.main.tool.info.JoinDataDialog.java

License:Open Source License

private void createSeparatorPanel() {
    separatorPanel = new HorizontalPanel();
    separatorPanel.setSpacing(1);/*from w  w  w .j av a 2  s  .  com*/
    separatorPanel.setWidth("100%");
    separatorPanel.addStyleName(ThemeStyles.get().style().borderTop());
    separatorPanel.addStyleName(ThemeStyles.get().style().borderBottom());
    separatorPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    separatorPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    separatorPanel.add(new Label(UIMessages.INSTANCE.separator(DEFAULT_CSV_SEPARATOR)));
    separatorTextField = new TextField();
    separatorTextField.setText(DEFAULT_CSV_SEPARATOR);
    separatorTextField.setWidth(30);

    separatorPanel.add(separatorTextField);
}

From source file:org.geowe.client.local.main.tool.map.catalog.dialog.LayerCatalogDialog.java

License:Open Source License

private ColumnModel<LayerDef> createColumnList(LayerDefProperties props, RowExpander<LayerDef> rowExpander) {

    rowExpander.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    rowExpander.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    ColumnConfig<LayerDef, String> nameColumn = new ColumnConfig<LayerDef, String>(props.name(), 200,
            SafeHtmlUtils.fromTrustedString("<b>" + UIMessages.INSTANCE.layerManagerToolText() + "</b>"));
    nameColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    ColumnConfig<LayerDef, String> typeColumn = new ColumnConfig<LayerDef, String>(props.type(), 75,
            UICatalogMessages.INSTANCE.type());
    typeColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    typeColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    ColumnConfig<LayerDef, ImageResource> iconColumn = new ColumnConfig<LayerDef, ImageResource>(props.icon(),
            32, "");
    iconColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    iconColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    iconColumn.setCell(new ImageResourceCell() {
        @Override//www . j  ava 2 s .c  o  m
        public void render(Context context, ImageResource value, SafeHtmlBuilder sb) {
            super.render(context, value, sb);
        }
    });

    List<ColumnConfig<LayerDef, ?>> columns = new ArrayList<ColumnConfig<LayerDef, ?>>();
    columns.add(rowExpander);
    columns.add(iconColumn);
    columns.add(nameColumn);
    columns.add(typeColumn);

    return new ColumnModel<LayerDef>(columns);
}

From source file:org.geowe.client.local.ui.FeatureGrid.java

License:Open Source License

protected ColumnModel<VectorFeature> createColumnList(List<VectorFeature> features) {
    List<ColumnConfig<VectorFeature, ?>> columns = new ArrayList<ColumnConfig<VectorFeature, ?>>();

    if (features != null && features.size() > 0) {
        VectorFeature feature = features.get(0);

        if (feature.getAttributes() != null) {
            for (String attributeName : feature.getAttributes().getAttributeNames()) {
                AttributeValueProvider attributeProvider = new AttributeValueProvider(attributeName);

                ColumnConfig<VectorFeature, String> attributeColumn = new ColumnConfig<VectorFeature, String>(
                        attributeProvider, 100, attributeName);
                attributeColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
                if (isEnableCellRender()) {
                    attributeColumn.setCell(new FeatureGridCellRenderer());
                }/*w  ww . j av a  2  s. c  o m*/

                columns.add(attributeColumn);
            }
        }
    }

    return new ColumnModel<VectorFeature>(columns);
}

From source file:org.geowe.client.local.welcome.Welcome.java

License:Open Source License

private HorizontalPanel getPanel(final HTML data) {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setSize("520px", "310px");
    panel.setSpacing(5);// w  w w .java  2  s.  com
    panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    Anchor anchor = new AnchorBuilder().setHref("http://www.geowe.org")
            .setImage(new Image(ImageProvider.INSTANCE.geoweSquareLogo())).build();

    panel.add(anchor);
    panel.add(data);
    return panel;
}

From source file:org.glimpse.client.Aggregator.java

License:Open Source License

private void load(PageDescription pageDescription) {
    RootPanel.get("main").clear();

    addDialog = new AddContentDialog();
    loginDialog = new LoginDialog();
    optionsDialog = new UserOptionsDialog();

    FlowPanel mainPanel = new FlowPanel();
    mainPanel.setWidth("100%");
    mainPanel.setVisible(false);//from  ww w. j  a va  2  s.c  o m
    RootPanel.get("main").add(mainPanel);

    // Top bar
    HorizontalPanel topBar = new HorizontalPanel();
    topBar.setWidth("100%");
    topBar.setStylePrimaryName("topbar");
    topBar.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    Anchor addButton = new Anchor(constants.addContent(), "javascript:void(0)");
    addButton.setStylePrimaryName("topbar-button");
    addButton.addStyleName("add-content-button");
    addButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            addDialog.center();
        }
    });
    if (!isModifiable()) {
        addButton.setVisible(false);
    }
    topBar.add(addButton);
    topBar.setCellWidth(addButton, "100%");

    if (UserDescription.GUEST_ID.equals(userDescription.getId())) {
        // Guest user
        Anchor loginButton = new Anchor(constants.login(), "javascript:void(0)");
        loginButton.setStylePrimaryName("topbar-button");
        loginButton.addStyleName("login-button");
        loginButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                loginDialog.center();
            }
        });
        topBar.add(loginButton);
    } else {
        // Connected user
        /*
        MenuBar menu = new MenuBar();
                
        MenuBar pagesMenu = new MenuBar(true);
        pagesMenu.setStylePrimaryName("topbar-submenu");
                
        MenuItem myPageItem = new MenuItem(constants.myPage(), new Command() {            
           public void execute() {
              if(defaultPage) {
          Window.Location.replace("index.jsp");
              }
           }
        });         
        pagesMenu.addItem(myPageItem);
                
                
                
        if(userDescription.isAdministrator()) {
           MenuItem defaultPageLocItem = new MenuItem(constants.defaultPage(), new Command() {            
              public void execute() {
          defaultPageDialog.center();
              }
           });
           pagesMenu.addItem(defaultPageLocItem);
                   
           defaultPageLocItem.addStyleName("topbar-submenu-item");
        } else {
           MenuItem defaultPageItem = new MenuItem(constants.defaultPage(), new Command() {            
              public void execute() {
          if(!defaultPage) {
             Window.Location.replace("default-page.jsp");
          }
              }
           });
           pagesMenu.addItem(defaultPageItem);
                   
           if(defaultPage) {
              defaultPageItem.addStyleName("topbar-submenu-item-current");            
           } else {
              defaultPageItem.addStyleName("topbar-submenu-item");
           }
        }
                
        if(defaultPage) {
           myPageItem.addStyleName("topbar-submenu-item");            
        } else {
           myPageItem.addStyleName("topbar-submenu-item-current");
        }
                
        MenuItem pages = new MenuItem(constants.pages(), pagesMenu);         
        pages.setStylePrimaryName("topbar-button");
        pages.addStyleName("topbar-menu");
        menu.addItem(pages);
        topBar.add(menu);
        */

        Anchor optionsButton = new Anchor(constants.userOptions(), "javascript:void(0)");
        optionsButton.setStylePrimaryName("topbar-button");
        optionsButton.addStyleName("user-options-button");
        optionsButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                optionsDialog.center();
            }
        });
        topBar.add(optionsButton);

        Anchor logoutButton = new Anchor(constants.logout(), "javascript:void(0)");
        logoutButton.setStylePrimaryName("topbar-button");
        logoutButton.addStyleName("logout-button");
        logoutButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                loadPopup.center();
                loginService.disconnnect(new AsyncCallback<Void>() {
                    public void onFailure(Throwable caught) {
                        reloadPage();
                    }

                    public void onSuccess(Void result) {
                        reloadPage();
                    }
                });
            }
        });
        topBar.add(logoutButton);
    }

    mainPanel.add(topBar);

    // Header
    FlowPanel header = new FlowPanel();
    header.setStylePrimaryName("header");
    mainPanel.add(header);

    tabPanel = new AggregatorTabPanel();
    tabPanel.setWidth("100%");

    List<TabDescription> tabDescriptions = pageDescription.getTabDescriptions();
    for (TabDescription tabDescription : tabDescriptions) {
        AggregatorTab tab = new AggregatorTab();

        List<ColumnDescription> columnDescriptions = tabDescription.getColumnDescriptions();
        List<AggregatorColumn> columns = new LinkedList<AggregatorColumn>();
        for (ColumnDescription columnDescription : columnDescriptions) {
            AggregatorColumn column = new AggregatorColumn();

            List<ComponentDescription> componentDescriptions = columnDescription.getComponentDescriptions();
            for (ComponentDescription componentDescription : componentDescriptions) {
                Component component = null;
                switch (componentDescription.getType()) {
                case NEWS:
                    component = new NewsReader(componentDescription.getProperties());
                    break;
                case HTML:
                    component = new HtmlComponent(componentDescription.getProperties());
                    break;
                case QUOTE:
                    component = new QuotationComponent(componentDescription.getProperties());
                    break;
                }
                if (component != null) {
                    column.add(component);
                }
            }
            columns.add(column);
        }
        tab.setColumns(columns);
        tabPanel.add(tab, tabDescription.getTitle());
    }
    tabPanel.selectTab(0);

    mainPanel.add(tabPanel);

    // Footer
    FlowPanel footer = new FlowPanel();
    footer.setStylePrimaryName("footer");
    HTML poweredBy = new HTML(
            messages.poweredBy("<a href=\"http://nicolas.dutertry.com/glimpse-project\">Glimpse</a>"));
    footer.add(poweredBy);
    mainPanel.add(footer);

    loadPopup.hide();
    mainPanel.setVisible(true);
}

From source file:org.glimpse.client.AggregatorTabOptions.java

License:Open Source License

public AggregatorTabOptions(AggregatorTabPanel tabPanel) {
    this.tabPanel = tabPanel;

    FlowPanel mainPanel = new FlowPanel();
    mainPanel.setWidth("100%");
    SimplePanel closePanel = new SimplePanel();
    closePanel.setStylePrimaryName("taboptions-close");
    mainPanel.add(closePanel);/*  ww  w  . j ava 2s  .c  o m*/
    FocusPanel closeButton = new FocusPanel();
    closePanel.add(closeButton);
    closeButton.setWidget(new Image(Aggregator.TRANSPARENT_IMAGE));
    closeButton.setStylePrimaryName("taboptions-close-button");
    closeButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            AggregatorTabOptions.this.tabPanel.hideOptions();
        }
    });

    HorizontalPanelExt panel = new HorizontalPanelExt();
    mainPanel.add(panel);
    panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    HorizontalPanel movePanel = new HorizontalPanel();
    movePanel.setSpacing(0);
    panel.add(movePanel);
    FocusPanel moveLeft = new FocusPanel();
    movePanel.add(moveLeft);
    moveLeft.setWidget(new Image(Aggregator.TRANSPARENT_IMAGE));
    moveLeft.setStylePrimaryName("move-tab-left");
    moveLeft.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            AggregatorTabOptions.this.tabPanel.moveVisibleLeft();
            Aggregator.getInstance().update();
        }
    });
    FocusPanel moveRight = new FocusPanel();
    movePanel.add(moveRight);
    moveRight.setWidget(new Image(Aggregator.TRANSPARENT_IMAGE));
    moveRight.setStylePrimaryName("move-tab-right");
    moveRight.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            AggregatorTabOptions.this.tabPanel.moveVisibleRight();
            Aggregator.getInstance().update();
        }
    });

    FlexTable titleTable = new FlexTable();
    titleTable.setText(0, 0, constants.title());
    titleInput = new TextBox();
    titleTable.setWidget(0, 1, titleInput);
    Button titleButton = new Button(constants.ok());
    titleButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            AggregatorTabOptions.this.tabPanel.setTitle(AggregatorTabOptions.this.tabPanel.getVisibleTab(),
                    titleInput.getValue());
            Aggregator.getInstance().update();
        }
    });
    titleTable.setWidget(0, 2, titleButton);
    panel.add(titleTable);
    panel.setCellVerticalAlignment(titleTable, VerticalPanel.ALIGN_MIDDLE);

    FlexTable columnTable = new FlexTable();
    columnTable.setText(0, 0, constants.numberOfColumns());
    columnList = new ListBox();
    columnList.addItem("1");
    columnList.addItem("2");
    columnList.addItem("3");
    columnList.addItem("4");
    columnList.addChangeHandler(new ChangeHandler() {
        public void onChange(ChangeEvent event) {
            AggregatorTab tab = AggregatorTabOptions.this.tabPanel
                    .getTab(AggregatorTabOptions.this.tabPanel.getVisibleTab());
            int newNumber = Integer.valueOf(columnList.getValue(columnList.getSelectedIndex()));
            List<AggregatorColumn> columns = tab.getColumns();
            boolean confirm = false;
            while (columns.size() < newNumber) {
                columns.add(new AggregatorColumn());
            }
            while (columns.size() > newNumber) {
                AggregatorColumn removed = columns.remove(columns.size() - 1);
                if (removed.getComponentCount() > 0) {
                    confirm = true;
                }
            }
            if (confirm && !Window.confirm(constants.removeColumnWarning())) {
                return;
            }
            tab.setColumns(columns);
            Aggregator.getInstance().update();
        }
    });
    columnTable.setWidget(0, 1, columnList);
    panel.add(columnTable);
    panel.setCellVerticalAlignment(columnTable, VerticalPanel.ALIGN_MIDDLE);

    Button delButton = new Button(constants.deleteTab());
    delButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            if (Window.confirm(constants.deleteTabConfirm())) {
                AggregatorTabOptions.this.tabPanel.remove(AggregatorTabOptions.this.tabPanel.getVisibleTab());
                Aggregator.getInstance().update();
            }
        }
    });
    panel.add(delButton);
    panel.setCellVerticalAlignment(delButton, VerticalPanel.ALIGN_MIDDLE);

    initWidget(mainPanel);
}

From source file:org.glimpse.client.Component.java

License:Open Source License

public Component(Map<String, String> properties) {
    this.properties = new HashMap<String, String>(properties);

    SimplePanel mainPanel = new SimplePanel();
    mainPanel.setStylePrimaryName("component");

    SimplePanel frame = new SimplePanel();
    frame.setWidth("100%");
    mainPanel.add(frame);/*from w ww  . j  a v  a  2s.  co m*/

    VerticalPanelExt panel = new VerticalPanelExt();
    panel.setWidth("100%");
    frame.add(panel);

    HorizontalPanelExt topPanel = new HorizontalPanelExt();
    topPanel.setWidth("100%");
    topPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    Image titleLeft = new Image(Aggregator.TRANSPARENT_IMAGE);
    topPanel.add(titleLeft);
    topPanel.setCellClass(titleLeft, "component-title-left");

    titlePanel = new SimplePanel();
    topPanel.add(titlePanel);
    topPanel.setCellClass(titlePanel, "component-title-content");

    actionsPanel = new HorizontalPanelExt();
    actionsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    if (Aggregator.getInstance().isModifiable()) {
        dragHandle = new FocusPanel(new Image(Aggregator.TRANSPARENT_IMAGE));
        dragHandle.setStylePrimaryName("component-action-move");
        actionsPanel.add(dragHandle);
        actionsPanel.setCellClass(dragHandle, "component-action");

        FocusPanel deleteButton = new FocusPanel(new Image(Aggregator.TRANSPARENT_IMAGE));
        deleteButton.setTitle(constants.delete());
        deleteButton.setStylePrimaryName("component-action-delete");
        deleteButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                if (Window.confirm(constants.deleteComponentConfirm())) {
                    removeFromParent();
                    Aggregator.getInstance().update();
                }
            }
        });
        actionsPanel.add(deleteButton);
        actionsPanel.setCellClass(deleteButton, "component-action");
    }

    topPanel.add(actionsPanel);
    topPanel.setCellHorizontalAlignment(actionsPanel, HorizontalPanel.ALIGN_RIGHT);
    topPanel.setCellClass(actionsPanel, "component-title-actions");

    Image titleRight = new Image(Aggregator.TRANSPARENT_IMAGE);
    topPanel.add(titleRight);
    topPanel.setCellClass(titleRight, "component-title-right");

    HorizontalPanelExt center = new HorizontalPanelExt();
    center.setWidth("100%");

    Image left = new Image(Aggregator.TRANSPARENT_IMAGE);
    center.add(left);
    center.setCellClass(left, "component-left");

    contentPanel = new SimplePanel();
    contentPanel.setWidth("100%");
    center.add(contentPanel);
    center.setCellClass(contentPanel, "component-content");

    Image right = new Image(Aggregator.TRANSPARENT_IMAGE);
    center.add(right);
    center.setCellClass(right, "component-right");

    HorizontalPanelExt bottom = new HorizontalPanelExt();
    bottom.setWidth("100%");

    Image bottomLeft = new Image(Aggregator.TRANSPARENT_IMAGE);
    bottom.add(bottomLeft);
    bottom.setCellClass(bottomLeft, "component-bottom-left");

    Image bottomCenter = new Image(Aggregator.TRANSPARENT_IMAGE);
    bottom.add(bottomCenter);
    bottom.setCellClass(bottomCenter, "component-bottom-center");

    Image bottomRight = new Image(Aggregator.TRANSPARENT_IMAGE);
    bottom.add(bottomRight);
    bottom.setCellClass(bottomRight, "component-bottom-right");

    panel.add(topPanel);
    panel.add(center);
    panel.add(bottom);

    initWidget(mainPanel);

    if (Aggregator.getInstance().isModifiable()) {
        Aggregator.getInstance().getDragController().makeDraggable(this);
    }
}

From source file:org.glimpse.client.finance.QuotationComponent.java

License:Open Source License

public QuotationComponent(Map<String, String> properties) {
    super(properties);

    addQuotedDialog = new AddQuotedDialog(this);

    List<String> list = ClientUtils.stringToList(getProperty(PROPERTY_QUOTED_ELEMENTS));
    quotedElements = new LinkedList<QuotedElement>();
    QuotedElement quotedElement = null;/*from   w  ww  .  jav a2 s .  co  m*/
    for (int i = 0; i < list.size(); i++) {
        if (i % 2 == 0) {
            quotedElement = new QuotedElement(list.get(i));
            quotedElements.add(quotedElement);
        } else {
            quotedElement.setLabel(list.get(i));
        }
    }

    HorizontalPanel titlePanel = new HorizontalPanel();
    titlePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    Image titleImage = new Image("images/boursorama.png");
    titleImage.setStylePrimaryName("component-title-image");
    titlePanel.add(titleImage);
    Anchor title = new Anchor("Boursorama");
    title.setHref("http://www.boursorama.com");
    title.setTarget("_blank");
    titlePanel.add(title);
    setTitleWidget(titlePanel);

    List<Widget> actions = new LinkedList<Widget>();
    FocusPanel refreshButton = new FocusPanel(new Image(Aggregator.TRANSPARENT_IMAGE));
    refreshButton.setTitle(constants.refresh());
    refreshButton.setStylePrimaryName("component-action-refresh");
    refreshButton.addClickHandler(new RefreshHandler());
    actions.add(refreshButton);

    if (Aggregator.getInstance().isModifiable()) {
        FocusPanel optionButton = new FocusPanel(new Image(Aggregator.TRANSPARENT_IMAGE));
        optionButton.addClickHandler(new OptionHandler());
        optionButton.setTitle(constants.add());
        optionButton.setStylePrimaryName("component-action-add");
        actions.add(optionButton);
    }

    setActions(actions);

    // Contenu
    VerticalPanel panel = new VerticalPanel();
    panel.setWidth("100%");

    // Le tableau des valeurs
    valueTable = new FlexTable();
    valueTable.setStylePrimaryName("quotations-table");
    valueTable.setCellPadding(0);
    valueTable.setCellSpacing(0);

    panel.add(valueTable);

    setContent(panel);

    refresh();
}

From source file:org.glimpse.client.news.NewsReader.java

License:Open Source License

public NewsReader(Map<String, String> properties) {
    super(properties);
    visitedEntries = ClientUtils.stringToList(getProperty("visitedEntries"));

    entriesTable = new EntriesTable(this);

    // Les boutons de commande du titre

    HorizontalPanel titlePanel = new HorizontalPanel();
    titlePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    titleImage = new Image("images/feed.png");
    titleImage.setStylePrimaryName("component-title-image");
    titlePanel.add(titleImage);/*from  www .j  a  v a 2  s.com*/
    title.setHref("javascript:void(0)");
    title.setTarget("_blank");
    titlePanel.add(title);
    setTitleWidget(titlePanel);

    List<Widget> actions = new LinkedList<Widget>();
    FocusPanel refreshButton = new FocusPanel(new Image(Aggregator.TRANSPARENT_IMAGE));
    refreshButton.setTitle(constants.refresh());
    refreshButton.setStylePrimaryName("component-action-refresh");
    refreshButton.addClickHandler(new RefreshHandler());
    actions.add(refreshButton);

    if (Aggregator.getInstance().isModifiable()) {
        FocusPanel optionButton = new FocusPanel(new Image(Aggregator.TRANSPARENT_IMAGE));
        optionButton.addClickHandler(new OptionHandler());
        optionButton.setTitle(constants.options());
        optionButton.setStylePrimaryName("component-action-options");
        actions.add(optionButton);
    }

    setActions(actions);

    // Contenu
    VerticalPanel panel = new VerticalPanel();
    panel.setWidth("100%");

    optionPanel = new SimplePanel();
    optionPanel.setStylePrimaryName("component-options");
    VerticalPanel vp = new VerticalPanel();
    FlexTable table = new FlexTable();

    table.setText(0, 0, constants.url());
    urlField = new TextBox();
    table.setWidget(0, 1, urlField);

    table.setText(1, 0, constants.directOpen());
    directOpenBox = new CheckBox();
    table.setWidget(1, 1, directOpenBox);

    table.setText(2, 0, constants.maxEntries());
    maxBox = new ListBox();
    for (int i = 1; i <= 20; i++) {
        maxBox.addItem(String.valueOf(i));
    }
    table.setWidget(2, 1, maxBox);

    vp.add(table);

    synchronizeOptions();

    Button button = new Button(constants.ok());
    button.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            setProperty(PROPERTY_URL, urlField.getValue());
            setProperty(PROPERTY_DIRECT_OPEN, Boolean.toString(directOpenBox.getValue()));
            setProperty(PROPERTY_MAX_PER_PAGE, Integer.toString(maxBox.getSelectedIndex() + 1));
            Aggregator.getInstance().update();
            refresh();
        }
    });
    vp.add(button);
    optionPanel.add(vp);
    panel.add(optionPanel);

    // Le tableau des news
    panel.add(entriesTable);

    // image de chargement
    Image wait = new Image("wait.gif");
    loadingPanel.add(wait);
    loadingPanel.setWidth("100%");
    loadingPanel.setVisible(false);
    loadingPanel.setCellHorizontalAlignment(wait, HorizontalPanel.ALIGN_CENTER);
    panel.add(loadingPanel);

    // En cas d'erreur
    error = new Label(constants.error());
    error.setVisible(false);
    panel.add(error);

    // Les boutons de commande du bas
    HorizontalPanelExt bottomBar = new HorizontalPanelExt();
    bottomBar.setWidth("100%");

    previousButton.setText(constants.previous());
    previousButton.setHref("javascript:void(0)");
    previousButton.setStylePrimaryName("news-previous");
    previousButton.addClickHandler(new PreviousHandler());
    bottomBar.add(previousButton);
    bottomBar.setCellHorizontalAlignment(previousButton, HorizontalPanel.ALIGN_LEFT);

    nextButton.setText(constants.next());
    nextButton.setHref("javascript:void(0)");
    nextButton.setStylePrimaryName("news-next");
    nextButton.addClickHandler(new NextHandler());
    bottomBar.add(nextButton);
    bottomBar.setCellHorizontalAlignment(nextButton, HorizontalPanel.ALIGN_RIGHT);

    panel.add(bottomBar);

    setContent(panel);

    checkPreviousNext();
}