/** * Render the cell located at <code>column</code>, <code>row</code> * * @param row * @param column * @param date * @param currentMonth */ private void drawCell(int row, int column, Date date, int currentMonth) { final Label header = new Label(dayFormatter.format(date)); header.addStyleName("calendar-cell-header"); final FlexTable grid = (FlexTable) getWidget(); grid.getCellFormatter().setStyleName(row, column, "calendar-cell"); FlowPanel cell = (FlowPanel) grid.getWidget(row, column); if (cell == null) { // New cell cell = new FlowPanel(); cell.setWidth("100%"); grid.setWidget(row, column, cell); } else { // Reusing an existing cell cell.clear(); } if (currentMonth != date.getMonth()) grid.getCellFormatter().addStyleName(row, column, "calendar-cell-other-month"); if (date.equals(today)) grid.getCellFormatter().addStyleName(row, column, "calendar-cell-today"); cell.add(header); }
public GameControlPanel() { super(); childPanel = new FlowPanel(); childPanel.setHeight("100%"); childPanel.setWidth("100%"); super.add(childPanel); this.setStyleName("control_game_panel"); this.initKeyModifierHandlers(); this.setFocus(true); Window.addResizeHandler( new ResizeHandler() { @Override public void onResize(ResizeEvent event) { GameControlPanel.this.onResize(); } }); }
/** * Creates a new debugger for the given editor. * * @param editor The WYSIWYG editor being debugged. */ public WysiwygEditorDebugger(WysiwygEditor editor) { this.editor = editor; FlowPanel panel = new FlowPanel(); panel.setWidth("100%"); panel.add(editor.getUI()); String width = "400px"; String height = "220px"; dirtyHTMLTextArea = new TextArea(); dirtyHTMLTextArea.setWidth(width); dirtyHTMLTextArea.setHeight(height); panel.add(dirtyHTMLTextArea); cleanHTMLTextArea = new TextArea(); cleanHTMLTextArea.setWidth(width); cleanHTMLTextArea.setHeight(height); panel.add(cleanHTMLTextArea); wikiTextArea = new TextArea(); wikiTextArea.setWidth(width); wikiTextArea.setHeight(height); panel.add(wikiTextArea); eventsTextArea = new TextArea(); eventsTextArea.setWidth(width); eventsTextArea.setHeight(height); panel.add(eventsTextArea); // get the transformed HTML Content dirtyHTMLTextArea.setText(editor.getRichTextEditor().getTextArea().getHTML()); initWidget(panel); timer = new Timer(); timer.addTimerListener(this); timer.scheduleRepeating(4000); }
/** * Internal helper method for initializing the layout of this widget. * * <p> */ private void init() { int decorationWidth = getDecorationWidth(); m_decorationBox.setWidth(decorationWidth + "px"); m_primary.getElement().getStyle().setMarginLeft(decorationWidth, Style.Unit.PX); }