List of usage examples for com.google.gwt.user.client.ui Widget addStyleName
public void addStyleName(String style)
From source file:org.synthful.gwt.widgets.client.ui.UITabLayoutPanel.java
License:Apache License
private void layoutChild(Widget child) { panel.setWidgetLeftRight(child, 0, Unit.PX, 0, Unit.PX); panel.setWidgetTopBottom(child, barHeight, barUnit, 0, Unit.PX); panel.getWidgetContainerElement(child).getStyle().setDisplay(Display.NONE); child.addStyleName(CONTENT_STYLE); child.setVisible(false);//from w w w .j ava2 s . c om }
From source file:org.thechiselgroup.biomixer.client.core.ui.DialogPanel.java
License:Apache License
public void setContent(Widget contentWidget) { assert contentWidget != null; this.contentWidget = contentWidget; contentWidget.addStyleName(CSS_DIALOG_PANEL_CONTENT); contentTD.appendChild(contentWidget.getElement()); adopt(contentWidget);// w w w. j a va 2 s. c o m }
From source file:org.uberfire.client.views.pfly.dnd.CompassWidgetImpl.java
License:Apache License
private void highlightActiveDropTarget(final Widget target) { south.removeStyleName(FA_ACTIVE); north.removeStyleName(FA_ACTIVE); west.removeStyleName(FA_ACTIVE); east.removeStyleName(FA_ACTIVE); centre.removeStyleName(FA_ACTIVE); if (target != null) { target.addStyleName(FA_ACTIVE); }//from w ww .j a v a2 s .co m }
From source file:org.uberfire.client.views.pfly.multipage.MultiPageEditorViewImpl.java
License:Apache License
@Override public void disablePage(int index) { if (!isValid(index)) { return;//w ww.ja v a 2 s . c o m } final Widget tab = getTabBar().getWidget(index); tab.addStyleName("disabled"); disableWidget(tab); }
From source file:org.uberfire.client.workbench.panels.impl.SplitLayoutPanelView.java
License:Apache License
@Override public void addPanel(PanelDefinition panel, WorkbenchPanelView view, Position position) { if (CompassPosition.WEST.equals(position)) { Widget widget = view.asWidget(); widget.addStyleName("split-west"); // HAL specific westPanel.add(widget);/*from www .ja v a 2 s . c om*/ } else if (CompassPosition.CENTER.equals(position)) { if (activePanel != null) { // close active parts of current panel for (PartDefinition part : ensureIterable(activePanel.getK1().getParts())) { placeManager.closePlace(part.getPlace()); } } Widget widget = view.asWidget(); widget.addStyleName("split-center"); // HAL specific centerPanel.clear(); centerPanel.add(widget); activePanel = new Pair<PanelDefinition, Widget>(panel, widget); } else { throw new IllegalArgumentException("Unsupported position directive: " + position); } }
From source file:org.uberfire.client.workbench.WorkbenchLayoutImpl.java
License:Apache License
@Override public void maximize(final Widget w) { if (maximizedWidgetOriginalStyles.get(w) != null) { return;// w w w . j av a 2 s . co m } // this allows application-specified background colour, animation, borders, etc. w.addStyleName(UF_MAXIMIZED_PANEL); new ExpandAnimation(w, maximizedWidgetOriginalStyles, perspectiveRootContainer).run(); }
From source file:org.unitime.timetable.gwt.client.admin.TaskExecutionsTable.java
License:Apache License
public int addExecution(final TaskExecutionInterface exec) { List<Widget> widgets = new ArrayList<Widget>(); for (TaskExecutionsTableColumn column : TaskExecutionsTableColumn.values()) { int nbrCells = getNbrCells(column); for (int idx = 0; idx < nbrCells; idx++) { Widget cell = getCell(exec, column, idx); if (cell == null) cell = new P(); widgets.add(cell);//www . j av a 2 s.c o m } } for (Widget w : widgets) if (w != null) w.addStyleName("status-" + exec.getStatus().name().toLowerCase()); int row = addRow(exec, widgets); getRowFormatter().setStyleName(row, "row"); for (int col = 0; col < getCellCount(row); col++) getCellFormatter().setStyleName(row, col, "cell"); return row; }
From source file:org.unitime.timetable.gwt.client.instructor.TeachingRequestDetails.java
License:Apache License
public void setRequest(TeachingRequestInfo request, Integer index) { iCourseLabel.setText(request.getCourse().getCourseName()); iRequestLoad.setText(sTeachingLoadFormat.format(request.getLoad())); iSectionsTable.clearTable(1);//from w ww . ja v a2 s . c o m for (SectionInfo s : request.getSections()) { List<Widget> sectionLine = new ArrayList<Widget>(); sectionLine.add( new Label(s.getSectionType() + (s.getExternalId() == null ? "" : " " + s.getExternalId()))); sectionLine.add(new HTML(s.getTime() == null ? SECTMSG.arrangeHours() : s.getTime())); sectionLine.add(new HTML(s.getDate() == null ? SECTMSG.noDate() : s.getDate())); sectionLine.add(new HTML(s.getRoom() == null ? SECTMSG.noRoom() : s.getRoom())); if (s.isCommon()) for (Widget w : sectionLine) w.addStyleName("common"); iSectionsTable.addRow(s, sectionLine); } iAttributePrefs.setValue(request.getAttributePreferences()); getRowFormatter().setVisible(iAttributePrefsRow, !request.getAttributePreferences().isEmpty()); iInstructorPrefs.setValue(request.getInstructorPreferences()); getRowFormatter().setVisible(iInstructorPrefsRow, !request.getInstructorPreferences().isEmpty()); iObjectives.setValue(request.getValues()); getRowFormatter().setVisible(iObjectivesRow, !request.getValues().isEmpty()); iInstructorsTable.clearTable(1); for (int i = 0; i < request.getNrInstructors(); i++) { InstructorInfo instructor = request.getInstructor(i); if (instructor != null) { List<Widget> instructorLine = new ArrayList<Widget>(); instructorLine.add(new Label((1 + i) + ".")); instructorLine.add(new InstructorExternalIdCell(iProperties, instructor)); instructorLine.add(new InstructorNameCell(iProperties, instructor)); instructorLine.add(new Label(sTeachingLoadFormat.format(instructor.getAssignedLoad()) + " / " + sTeachingLoadFormat.format(instructor.getMaxLoad()))); instructorLine.add(new AttributesCell(instructor.getAttributes())); instructorLine.add(new PreferenceCell(iProperties, instructor.getCoursePreferences())); instructorLine.add(new TimePreferenceCell(iProperties, instructor)); instructorLine.add(new PreferenceCell(iProperties, instructor.getDistributionPreferences())); instructorLine.add(new ObjectivesCell(iProperties, instructor.getValues())); iInstructorsTable.addRow(instructor, instructorLine); } else { List<Widget> instructorLine = new ArrayList<Widget>(); instructorLine.add(new Label((1 + i) + ".")); instructorLine.add(new NotAssignedInstructor(8)); iInstructorsTable.addRow(null, instructorLine); } } if (request.getNrInstructors() <= 1) iInstructorsTable.setColumnVisible(0, false); if (request.getNrInstructors() == 1) { iInstructorsTable.setSelected(1, true); } else if (index != null) { iInstructorsTable.setSelected(1 + index, true); } }
From source file:org.unitime.timetable.gwt.client.reservations.RestrictionsTable.java
License:Apache License
protected Node addClass(Node parent, Clazz clazz) { List<Widget> line = new ArrayList<Widget>(); Node node = new Node(parent, clazz.getAbbv(), clazz); line.add(node);//from w w w . j av a 2s . co m line.add(new Label(clazz.hasExternalId() ? clazz.getExternalId() : "")); line.add(new UniTimeTable.NumberCell(clazz.getLimit() == null ? "" : clazz.getLimit().toString())); if (clazz.isCancelled()) { line.add(new CancelledCell()); } else { line.add(new Label(clazz.hasTime() ? clazz.getTime() : "")); line.add(new Label(clazz.hasDate() ? clazz.getDate() : "")); line.add(new Label(clazz.hasRoom() ? clazz.getRoom() : "")); } line.add(new Label(clazz.hasInstructor() ? clazz.getInstructor() : "")); node.setRow(addRow(node, line)); if (clazz.isCancelled()) for (Widget w : line) w.addStyleName("cancelled"); iClasses.put(clazz.getId(), node); parent.addChildNode(node); return node; }
From source file:org.unitime.timetable.gwt.client.widgets.FilterPanel.java
License:Apache License
@Override public void add(Widget w) { w.addStyleName("filter-item"); super.add(w); }