private Widget createPanel() { VerticalLayoutContainer container = new VerticalLayoutContainer(); container.setScrollMode(ScrollMode.AUTO); container.setSize("450px", "160px"); Label bboxLabel = new Label("Bbox (" + UIMessages.INSTANCE.lowerLeftXField() + ", " + UIMessages.INSTANCE.lowerLeftYField() + ", " + UIMessages.INSTANCE.upperRightXField() + ", " + UIMessages.INSTANCE.upperRightYField() + ")"); bboxLabel.getElement().getStyle().setFontWeight(FontWeight.BOLD); container.add(bboxLabel); bboxField = new TextField(); bboxField.setEmptyText(UIMessages.INSTANCE.bboxFieldCustomExtent()); bboxField.setWidth("450px"); container.add(bboxField); return container; }
public ShoppingCartSettingsForm(ShoppingCart cart, FormEditMode mode) { _mode = mode; _vp = new VerticalPanel(); _vp.fitToParent(); _tabIds = new HashMap<String, Integer>(); _tp = new TabPanel() { protected void activated(int id) { LAST_ACTIVE_TAB_ID = id; } }; _tp.fitToParent(); _vp.add(_tp); SimplePanel sp = new SimplePanel(); sp.setHeight(20); sp.setWidth100(); _sb = new HTML(); _sb.setColour(RGB.RED); _sb.setFontFamily("Helvetica"); _sb.setFontWeight(FontWeight.BOLD); _sb.setFontSize(12); sp.setContent(_sb); _vp.add(sp); if (_mode != FormEditMode.READ_ONLY) { addChangeListener(new StateChangeListener() { @Override public void notifyOfChangeInState() { Validity v = valid(); if (!v.valid()) { _sb.setHTML(v.reasonForIssue()); } else { _sb.clear(); } } }); } setCart(cart); }
private static Widget headerFor(DObject o) { String text = StringUtil.upperCaseFirst(o.type().toString()); if (o.id() != null) { text += " - " + o.id(); } Label label = new Label(text); label.setFontSize(12); label.setFontWeight(FontWeight.BOLD); CenteringPanel cp = new CenteringPanel(Axis.BOTH); cp.setWidth100(); cp.setHeight(20); cp.setMarginTop(1); cp.setBorderTop(1, BorderStyle.SOLID, new RGB(221, 221, 221)); cp.setBorderLeft(1, BorderStyle.SOLID, new RGB(221, 221, 221)); cp.setBorderRight(1, BorderStyle.SOLID, new RGB(221, 221, 221)); cp.setBorderRadiusTopLeft(5); cp.setBorderRadiusTopRight(5); cp.setBackgroundImage( new LinearGradient(LinearGradient.Orientation.TOP_TO_BOTTOM, new RGB(221, 221, 221), new RGB(204, 204, 204))); cp.add(label); return cp; }
public TabButton(String tabName, boolean selected) { setHeight100(); setWidth(tabName.length() * FONT_SIZE + 10); setBackgroundImage(new LinearGradient(LinearGradient.Orientation.TOP_TO_BOTTOM, TAB_COLOR_LIGHT, TAB_COLOR)); setOpacity(0.7); setBorderRadiusTopLeft(BORDER_RADIUS); setBorderRadiusTopRight(BORDER_RADIUS); setMarginRight(3); setMarginTop(3); _tabName = tabName; _html = new HTML(tabName); _html.setFontSize(FONT_SIZE); _html.setFontFamily(FONT_FAMILY); _html.setFontWeight(FontWeight.NORMAL); _html.setTextAlignment(TextAlignment.CENTER); _html.setPaddingTop(3); _html.fitToParent(); setContent(_html); _selected = selected; }
public final void styleToElementBackgroundToTd(Element aElement) { if (aElement != null) { Style eStyle = aElement.getStyle(); if (getBackground() != null){ Element td = aElement; while(td != null && !"td".equalsIgnoreCase(td.getTagName())){ td = td.getParentElement(); } if(td != null){ td.getStyle().setBackgroundColor(getBackground().toStyled()); } } if (getForeground() != null) { eStyle.setColor(getForeground().toStyled()); } if (getFont() != null) { eStyle.setFontSize(getFont().getSize(), Unit.PT); eStyle.setFontStyle(getFont().isItalic() ? FontStyle.ITALIC : FontStyle.NORMAL); eStyle.setFontWeight(getFont().isBold() ? FontWeight.BOLD : FontWeight.NORMAL); } } }
public Object addGroup( String display, String name, Object parent ) { int row = display != null ? table.getRowCount() : -1; // create the new group GroupInfo parentInfo = (GroupInfo) parent; GroupInfo info = new GroupInfo( name, parentInfo, row ); // display the new group if( display != null && row >= 0 ) { table.setHTML( row, 0, display ); table.getCellFormatter().getElement( row, 0 ).getStyle().setVerticalAlign( VerticalAlign.TOP ); table.getCellFormatter().getElement( row, 0 ).setAttribute( "colSpan", "2" ); table.getCellFormatter().getElement( row, 0 ).getStyle().setPaddingTop( 25, Unit.PX ); table.getCellFormatter().getElement( row, 0 ).getStyle().setPaddingBottom( 10, Unit.PX ); table.getCellFormatter().getElement( row, 0 ).getStyle().setFontWeight( FontWeight.BOLD ); } return info; }
public Object addField( String display, String name, FieldType fieldType, Widget fieldWidget, Object parent ) { int row = table.getRowCount(); // create the new field GroupInfo parentInfo = (GroupInfo) parent; FieldInfo info = new FieldInfo( name, parentInfo, row, fieldType, fieldWidget ); // Display the new field if( display != null ) { HTMLStream stream = new HTMLStream(); stream.addRight( new HTML( display ) ); stream.clFl(); table.setWidget( row, 0, stream ); } table.setWidget( row, 1, info.widget ); table.getCellFormatter().getElement( row, 0 ).getStyle().setVerticalAlign( VerticalAlign.TOP ); table.getCellFormatter().getElement( row, 1 ).getStyle().setVerticalAlign( VerticalAlign.TOP ); table.getCellFormatter().getElement( row, 0 ).getStyle().setFontWeight( FontWeight.BOLD ); return info; }
private void ensureCurPar() { if( currentParagraph == null ) { currentParagraph = DOM.createSpan(); div.appendChild( currentParagraph ); for( Entry<String, String> e : curSet.entrySet() ) { if( e.getKey().equals( "color" ) ) currentParagraph.getStyle().setColor( e.getValue() ); else if( e.getKey().equals( "weight" ) ) currentParagraph.getStyle().setFontWeight( FontWeight.valueOf( e.getValue() ) ); else currentParagraph.getStyle().setProperty( e.getKey(), e.getValue() ); } } }
public void setActiveLink(String text) { Anchor oldActiveLink = activeLink; for (Anchor link : linkMap.keySet()){ if (linkMap.get(link).equals(text)) { if (activeLink != link) { link.getElement().getStyle().setFontWeight(FontWeight.BOLD); activeLink = link; break; } else return; } } if (oldActiveLink != null) { oldActiveLink.getElement().getStyle().setFontWeight(FontWeight.NORMAL); } }
public void setDump(ThreadDump threadDump) { textArea.setText(threadDump.getDump()); int i = 1; for (ThreadInfo ti : threadDump.getThreads()) { ft.setText(i, 0, ti.getName()); ft.setText(i, 1, "" + ti.getId()); ft.setText(i, 2, ti.getState()); if ("BLOCKED".equalsIgnoreCase(ti.getState())) { Style style = ft.getFlexCellFormatter().getElement(i, 2).getStyle(); style.setBackgroundColor("#C00000"); style.setFontWeight(FontWeight.BOLDER); style.setColor("white"); } i++; } }
private void alertButtonClicked(String attribute, int timeLeft) { Style style = alertImg.getElement().getStyle(); if ("1".equals(attribute)) { alertImg.getElement().setAttribute("state", "2"); style.setColor("red"); style.setFontWeight(FontWeight.BOLDER); alertImg.setTitle("Continue Alerts, time left for auto-enable: " + timeLeft + " min."); alertImg.setResource(resources.continueAlerts()); } else { alertImg.getElement().setAttribute("state", "1"); style.setColor("black"); style.setFontWeight(FontWeight.NORMAL); alertImg.setTitle("Stop Alerts"); alertImg.setResource(resources.stopAlerts()); } }
public AnnouncementPanel(Announcement o) { fitToParent(); setPaddingTop(10); setPaddingLeft(30); setPaddingRight(30); setPaddingBottom(10); Label title = new Label("Announcement " + o.uid() + ": " + o.title()); title.setFontWeight(FontWeight.BOLD); title.setFontSize(12); title.setHeight(20); add(title); Label date = new Label("Date: " + DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss") .format(o.created())); date.setFontSize(11); date.setHeight(20); add(date); HTML text = new HTML( "<div style=\"line-height:150%;text-align:justify;\">" + o.text() + "</div>"); text.setFontFamily("sans-serif"); text.setFontSize(12); text.fitToParent(); ScrollPanel sp = new ScrollPanel(text, ScrollPolicy.AUTO); sp.fitToParent(); add(sp); }
public TransformForm(TransformBuilder tb) { _tb = tb; _vp = new VerticalPanel(); _vp.fitToParent(); _formSP = new SimplePanel(); _formSP.fitToParent(); _vp.add(_formSP); _sb = new HTML(); _sb.setColour(RGB.RED); _sb.setFontFamily("Helvetica"); _sb.setFontWeight(FontWeight.BOLD); _sb.setFontSize(12); _sb.setHeight(20); _sb.setMarginLeft(20); _vp.add(_sb); addChangeListener(new StateChangeListener() { @Override public void notifyOfChangeInState() { Validity v = valid(); if (!v.valid()) { _sb.setHTML(v.reasonForIssue()); } else { _sb.clear(); } } }); updateForm(); }
protected DObjectForm(DObjectBuilder<T> builder, T object, FormEditMode mode) { _builder = builder; _object = object; _mode = mode; if (_mode != FormEditMode.READ_ONLY) { _xcs = new ArrayList<CanSaveToXml>(); } _vp = new VerticalPanel(); _vp.fitToParent(); if (_mode == FormEditMode.READ_ONLY) { _vp.add(new TitlePanel(title())); } _tp = new TabPanel(); _tp.fitToParent(); _tabIds = new HashMap<String, Integer>(); _vp.add(_tp); _statusBar = new HTML(); _statusBar.setHeight(20); _statusBar.setWidth100(); _statusBar.setPaddingLeft(20); _statusBar.setFontSize(12); _statusBar.setFontWeight(FontWeight.BOLD); _statusBar.setColour(RGB.RED); if (_mode != FormEditMode.READ_ONLY) { _vp.add(_statusBar); } updateInterfaceTab(); updateMetadataTab(); if (_mode == FormEditMode.READ_ONLY) { updateAttachmentTab(); if (!(_object instanceof Repository)) { updateThumbnailTab(); } } }
public TokenPasswordSetForm() { _vp = new VerticalPanel(); _vp.fitToParent(); Form form = new Form(FormEditMode.UPDATE); form.setMarginTop(20); form.setMarginLeft(20); _passwordField1 = new Field<String>(new FieldDefinition("Token Password", "token password", new PasswordType(6, 20, PasswordType.DEFAULT_DISPLAY_LENGTH), "Token password", null, 1, 1)); form.add(_passwordField1); _passwordField2 = new Field<String>(new FieldDefinition("Confirm Password", "confirm password", new PasswordType(6, 20, PasswordType.DEFAULT_DISPLAY_LENGTH), "Confirm password", null, 1, 1)); form.add(_passwordField2); form.render(); addMustBeValid(form); _status = new HTML(); _status.setColour(RGB.RED); _status.setFontWeight(FontWeight.BOLD); _status.setPaddingLeft(20); _status.setHeight(22); _vp.add(form); _vp.add(_status); }
public final void styleToElement(Element aElement) { if (aElement != null) { Style eStyle = aElement.getStyle(); if (getBackground() != null) eStyle.setBackgroundColor(getBackground().toStyled()); if (getForeground() != null) { eStyle.setColor(getForeground().toStyled()); } if (getFont() != null) { eStyle.setFontSize(getFont().getSize(), Unit.PT); eStyle.setFontStyle(getFont().isItalic() ? FontStyle.ITALIC : FontStyle.NORMAL); eStyle.setFontWeight(getFont().isBold() ? FontWeight.BOLD : FontWeight.NORMAL); } } }
void applyStyle( Element element ) { element.getStyle().setPadding( 5, Unit.PX ); element.getStyle().setBorderColor( "black" ); element.getStyle().setBorderStyle( BorderStyle.SOLID ); element.getStyle().setBorderWidth( 1, Unit.PX ); element.getStyle().setProperty( "fontFamily", "Arial Unicode MS,Arial,sans-serif" ); element.getStyle().setFontSize( 12, Unit.PT ); element.getStyle().setFontStyle( FontStyle.NORMAL ); element.getStyle().setFontWeight( FontWeight.NORMAL ); }
public HTMLStream bold( boolean fOn ) { if( fOn ) curSet.put( "weight", FontWeight.BOLD.name() ); else curSet.put( "weight", FontWeight.NORMAL.name() ); return this; }
@Inject private MeetingWidgetPlace( AssistedObjectHandlerFactory handlerFactory, ObjectFinder objectFinder) { this.objectFinder = objectFinder; this.handlerFactory = handlerFactory; html = new HTML(); html.getElement().getStyle().setFontWeight(FontWeight.BOLD); html.getElement().getStyle().setPaddingTop(3, Unit.PX); }
@Inject private ContactWidgetPlace( ObjectFinder objectFinder, ContactHandlerFactory contactHandlerFactory) { this.objectFinder = objectFinder; this.contactHandlerFactory = contactHandlerFactory; html = new HTML(); html.getElement().getStyle().setFontWeight(FontWeight.BOLD); html.getElement().getStyle().setPaddingTop(3, Unit.PX); }
public void setCurrent(int visibility) { publicLink.getElement().getStyle().setFontWeight(FontWeight.NORMAL); friendLink.getElement().getStyle().setFontWeight(FontWeight.NORMAL); privateLink.getElement().getStyle().setFontWeight(FontWeight.NORMAL); socomLink.getElement().getStyle().setFontWeight(FontWeight.NORMAL); switch(visibility){ case Visibility.PUBLIC : publicLink.getElement().getStyle().setFontWeight(FontWeight.BOLD);break; case Visibility.PRIVATE : privateLink.getElement().getStyle().setFontWeight(FontWeight.BOLD);break; case Visibility.FRIENDS : friendLink.getElement().getStyle().setFontWeight(FontWeight.BOLD);break; case Visibility.SOCOM_INTERN : socomLink.getElement().getStyle().setFontWeight(FontWeight.BOLD);break; } }
public CertificatesPopup(HashMap<String, List<Certificate>> result) { setAnimationEnabled(true); setAutoHideEnabled(true); setModal(true); setSize(Window.getClientWidth() - 50 + "px", "200px"); ft.getElement().setId("infoTable"); ft.setCellPadding(0); ft.setCellSpacing(0); ft.setText(0, 0, "Domain"); ft.setText(0, 1, "Certificate"); ft.setText(0, 2, "Alert Raised"); ft.getRowFormatter().getElement(0).setId("th"); ft.setWidth("100%"); fp.add(ft); setWidget(fp); center(); int i = 1; for (String key : result.keySet()) { Label l = new Label(key); l.getElement().getStyle().setFontWeight(FontWeight.BOLDER); ft.setWidget(i, 0, l); ft.setText(i, 1, ""); ft.setText(i, 2, ""); i++; Log.debug("Certificate:" + result.get(key)); for (Certificate c : result.get(key)) { ft.setText(i, 0, c.getCommonName()); ft.setText(i, 1, c.toString()); ft.setText(i, 2, "" + c.isAlertRaised()); i++; } } int left = (Window.getClientWidth() - getOffsetWidth()) >> 1; setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), 26); }
public void setActive(boolean active) { this.active = active; nodeLabel.getElement().getStyle().setFontWeight(active ? FontWeight.BOLD : FontWeight.NORMAL); if (hasRemoveButton) { clearButton.setVisible(active); } }
@Override public void setFontWeight(FontWeight fontWeight) { getElement().getStyle().setFontWeight(fontWeight); }
protected CssNameMixin<MaterialWidget, FontWeight> getFontWeightMixin() { if (fontWeightMixin == null) { fontWeightMixin = new CssNameMixin<>(this); } return fontWeightMixin; }
private Map<String, String> provisionColors( JsArray<Participant> participants) { Participant user = this.getWave().getViewer(); Injector.INSTANCE.game() .setResponder((user != null) ? user.getId() : null); HashMap<String, String> colors = new HashMap<String, String>(); colors.put(user.getId(), "black"); userList.removeAllRows(); Label l = new Label("Players:"); l.getElement().getStyle().setFontWeight(FontWeight.BOLD); userList.setWidget(0, 0, l); int count = 1; int colorIndex = 0; l = new Label(user.getDisplayName()); l.getElement().getStyle().setColor("black"); userList.setWidget(1, 0, l); for (int i = 0; i < participants.length(); i++) { Participant p = participants.get(i); if (p.getId().equals(user.getId())) { continue; } colors.put(p.getId(), COLORS[colorIndex]); l = new Label(p.getDisplayName()); l.getElement().getStyle().setColor(COLORS[colorIndex]); count++; userList.setWidget(count, 0, l); colorIndex++; if (colorIndex == COLORS.length) { colorIndex = 0; } } return colors; }
public Builder withFontWeight(FontWeight fontWeight) { this.fontWeight = fontWeight; return this; }
public static void show(String message, final ActionEntry ae) { if (!_visible) { WindowProperties wp = new WindowProperties(); wp.setModal(true); wp.setCanBeResized(false); wp.setCanBeClosed(false); wp.setCanBeMoved(false); wp.setSize(0.4, 0.4); wp.setTitle("DaRIS Portal"); wp.setShowHeader(false); wp.setShowFooter(false); _win = Window.create(wp); } HTML content = new HTML(); content.setFontStyle(FontStyle.NORMAL); content.setFontSize(12); content.setFontWeight(FontWeight.BOLD); content.setHTML(message); content.setMargin(20); CenteringPanel cp = new CenteringPanel(); cp.setContent(content); cp.setBackgroundColour(new RGB(0xb2, 0xb2, 0xb2)); VerticalPanel vp = new VerticalPanel(); vp.fitToParent(); vp.add(cp); if (ae != null) { ButtonBar bb = ButtonUtil.createButtonBar(Position.BOTTOM, Alignment.RIGHT, 28); Button b = bb.addButton(ae.label()); b.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (ae.action() != null) { ae.action().execute(); } } }); b.setMarginRight(15); vp.add(bb); } _win.setContent(vp); _win.centerInPage(); _win.show(); _visible = true; }
public ShoppingCartForm(ShoppingCart cart, FormEditMode mode, boolean showHeader) { _mode = mode; _vp = new VerticalPanel(); _vp.fitToParent(); /* * header */ if (showHeader) { CenteringPanel headerSP = new CenteringPanel(); headerSP.setWidth100(); headerSP.setHeight(20); headerSP.setBackgroundImage(new LinearGradient(LinearGradient.Orientation.TOP_TO_BOTTOM, ListGridHeader.HEADER_COLOUR_LIGHT, ListGridHeader.HEADER_COLOUR_DARK)); _header = new HTML(); _header.fitToParent(); _header.setFontSize(11); _header.setFontWeight(FontWeight.BOLD); headerSP.setContent(_header); _vp.add(headerSP); } /* * tabs */ _tp = new TabPanel() { protected void activated(int id) { _activeTabId = id; if (_activeTabId == _contentsTabId) { contentsTabActivated(); } if (_activeTabId == _settingsTabId) { settingsTabActivated(); } } }; _tp.fitToParent(); _tp.setBodyBorder(1, BorderStyle.SOLID, new RGB(0x97, 0x97, 0x97)); /* * content tab */ _contentsForm = new ShoppingCartContentsForm(null, _mode); _contentsTabId = _tp.addTab(TAB_NAME_CONTENTS, null, _contentsForm.gui()); addMustBeValid(_contentsForm); /* * settings tab */ _settingsForm = new ShoppingCartSettingsForm(null, _mode); _settingsTabId = _tp.addTab(TAB_NAME_SETTINGS, null, _settingsForm.gui()); addMustBeValid(_settingsForm); _tp.setActiveTabById(_contentsTabId); _vp.add(_tp); setCart(cart); }
private static void display(Type type, final BasePoint bp, String title, String message, int seconds) { if (_pp != null) { _pp.hide(); } _pp = new PopupPanel(); _pp.setAutoHideEnabled(true); // _pp.setWidth(MIN_WIDTH); // _pp.setHeight(MIN_HEIGHT); VerticalPanel vp = new VerticalPanel(); vp.fitToParent(); vp.setPadding(5); vp.setOpacity(0.9); vp.setBackgroundColour(new RGB(0x99, 0x99, 0x99)); vp.setBorder(1, new RGB(0xee, 0xee, 0xee)); vp.setBorderRadius(3); HorizontalPanel hp1 = new HorizontalPanel(); hp1.setHeight(22); hp1.setPaddingLeft(5); vp.add(hp1); HTML titleHtml = new HTML(title); titleHtml.setHeight100(); titleHtml.setFontSize(12); titleHtml.setFontWeight(FontWeight.BOLD); hp1.add(titleHtml); HorizontalPanel hp2 = new HorizontalPanel(); hp2.fitToParent(); vp.add(hp2); Image icon = iconFor(type); hp2.add(icon); HTML messageHtml = new HTML(message); hp2.add(messageHtml); _pp.setContent(vp); _pp.setPopupPositionAndShow(new PositionCallback() { @Override public void setPosition(int offsetWidth, int offsetHeight) { int clientWidth = com.google.gwt.user.client.Window.getClientWidth(); int clientHeight = com.google.gwt.user.client.Window.getClientHeight(); int tlx = bp.topLeftX(offsetWidth, offsetHeight, clientWidth, clientHeight); int tly = bp.topLeftY(offsetWidth, offsetHeight, clientWidth, clientHeight); _pp.setPopupPosition(tlx, tly); } }); _pp.show(); final PopupPanel pp = _pp; Timer timer = new Timer() { @Override public void run() { pp.hide(); cancel(); } }; timer.schedule(seconds * 1000); }
public void setSelected(boolean selected) { setOpacity(selected ? 1.0 : 0.7); _html.setFontWeight(selected ? FontWeight.BOLD : FontWeight.NORMAL); _selected = selected; }
protected void onSelect() { setBackgroundImage(new LinearGradient(LinearGradient.Orientation.TOP_TO_BOTTOM, TAB_COLOUR_DARK, TAB_COLOUR_SELECTED)); _titleHTML.setFontWeight(FontWeight.NORMAL); }
protected void onDeselect() { setBackgroundImage(new LinearGradient(LinearGradient.Orientation.TOP_TO_BOTTOM, TAB_COLOUR, TAB_COLOUR_DARK)); _titleHTML.setFontWeight(FontWeight.LIGHTER); }
protected void buildNodes(List<HeaderNode<T>> aHeaders, Map<Column<T, ?>, ColumnSortList.ColumnSortInfo> sortedColumns) { // AbstractCellTable<T> table = getTable(); List<HeaderNode<T>> children = new ArrayList<>(); boolean isFooter = isBuildingFooter(); // Get the common style names. String className = isBuildingFooter() ? ThemedGridResources.instance.cellTableStyle().cellTableFooter() : ThemedGridResources.instance.cellTableStyle().cellTableHeader(); String sortableStyle = ThemedGridResources.instance.cellTableStyle().cellTableSortableHeader(); String sortedAscStyle = ThemedGridResources.instance.cellTableStyle().cellTableSortedHeaderAscending(); String sortedDescStyle = ThemedGridResources.instance.cellTableStyle().cellTableSortedHeaderDescending(); TableRowBuilder tr = startRow(); // Loop through all column header nodes. for (int i = 0; i < aHeaders.size(); i++) { HeaderNode<T> headerNode = aHeaders.get(i); children.addAll(headerNode.getChildren()); Header<?> headerOrFooter = headerNode.getHeader(); Column<T, ?> column = null; if (headerOrFooter instanceof HasColumn<?>) column = ((HasColumn<T>) headerOrFooter).getColumn(); boolean isSortable = !isFooter && column != null && column.isSortable(); ColumnSortList.ColumnSortInfo sortedInfo = sortedColumns.get(column); boolean isSorted = sortedInfo != null; StringBuilder classesBuilder = new StringBuilder(className); boolean isSortAscending = isSortable && sortedInfo != null ? sortedInfo.isAscending() : false; if (isSortable) { if (classesBuilder.length() > 0) { classesBuilder.append(" "); } classesBuilder.append(sortableStyle); if (isSorted) { if (classesBuilder.length() > 0) { classesBuilder.append(" "); } classesBuilder.append(isSortAscending ? sortedAscStyle : sortedDescStyle); } } // Render the header or footer. TableCellBuilder th = tr.startTH(); if (headerNode.getDepthRemainder() > 0) th.rowSpan(headerNode.getDepthRemainder() + 1); if (headerNode.getLeavesCount() > 1) th.colSpan(headerNode.getLeavesCount()); th.className(classesBuilder.toString()); StylesBuilder thStyles = th.style(); if (headerNode.getBackground() != null) { thStyles.trustedBackgroundColor(headerNode.getBackground().toStyled()); } if (headerNode.getForeground() != null) { thStyles.trustedColor(headerNode.getForeground().toStyled()); } if (headerNode.getFont() != null) { thStyles.trustedProperty("font-family", headerNode.getFont().getFamily()); thStyles.fontSize(headerNode.getFont().getSize(), Style.Unit.PX); thStyles.fontStyle(headerNode.getFont().isItalic() ? FontStyle.ITALIC : FontStyle.NORMAL); thStyles.fontWeight(headerNode.getFont().isBold() ? FontWeight.BOLD : FontWeight.NORMAL); } if (headerOrFooter != null) { appendExtraStyles(headerOrFooter, classesBuilder); if (column != null) { enableColumnHandlers(th, column); } // Build the header. Cell.Context context = new Cell.Context(0, i, headerOrFooter.getKey()); // Add div element with aria button role if (isSortable) { // TODO: Figure out aria-label and translation // of label text th.attribute("role", "button"); th.tabIndex(-1); } renderSortableHeader(th, context, headerOrFooter, isSorted, isSortAscending); } th.endTH(); } // End the row. tr.endTR(); if (!children.isEmpty()) { buildNodes(children, sortedColumns); } }
public RegenerateTextDialog() { super(); setStyleName("exchangePanel"); VerticalPanel panel = new VerticalPanel(); panel.setSpacing(5); panel.setSize("100%", "100%"); setWidget(panel); Label title = new Label(appConstants.menuRefreshParagraphsText()); panel.add(title); panel.setCellWidth(title,"100%"); panel.setCellHeight(title,"1%"); title = new Label(appConstants.menuRefreshParagraphsTextWarning()); title.getElement().getStyle().setColor("red"); title.getElement().getStyle().setFontWeight(FontWeight.BOLD); panel.add(title); panel.setCellWidth(title,"100%"); panel.setCellHeight(title,"1%"); title = new Label(appConstants.menuRefreshParagraphsStatus()); panel.add(title); status = new StatusPicker(); panel.add(status); ClickHandler listener = new ClickHandler() { public void onClick(ClickEvent event) { if (event.getSource()==doButton) { MaskPanel.show(); DeferredCommand.addCommand(new Command(){ public void execute() { //TODO } }); } else { //cancel hide(); } } }; HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setSpacing(5); horizontalPanel.setSize("100%", "100%"); doButton = new Button(appConstants.buttonRegenerate(),listener); horizontalPanel.add(doButton); horizontalPanel.setCellWidth(doButton,"1%"); Button button = new Button(appConstants.buttonClose(),listener); horizontalPanel.add(button); horizontalPanel.setCellWidth(button,"99%"); panel.add(horizontalPanel); panel.setCellWidth(horizontalPanel,"100%"); panel.setCellHeight(horizontalPanel,"1%"); }
public GadgetSelectWidget(ActionsWidget actionWidget) { this.actionWidget = actionWidget; initGridWidget(); VerticalPanel sharedGadgetPanel = new VerticalPanel(); Label sharedGadgetsLabel = new Label("Content Shared with You"); sharedGadgetsLabel.getElement().getStyle().setMarginBottom(10, Unit.PX); sharedGadgetsLabel.getElement().getStyle().setFontWeight(FontWeight.BOLD); sharedGadgetPanel.add(sharedGadgetsLabel); sharedGadgetPanel.add(sharedGadgetGrid); contentPanel.add(sharedGadgetPanel); VerticalPanel companyGadgetPanel = new VerticalPanel(); Label companyGadgetsLabel = new Label("Your Content"); companyGadgetsLabel.getElement().getStyle().setMarginBottom(10, Unit.PX); companyGadgetsLabel.getElement().getStyle().setFontWeight(FontWeight.BOLD); companyGadgetPanel.add(companyGadgetsLabel); companyGadgetPanel.add(companyGadgetGrid); contentPanel.add(companyGadgetPanel); VerticalPanel urlPanel = new VerticalPanel(); Label byUrlGadgetsLabel = new Label("Content by URL"); byUrlGadgetsLabel.getElement().getStyle().setMarginBottom(10, Unit.PX); byUrlGadgetsLabel.getElement().getStyle().setFontWeight(FontWeight.BOLD); urlPanel.add(byUrlGadgetsLabel); FormGridWidget urlGrid = new FormGridWidget(2, 2); urlGrid.addStyleName("rdn-VerticalSpacer"); urlGrid.addRow("Type:", gadgetType); urlGrid.addRow("URL:", urlTextBox); urlPanel.add(urlGrid); urlPanel.setHeight("210px"); contentPanel.add(urlPanel); contentPanel.showWidget(0); mainPanel.add(statusBox); mainPanel.add(formValidator); mainPanel.add(contentPanel); // mainPanel.setCellHeight(contentPanel, "210px"); styleControls(); initWidget(mainPanel); }
private void styleText(Widget widget) { // widget.getElement().getStyle().setFontSize(13, Unit.PX); widget.getElement().getStyle().setFontWeight(FontWeight.BOLDER); }
public DataSetCreateForm(ImportTask task, DObjectRef po) { _task = task; _po = po; _vp = new VerticalPanel(); _vp.fitToParent(); _tp = new TabPanel(); _tp.fitToParent(); _vp.add(_tp); _statusLabel = new Label(); _statusLabel.setHeight(20); _statusLabel.setWidth100(); _statusLabel.setPaddingLeft(20); _statusLabel.setFontSize(12); _statusLabel.setFontWeight(FontWeight.BOLD); _statusLabel.setColour(RGB.RED); _vp.add(_statusLabel); /* * Interface tab */ VerticalSplitPanel interfaceVSP = new VerticalSplitPanel(); interfaceVSP.fitToParent(); _interfaceSP = new SimplePanel(); _interfaceSP.fitToParent(); interfaceVSP.add(_interfaceSP); _interfaceForm = createInterfaceForm(); addInterfaceFormItems(_interfaceForm); _interfaceForm.render(); addMustBeValid(_interfaceForm); _interfaceSP .setContent(new ScrollPanel(_interfaceForm, ScrollPolicy.AUTO)); _fileForm = new LocalFileForm(LocalFile.Filter.ANY, false, _task.files()); _fileForm.setWidth100(); _fileForm.setPreferredHeight(0.35); _fileForm.addChangeListener(new StateChangeListener() { @Override public void notifyOfChangeInState() { _task.setFiles(_fileForm.files()); } }); addMustBeValid(_fileForm); interfaceVSP.add(_fileForm); _interfaceTabId = _tp.addTab("Interface", null, interfaceVSP); _tp.setActiveTabById(_interfaceTabId); /* * Metadata tab */ _metadataForm = new MetadataSetForm(null); _metadataTabId = _tp.addTab("Metadata", null, (BaseWidget) _metadataForm.gui()); }