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());
}
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;
}
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());
}
}
}
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();
}
});
}
}
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);
}
Aggregations