public void initialize() { customSqlBox.setSize("50em", "5em"); quickReferenceLink.addClickListener(this); showHideControlsLink.addClickListener(this); filterList = new WidgetList<TestFilterWidget>(filterFactory); Panel titlePanel = new HorizontalPanel(); titlePanel.add(getFieldLabel("Test attributes:")); titlePanel.add( new HTML( " <a href=\"" + WIKI_URL + "#attribute_filtering\" " + "target=\"_blank\">[?]</a>")); Panel attributeFilters = new VerticalPanel(); attributeFilters.setStyleName("box"); attributeFilters.add(titlePanel); attributeFilters.add(filterList); Panel commonFilterPanel = new VerticalPanel(); commonFilterPanel.add(customSqlBox); commonFilterPanel.add(attributeFilters); commonFilterPanel.add(showInvalid); RootPanel.get("common_filters").add(commonFilterPanel); RootPanel.get("common_quick_reference").add(quickReferenceLink); RootPanel.get("common_show_hide_controls").add(showHideControlsLink); generateQuickReferencePopup(); }
private void handleShowHideControlsClick() { boolean areControlsVisible = showHideControlsLink.getText().equals(SHOW_CONTROLS); allControlsPanel.setVisible(areControlsVisible); showHideControlsLink.setText(areControlsVisible ? HIDE_CONTROLS : SHOW_CONTROLS); for (CommonPanelListener listener : listeners) { listener.onSetControlsVisible(areControlsVisible); } }
private void handleQuickReferenceClick() { if (isQuickReferenceShowing()) { quickReferencePopup.hide(); quickReferenceLink.setText(SHOW_QUICK_REFERENCE); } else { quickReferencePopup.setPopupPositionAndShow(this); quickReferenceLink.setText(HIDE_QUICK_REFERENCE); } }
protected void setupPanel(List<TextBox> textBoxes) { Panel panel = new HorizontalPanel(); includeOrExclude.addItem("Include"); includeOrExclude.addItem("Exclude"); panel.add(includeOrExclude); for (TextBox textBox : textBoxes) { panel.add(new Label(textBox.getName())); panel.add(textBox); } SimpleHyperlink deleteLink = new SimpleHyperlink("[X]"); deleteLink.addClickListener(this); panel.add(deleteLink); initWidget(panel); }
private boolean isQuickReferenceShowing() { return quickReferenceLink.getText().equals(HIDE_QUICK_REFERENCE); }