List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setCellWidth
public void setCellWidth(IsWidget w, String width)
From source file:org.ned.server.nedadminconsole.client.widgets.NedTreeItemWidget.java
License:Open Source License
public NedTreeItemWidget(String imageUrl, String labelText) { HorizontalPanel horizontalPanel = new HorizontalPanel(); initWidget(horizontalPanel);//from w ww . j a v a2 s . c o m horizontalPanel.setSize("90%", "100%"); Image image = new Image(imageUrl); horizontalPanel.add(image); image.setSize("32", "32"); Label labelSpacer = new Label(""); horizontalPanel.add(labelSpacer); horizontalPanel.setCellWidth(labelSpacer, "10%"); labelSpacer.setWidth("10"); Label labelName = new Label(labelText); labelName.setWordWrap(false); horizontalPanel.add(labelName); horizontalPanel.setCellWidth(labelName, "90%"); addStyleName("NedTreeItemWidget"); }
From source file:org.ned.server.nedadminconsole.client.widgets.NedUserManagementWidget.java
License:Open Source License
public NedUserManagementWidget() { HorizontalPanel horizontalPanelOuter = new HorizontalPanel(); horizontalPanelOuter.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setSpacing(10);//from w ww.j av a 2 s .c o m initWidget(horizontalPanelOuter); horizontalPanelOuter.setWidth("100%"); horizontalPanelOuter.add(verticalPanel); horizontalPanelOuter.setCellHorizontalAlignment(verticalPanel, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanelOuter.setCellWidth(verticalPanel, "95%"); verticalPanel.setSize("95%", "95px"); gridUsers = new Grid(1, 4); gridUsers.setCellSpacing(13); gridUsers.setStyleName("NedUserManagementGrid"); gridUsers.setBorderWidth(1); verticalPanel.add(gridUsers); verticalPanel.setCellHorizontalAlignment(gridUsers, HasHorizontalAlignment.ALIGN_CENTER); gridUsers.setWidth("100%"); verticalPanel.setCellWidth(gridUsers, "100%"); labelUsername = new Label(NedRes.instance().username()); labelUsername.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); labelUsername.setStyleName("NedUserManagementLabels"); gridUsers.setWidget(0, 0, labelUsername); labelUsername.setWidth("85%"); gridUsers.getCellFormatter().setWidth(0, 0, "36%"); labelPassword = new Label(NedRes.instance().userDlgPassword()); labelPassword.setStyleName("NedUserManagementLabels"); gridUsers.setWidget(0, 1, labelPassword); labelPassword.setWidth("85%"); gridUsers.getCellFormatter().setHeight(0, 1, ""); gridUsers.getCellFormatter().setWidth(0, 1, "36%"); gridUsers.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER); gridUsers.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT); HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.add(horizontalPanel); verticalPanel.setCellWidth(horizontalPanel, "100%"); horizontalPanel.setWidth("100%"); Button buttonAddUser = new Button(""); buttonAddUser.addClickHandler(new ClickHandlerAddUser()); buttonAddUser.setText(NedRes.instance().userDlgAddNewUser()); horizontalPanel.add(buttonAddUser); horizontalPanel.setCellWidth(buttonAddUser, "33%"); buttonAddUser.setWidth("100%"); Button buttonSaveModifications = new Button(""); buttonSaveModifications.addClickHandler(new ClickHandlerSaveModifications()); buttonSaveModifications.setText(NedRes.instance().userDlgSaveModifications()); horizontalPanel.add(buttonSaveModifications); horizontalPanel.setCellWidth(buttonSaveModifications, "33%"); buttonSaveModifications.setWidth("100%"); }
From source file:org.nuxeo.ecm.platform.annotations.gwt.client.view.AnnotationListPopup.java
License:Apache License
public AnnotationListPopup(String annotationName, List<Annotation> annotations, WebConfiguration configuration) { super();/* w w w . ja v a 2 s . com*/ this.setWidth(Window.getClientWidth() + " px"); this.setHeight(Window.getClientHeight() + " px"); this.setStyleName("annotationListPopup"); VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setWidth("100%"); HorizontalPanel titleBar = new HorizontalPanel(); titleBar.setStyleName("annotationListPopupTitleBar"); TranslationMessages translationMessages = GWT.create(TranslationMessages.class); Label title = new Label(translationMessages.annotationListPopupTitle(annotationName)); titleBar.add(title); titleBar.setCellWidth(title, "100%"); PushButton closeButton = new PushButton(" ", new ClickListener() { public void onClick(Widget arg0) { hide(); } }); closeButton.setStyleName("annotationListPopupClose"); titleBar.add(closeButton); verticalPanel.add(titleBar); Grid grid = new Grid(annotations.size(), 3); grid.setWidth("100%"); grid.setCellSpacing(0); grid.setStyleName("annotationListPopupGrid"); Set<String> displayedFields = configuration.getDisplayedFields(); String icon = configuration.getAnnotationDefinition(annotationName).getIcon(); for (int i = 0; i < annotations.size(); i++) { grid.setWidget(i, 0, new Image(icon)); Annotation annotation = annotations.get(i); String fields = annotation.getFormattedDate(); for (String displayedField : displayedFields) { String value = annotation.getFields().get(displayedField); if (value != null) { fields += "<br/>" + value; } } grid.setWidget(i, 1, new HTML(fields)); grid.getColumnFormatter().addStyleName(1, "annotationListPopupFields"); String body = ""; Set<String> definedFields = configuration.getAnnotationDefinition(annotationName).getFields().keySet(); for (String definedField : definedFields) { if (!displayedFields.contains(definedField)) { body += annotation.getFields().get(definedField) + " - "; } } body += AnnotationUtils.replaceCarriageReturns(AnnotationUtils.escapeHtml(annotation.getBody())); grid.setWidget(i, 2, new HTML(body)); grid.getColumnFormatter().setWidth(2, "100%"); } verticalPanel.add(grid); verticalPanel.setCellHeight(grid, "100%"); this.add(verticalPanel); }
From source file:org.nuxeo.ecm.platform.annotations.gwt.client.view.AnnotationManagerPanel.java
License:Apache License
private void addFiltersToolbar() { HorizontalPanel toolBar = new HorizontalPanel(); List<AnnotationFilter> filters = webConfiguration.getFilters(); for (final AnnotationFilter filter : filters) { PushButton button = new PushButton(new Image(filter.getIcon()), new ClickListener() { public void onClick(Widget sender) { model.setFilter(filter); }/* ww w .j av a2 s . co m*/ }); button.setTitle(filter.getName()); toolBar.add(button); } Label spacer = new Label(" "); toolBar.add(spacer); toolBar.setCellWidth(spacer, "100%"); List<AnnotationDefinition> inMenuAnnos = webConfiguration.getAnnotationDefinitions(new InMenuFilter()); TranslationMessages translationMessages = GWT.create(TranslationMessages.class); for (AnnotationDefinition annotationDef : inMenuAnnos) { final String annName = annotationDef.getName(); PushButton button = new PushButton(new Image(annotationDef.getListIcon()), new ClickListener() { public void onClick(Widget sender) { new AnnotationListPopup(annName, model.filterAnnotations(new AnnotationFilter("", "", annName, null, null)), webConfiguration).show(); } }); button.setTitle(translationMessages.viewAnnotations(annotationDef.getName())); toolBar.add(button); } for (AnnotationDefinition annotationDef : inMenuAnnos) { final String annName = annotationDef.getName(); final String annType = annotationDef.getType(); PushButton button = new PushButton(new Image(annotationDef.getCreateIcon()), new ClickListener() { public void onClick(Widget sender) { controller.createNewAnnotation("#xpointer(null-range)"); NewAnnotationPopup popup = new NewAnnotationPopup(null, controller, false, annType, annName); popup.show(); } }); button.setTitle(translationMessages.addAnnotation(annotationDef.getName())); toolBar.add(button); } add(toolBar); final AnnotationFilter currentFilter = model.getFilter(); if (currentFilter != null && !currentFilter.getParameters().isEmpty()) { List<String> parameters = currentFilter.getParameters(); Map<String, String> labels = webConfiguration.getFieldLabels(); Grid filterGrid = new Grid(parameters.size(), 2); filterGrid.setStyleName("filterGrid"); filterGrid.getColumnFormatter().setWidth(1, "100%"); for (int i = 0; i < parameters.size(); i++) { final String parameter = parameters.get(i); filterGrid.setWidget(i, 0, new Label((labels.containsKey(parameter) ? labels.get(parameter) : parameter) + ": ")); final ListBox filterListBox = new ListBox(); filterListBox.setStyleName("filterListBox"); filterListBox.addItem("All"); Set<String> values = new HashSet<String>(); for (Annotation annotation : model.getUnfilteredAnnotations()) { if (parameter.equals(RDFConstant.R_TYPE)) { values.add(annotation.getShortType()); } else if (parameter.equals(RDFConstant.D_CREATOR)) { values.add(annotation.getAuthor()); } else { String value = annotation.getFields().get(parameter); if (value != null) { values.add(value); } } } for (String value : values) { filterListBox.addItem(value); } if (selectedParams.containsKey(parameter)) { filterListBox.setSelectedIndex(selectedParams.get(parameter).intValue()); } if (parameter.equals(RDFConstant.R_TYPE)) { filterListBox.addChangeListener(new ChangeListener() { public void onChange(Widget arg0) { int selectedIndex = filterListBox.getSelectedIndex(); if (selectedIndex == 0) { currentFilter.setType(null); } else { currentFilter.setType(filterListBox.getItemText(selectedIndex)); } selectedParams.put(parameter, Integer.valueOf(selectedIndex)); model.setFilter(currentFilter); } }); } else if (parameter.equals(RDFConstant.D_CREATOR)) { filterListBox.addChangeListener(new ChangeListener() { public void onChange(Widget arg0) { int selectedIndex = filterListBox.getSelectedIndex(); if (selectedIndex == 0) { currentFilter.setAuthor(null); } else { currentFilter.setAuthor(filterListBox.getItemText(selectedIndex)); } selectedParams.put(parameter, Integer.valueOf(selectedIndex)); model.setFilter(currentFilter); } }); } else { filterListBox.addChangeListener(new ChangeListener() { public void onChange(Widget arg0) { int selectedIndex = filterListBox.getSelectedIndex(); if (selectedIndex == 0) { currentFilter.removeField(parameter); } else { currentFilter.setField(parameter, filterListBox.getItemText(selectedIndex)); } selectedParams.put(parameter, Integer.valueOf(selectedIndex)); model.setFilter(currentFilter); } }); } filterGrid.setWidget(i, 1, filterListBox); } add(filterGrid); } }
From source file:org.nuxeo.ecm.platform.annotations.gwt.client.view.AnnotationManagerPanel.java
License:Apache License
private void updateShownAnnotation(int y) { remove(shownAnnotation);//from w ww . j av a 2 s . c o m shownAnnotation = new VerticalPanel(); shownAnnotation.addStyleName("shown-annotation"); Annotation ann = model.getAnnotations().get(y); add(shownAnnotation); HorizontalPanel horizontalPanel = new HorizontalPanel(); AnnotationDefinition def = webConfiguration.getAnnotationDefinition(ann.getShortType()); Image image = new Image(def.getIcon()); horizontalPanel.add(image); horizontalPanel.add(new Label(ann.getFormattedDate())); // add the displayed fields Set<String> displayedFields = webConfiguration.getDisplayedFields(); for (String displayedField : displayedFields) { String value = ann.getFields().get(displayedField); horizontalPanel.add(new Label("")); Label valueLabel = new Label(value != null ? value : " "); horizontalPanel.add(valueLabel); } Label spacer = new Label(" "); horizontalPanel.add(spacer); horizontalPanel.setCellWidth(spacer, "100%"); shownAnnotation.add(horizontalPanel); if (ann.isBodyUrl()) { Frame frame = new Frame(); frame.setUrl(ann.getBody()); shownAnnotation.add(frame); } else { HTML label = new HTML(AnnotationUtils.replaceCarriageReturns(ann.getBody())); label.setStyleName("annotation-body"); shownAnnotation.add(label); } }
From source file:org.onecmdb.ui.gwt.toolkit.client.view.ci.CIIconDisplayNameWidget.java
License:Open Source License
public void load(GWT_CiBean bean) { vPanel.clear();// www.j a v a 2s. co m HorizontalPanel cipanel = new HorizontalPanel(); cipanel.add(new Image(OneCMDBUtils.getIconForCI(bean))); CIDisplayNameWidget display = new CIDisplayNameWidget(bean, clickListener); cipanel.add(display); cipanel.setCellWidth(display, "100%"); cipanel.setCellHorizontalAlignment(display, HorizontalPanel.ALIGN_LEFT); vPanel.add(cipanel); }
From source file:org.onecmdb.ui.gwt.toolkit.client.view.input.CIMultiValueWidget.java
License:Open Source License
public void addValue(final Widget widget) { // need to get the base widget... if (widget instanceof IBaseField) { final HorizontalPanel hPanel = new HorizontalPanel(); hPanel.add(((IBaseField) widget).getBaseField()); valuePanel.add(hPanel);/*from w w w.j a va 2 s .c om*/ if (mValue.getCtrl().isReadonly()) { ((IBaseField) widget).getBaseField().setStyleName("multi-value-input-readonly"); } else { Image delete = new Image("images/delete-value.gif"); delete.setTitle("Remove this value"); delete.addClickListener(new ClickListener() { public void onClick(Widget sender) { List values = mValue.getAttributeValues(); List remainingValues = new ArrayList(); for (Iterator iter = values.iterator(); iter.hasNext();) { AttributeValue aValue = (AttributeValue) iter.next(); if (widget.equals(aValue.getWidget())) { // Remove this, mValue.removeAttributeValue(aValue); valuePanel.remove(hPanel); break; } } } }); hPanel.add(delete); hPanel.setCellWidth(((IBaseField) widget).getBaseField(), "100%"); //((IBaseField)widget).getBaseField().setStyleName("multi-value-input"); ((IBaseField) widget).getBaseField().setStyleName("multi-value-input-inside"); hPanel.setStyleName("multi-value-input"); } baseFields.add(widget); } }
From source file:org.onecmdb.ui.gwt.toolkit.client.view.input.CISingleValueWidget.java
License:Open Source License
public CISingleValueWidget(final AttributeValue value) { super(value.getLabel()); this.value = value; this.value.setWidget(this); HorizontalPanel hPanel = new HorizontalPanel(); hPanel.setWidth("100%"); /*/*from w w w. ja v a 2s . co m*/ CIIconWidget icon = new CIIconWidget(value.getType()); panel.add(icon); */ super.setRequired(value.getCtrl().isRequiered()); hPanel.add(new CIIconWidget(value.getType())); final CIDisplayNameWidget valueWidget = new CIDisplayNameWidget(); valueWidget.setAlias(value.getStringValue()); if (value.getCtrl().getClickListener() != null) { valueWidget.setListener(value.getCtrl().getClickListener()); } valueWidget.setLoadListener(new LoadListener() { public void onLoadComplete(Object sender) { if (sender instanceof GWT_CiBean) { value.setValueAsCI((GWT_CiBean) sender); } } public void onLoadFailure(Object sender, Throwable caught) { // TODO Auto-generated method stub } public void onLoadStart(Object sender) { // TODO Auto-generated method stub } }); valueWidget.update(); hPanel.add(valueWidget); hPanel.setCellWidth(valueWidget, "100%"); hPanel.setCellHorizontalAlignment(valueWidget, HorizontalPanel.ALIGN_LEFT); if (value.getCtrl() instanceof IAttributeLoader) { IAttributeLoader aLoader = (IAttributeLoader) value.getCtrl(); aLoader.load(new AsyncCallback() { public void onFailure(Throwable caught) { // TODO Auto-generated method stub } public void onSuccess(Object result) { if (result instanceof GWT_CiBean) { valueWidget.load((GWT_CiBean) result); CISingleValueWidget.this.value.setValueAsCI(((GWT_CiBean) result)); CISingleValueWidget.this.validate(); } } }); } if (!value.getCtrl().isReadonly()) { /* final Image delete = new Image("images/delete-value.gif"); delete.setTitle("Reset this value"); delete.addClickListener(new ClickListener() { public void onClick(Widget sender) { valueWidget.load(null); CISingleValueWidget.this.value.setValueAsCI(null); CISingleValueWidget.this.validate(); } }); */ final Image change = new Image("images/eclipse/view_menu.gif"); change.addClickListener(new ClickListener() { public void onClick(Widget sender) { SelectInheritanceDataSourceControl ctrl = new SelectInheritanceDataSourceControl( CISingleValueWidget.this.value.getType()); ctrl.setFilterInstances( new Boolean(CISingleValueWidget.this.value.getCtrl().isSelectTemplate())); ctrl.setSelectInstances(CISingleValueWidget.this.value.getCtrl().isSelectTemplate()); ctrl.setRequiered(CISingleValueWidget.this.value.getCtrl().isRequiered()); ctrl.setShowSearch(true); String title = "Select a Instance"; if (CISingleValueWidget.this.value.getCtrl().isSelectTemplate()) { title = "Select a Template"; } final SelectCIPopup popup = new SelectCIPopup(title, ctrl); ctrl.setSelectListener(new ISelectListener() { public void onSelect(Object selected) { if (selected instanceof GWT_CiBean) { if (selected instanceof NullCIBean) { valueWidget.load(null); CISingleValueWidget.this.value.setValueAsCI(null); } else { valueWidget.load((GWT_CiBean) selected); CISingleValueWidget.this.value.setValueAsCI((GWT_CiBean) selected); } CISingleValueWidget.this.validate(); popup.hide(); } } }); int top = getBaseField().getAbsoluteTop() + getBaseField().getOffsetHeight() + 2; int left = getBaseField().getAbsoluteLeft() + 8; popup.setPopupPosition(left, top); popup.show(); } }); hPanel.add(change); hPanel.setCellHorizontalAlignment(change, HorizontalPanel.ALIGN_RIGHT); } // Create another panel to be able to set with to 100% HorizontalPanel panel = new HorizontalPanel(); panel.add(hPanel); addField(panel); if (value.getCtrl().isReadonly()) { panel.setStyleName("mdv-form-input-readonly"); } }
From source file:org.onecmdb.ui.gwt.toolkit.client.view.tree.QueryCriteriaWidget.java
License:Open Source License
public QueryCriteriaWidget(CITreeWidget widget) { HorizontalPanel panel = new HorizontalPanel(); panel.setWidth("100%"); this.treeWidget = widget; // Create input form.... //List l = new ArrayList(); final TextBox text = new TextBox(); text.setWidth("100%"); Label l = new Label("Search"); panel.clear();/*w ww. ja va2s.c om*/ panel.add(l); panel.add(text); panel.setCellWidth(text, "100%"); text.addKeyboardListener(new KeyboardListener() { public void onKeyDown(Widget sender, char keyCode, int modifiers) { // TODO Auto-generated method stub } public void onKeyPress(Widget sender, char keyCode, int modifiers) { if (keyCode == KeyboardListener.KEY_ENTER) { treeWidget.getTreeControl().setSearchText(text.getText()); treeWidget.reload(); } } public void onKeyUp(Widget sender, char keyCode, int modifiers) { // TODO Auto-generated method stub } }); /* l.add(new TextBoxInputItem(new TextBoxControl("Search", null, false), new ChangeListener() { public void onChange(Widget sender) { if (sender instanceof InputItem) { InputItem item = (InputItem)sender; crit.setText((String)item.getValue()); crit.setTextMatchAlias(true); crit.setTextMatchDescription(true); crit.setTextMatchValue(true); treeWidget.reload(); } } })); InputFormWidget input = new InputFormWidget(l); */ initWidget(panel); }
From source file:org.opencms.gwt.client.ui.input.colorpicker.CmsColorSelector.java
License:Open Source License
/** * Constructor to create an CmsColorPicker. <p> *//*from w ww . j ava 2 s . c om*/ public CmsColorSelector() { m_hue = 0; m_saturation = 100; m_brightness = 100; m_red = 255; m_green = 0; m_blue = 0; HorizontalPanel panel = new HorizontalPanel(); panel.addStyleName(I_CmsLayoutBundle.INSTANCE.colorSelectorCss().colorSelectorWidget()); FlexTable table = new FlexTable(); // Add the slider map m_slidermap = new CmsSliderMap(this); panel.add(m_slidermap); panel.setCellWidth(m_slidermap, "258px"); panel.setCellHeight(m_slidermap, "258px"); // Add the slider bar m_sliderbar = new CmsSliderBar(this); panel.add(m_sliderbar); panel.setCellWidth(m_sliderbar, "40px"); panel.setCellHeight(m_sliderbar, "258px"); m_colorpreview = new HTML(""); m_colorpreview.setWidth("auto"); m_colorpreview.setHeight("50px"); m_colorpreview.getElement().getStyle().setBorderColor("black"); m_colorpreview.getElement().getStyle().setBorderStyle(BorderStyle.SOLID); m_colorpreview.getElement().getStyle().setBorderWidth(1, Unit.PX); // Radio buttons m_rbHue = new CmsRadioButton("H:", "H:"); m_rbHue.setGroup(m_radioButtonGroup); m_rbHue.addClickHandler(this); m_rbSaturation = new CmsRadioButton("S:", "S:"); m_rbSaturation.setGroup(m_radioButtonGroup); m_rbSaturation.addClickHandler(this); m_rbBrightness = new CmsRadioButton("V:", "V:"); m_rbBrightness.setGroup(m_radioButtonGroup); m_rbBrightness.addClickHandler(this); m_rbRed = new CmsRadioButton("R:", "R:"); m_rbRed.setGroup(m_radioButtonGroup); m_rbRed.addClickHandler(this); m_rbGreen = new CmsRadioButton("G:", "G:"); m_rbGreen.setGroup(m_radioButtonGroup); m_rbGreen.addClickHandler(this); m_rbBlue = new CmsRadioButton("B:", "B:"); m_rbBlue.setGroup(m_radioButtonGroup); m_rbBlue.addClickHandler(this); // Textboxes m_tbHue = new TextBox(); m_tbHue.setText(new Integer(m_hue).toString()); m_tbHue.setMaxLength(3); m_tbHue.setVisibleLength(6); m_tbHue.addKeyPressHandler(this); m_tbHue.addChangeHandler(this); m_tbHue.addStyleName(I_CmsLayoutBundle.INSTANCE.colorSelectorCss().tableField()); m_tbSaturation = new TextBox(); m_tbSaturation.setText(new Integer(m_saturation).toString()); m_tbSaturation.setMaxLength(3); m_tbSaturation.setVisibleLength(6); m_tbSaturation.addKeyPressHandler(this); m_tbSaturation.addChangeHandler(this); m_tbSaturation.addStyleName(I_CmsLayoutBundle.INSTANCE.colorSelectorCss().tableField()); m_tbBrightness = new TextBox(); m_tbBrightness.setText(new Integer(m_brightness).toString()); m_tbBrightness.setMaxLength(3); m_tbBrightness.setVisibleLength(6); m_tbBrightness.addKeyPressHandler(this); m_tbBrightness.addChangeHandler(this); m_tbBrightness.addStyleName(I_CmsLayoutBundle.INSTANCE.colorSelectorCss().tableField()); m_tbRed = new TextBox(); m_tbRed.setText(new Integer(m_red).toString()); m_tbRed.setMaxLength(3); m_tbRed.setVisibleLength(6); m_tbRed.addKeyPressHandler(this); m_tbRed.addChangeHandler(this); m_tbRed.addStyleName(I_CmsLayoutBundle.INSTANCE.colorSelectorCss().tableField()); m_tbGreen = new TextBox(); m_tbGreen.setText(new Integer(m_green).toString()); m_tbGreen.setMaxLength(3); m_tbGreen.setVisibleLength(6); m_tbGreen.addKeyPressHandler(this); m_tbGreen.addChangeHandler(this); m_tbGreen.addStyleName(I_CmsLayoutBundle.INSTANCE.colorSelectorCss().tableField()); m_tbBlue = new TextBox(); m_tbBlue.setText(new Integer(m_blue).toString()); m_tbBlue.setMaxLength(3); m_tbBlue.setVisibleLength(6); m_tbBlue.addKeyPressHandler(this); m_tbBlue.addChangeHandler(this); m_tbBlue.addStyleName(I_CmsLayoutBundle.INSTANCE.colorSelectorCss().tableField()); m_tbHexColor = new TextBox(); m_tbHexColor.setText(m_stcolor); m_tbHexColor.setMaxLength(6); m_tbHexColor.setVisibleLength(6); m_tbHexColor.addKeyPressHandler(this); m_tbHexColor.addChangeHandler(this); m_tbHexColor.addStyleName(I_CmsLayoutBundle.INSTANCE.colorSelectorCss().tableField()); // Put together the FlexTable table.setWidget(0, 1, m_colorpreview); table.setWidget(1, 0, m_rbHue); table.setWidget(1, 1, m_tbHue); table.setWidget(1, 2, new HTML("°")); table.setWidget(2, 0, m_rbSaturation); table.setWidget(2, 1, m_tbSaturation); table.setText(2, 2, "%"); table.setWidget(3, 0, m_rbBrightness); table.setWidget(3, 1, m_tbBrightness); table.setText(3, 2, "%"); table.setWidget(4, 0, m_rbRed); table.setWidget(4, 1, m_tbRed); table.setWidget(5, 0, m_rbGreen); table.setWidget(5, 1, m_tbGreen); table.setWidget(6, 0, m_rbBlue); table.setWidget(6, 1, m_tbBlue); table.setText(7, 0, "Web:"); table.setWidget(7, 1, m_tbHexColor); table.setCellSpacing(3); // Final setup panel.add(table); m_radioButtonGroup.selectButton(m_rbRed); setPreview(m_stcolor); m_colorpreview.getElement().getStyle().setCursor(Cursor.DEFAULT); // First event onClick(m_radioButtonGroup.getSelectedButton()); initWidget(panel); }