Search in sources :

Example 31 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project drools-wb by kiegroup.

the class ColumnsPagePresenterTest method testSetupAccordionWidgets.

@Test
public void testSetupAccordionWidgets() {
    final VerticalPanel verticalPanel = mock(VerticalPanel.class);
    doReturn(verticalPanel).when(presenter).makeDefaultPanel();
    presenter.setupAccordionWidgets();
    verify(presenter).setupAccordionWidget(eq(ATTRIBUTE), any());
    verify(presenter).setupAccordionWidget(eq(METADATA), any());
    verify(presenter).setupAccordionWidget(eq(CONDITION), any());
    verify(presenter).setupAccordionWidget(eq(ACTION), any());
    assertEquals(verticalPanel, presenter.getAttributeWidget());
    assertEquals(verticalPanel, presenter.getMetaDataWidget());
    assertEquals(verticalPanel, presenter.getConditionsWidget());
    assertEquals(verticalPanel, presenter.getActionsWidget());
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) Test(org.junit.Test)

Example 32 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project drools-wb by kiegroup.

the class GuidedScoreCardEditor method getCharacteristics.

private Widget getCharacteristics() {
    characteristicsPanel = new VerticalPanel();
    characteristicsTables = new ArrayList<FlexTable>();
    final HorizontalPanel toolbar = new HorizontalPanel();
    btnAddCharacteristic = new Button(GuidedScoreCardConstants.INSTANCE.addCharacteristic(), new ClickHandler() {

        public void onClick(ClickEvent event) {
            addCharacteristic(null);
        }
    });
    toolbar.add(btnAddCharacteristic);
    toolbar.setHeight("24");
    characteristicsPanel.add(toolbar);
    final SimplePanel gapPanel = new SimplePanel();
    gapPanel.add(new HTML("<br/>"));
    characteristicsPanel.add(gapPanel);
    return characteristicsPanel;
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Button(org.gwtbootstrap3.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FlexTable(com.google.gwt.user.client.ui.FlexTable) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) SimplePanel(com.google.gwt.user.client.ui.SimplePanel) HTML(com.google.gwt.user.client.ui.HTML)

Example 33 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project drools-wb by kiegroup.

the class GuidedScoreCardEditor method addAttribute.

private void addAttribute(final FlexTable selectedTable, final Attribute attribute) {
    // Disable the fact & field dropdowns
    ((ListBox) selectedTable.getWidget(2, 0)).setEnabled(false);
    // ( (ListBox) selectedTable.getWidget( 2, 1 ) ).setEnabled( false );
    final ListBox edd = ((ListBox) selectedTable.getWidget(2, 1));
    edd.setEnabled(false);
    int selectedIndex = edd.getSelectedIndex() > -1 ? edd.getSelectedIndex() : 0;
    String field = edd.getValue(selectedIndex);
    // field is in the format 'fieldName : datatype';
    // the actual name
    String fieldName = field.substring(0, field.indexOf(":")).trim();
    // the data type
    String dataType = field.substring(field.indexOf(":") + 1).trim();
    // enum values
    final ListBox factDD = (ListBox) selectedTable.getWidget(2, 0);
    String factName = factDD.getValue(factDD.getSelectedIndex());
    boolean enumColumn = oracle.hasEnums(factName, fieldName);
    final List<String> operators = new ArrayList<String>();
    if ("String".equalsIgnoreCase(dataType)) {
        if (enumColumn) {
            operators.addAll(Arrays.asList(enumStringOperators));
        } else {
            operators.addAll(Arrays.asList(stringOperators));
        }
    } else if ("boolean".equalsIgnoreCase(dataType)) {
        operators.addAll(Arrays.asList(booleanOperators));
    } else {
        operators.addAll(Arrays.asList(numericOperators));
    }
    if (characteristicsAttrMap.get(selectedTable) == null) {
        final Characteristic characteristic = getCharacteristicFromTable(selectedTable);
        // first attribute, construct and add the table
        VerticalPanel vPanel = characteristicsAttrPanelMap.get(selectedTable);
        vPanel.add(addAttributeCellTable(selectedTable, characteristic, enumColumn, dataType, operators));
        characteristicsAttrPanelMap.remove(selectedTable);
    }
    Attribute newAttribute = null;
    if (attribute != null) {
        characteristicsAttrMap.get(selectedTable).getList().add(attribute);
    } else {
        newAttribute = new Attribute();
        characteristicsAttrMap.get(selectedTable).getList().add(newAttribute);
        newAttribute.setOperator(operators.get(0));
    }
    characteristicsAttrMap.get(selectedTable).refresh();
    if ("boolean".equalsIgnoreCase(dataType)) {
        ((Button) selectedTable.getWidget(0, 3)).setEnabled(characteristicsAttrMap.get(selectedTable).getList().size() != 2);
        if (newAttribute != null) {
            newAttribute.setValue(GuidedScoreCardConstants.INSTANCE.notApplicable());
        }
    }
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) Attribute(org.drools.workbench.models.guided.scorecard.shared.Attribute) Button(org.gwtbootstrap3.client.ui.Button) Characteristic(org.drools.workbench.models.guided.scorecard.shared.Characteristic) ArrayList(java.util.ArrayList) ListBox(org.gwtbootstrap3.client.ui.ListBox)

Example 34 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project opennms by OpenNMS.

the class GoogleMapsPanel method showLocationDetails.

/**
 * {@inheritDoc}
 */
@Override
public void showLocationDetails(final String name, final String htmlTitle, final String htmlContent) {
    final Marker m = m_markers.get(name);
    getMapWidget().savePosition();
    getMapWidget().setCenter(m.getLatLng());
    if (m != null) {
        final VerticalPanel panel = new VerticalPanel();
        panel.add(new Label(htmlTitle));
        panel.add(new HTML(htmlContent));
        getMapWidget().getInfoWindow().open(m.getLatLng(), new InfoWindowContent(panel.toString()));
        getMapWidget().getInfoWindow().addInfoWindowCloseClickHandler(new InfoWindowCloseClickHandler() {

            @Override
            public void onCloseClick(InfoWindowCloseClickEvent event) {
                getMapWidget().returnToSavedPosition();
            }
        });
    }
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) InfoWindowCloseClickHandler(com.google.gwt.maps.client.event.InfoWindowCloseClickHandler) Label(com.google.gwt.user.client.ui.Label) HTML(com.google.gwt.user.client.ui.HTML) Marker(com.google.gwt.maps.client.overlay.Marker) InfoWindowContent(com.google.gwt.maps.client.InfoWindowContent)

Example 35 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project che by eclipse.

the class ImageViewer method go.

/** {@inheritDoc} */
@Override
public void go(AcceptsOneWidget container) {
    VerticalPanel panel = new VerticalPanel();
    panel.setSize("100%", "100%");
    panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    panel.add(getImage());
    editorView = new ScrollPanel(panel);
    editorView.getElement().getFirstChildElement().getStyle().setHeight(100, Unit.PCT);
    container.setWidget(editorView);
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) ScrollPanel(com.google.gwt.user.client.ui.ScrollPanel)

Aggregations

VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)63 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)19 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)19 Label (com.google.gwt.user.client.ui.Label)18 HTML (com.google.gwt.user.client.ui.HTML)14 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)12 CheckBox (com.google.gwt.user.client.ui.CheckBox)9 SmallHeading (com.google.gerrit.client.ui.SmallHeading)7 Button (com.google.gwt.user.client.ui.Button)7 ScrollPanel (com.google.gwt.user.client.ui.ScrollPanel)7 TextBox (com.google.gwt.user.client.ui.TextBox)7 FlexTable (com.google.gwt.user.client.ui.FlexTable)6 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)6 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)6 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)5 OnEditEnabler (com.google.gerrit.client.ui.OnEditEnabler)4 Grid (com.google.gwt.user.client.ui.Grid)4 Image (com.google.gwt.user.client.ui.Image)4 InlineLabel (com.google.gwt.user.client.ui.InlineLabel)4 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)4