@Override public void buildSpacesList() { targetGroupsCheckBoxList.removeAllChildren(); final Map<String, String> spaces = instance.getSpacesMap(); List<String> spaceIds = new ArrayList<String>(); spaceIds.addAll(spaces.keySet()); Comparator<String> compare = new Comparator<String>() { @Override public int compare(String o1, String o2) { String name1 = spaces.get(o1); String name2 = spaces.get(o2); return name1.compareToIgnoreCase(name2); } }; Collections.sort(spaceIds, compare); checkBoxes = new HashMap<String, SimpleCheckBox>(); for (String id:spaceIds) { addSpaceToList(id, spaces.get(id)); } }
public void updateTargetGroupsList() { Map<String, String> spaces = instance.getSpacesMap(); targetGroupsList.removeAllChildren(); targetSpaces.clear(); StringBuilder builder = new StringBuilder(); for (SimpleCheckBox box:checkBoxes.values()) { if (box.getValue()) { Element liElement = Document.get().createLIElement(); liElement.setInnerHTML(spaces.get(box.getFormValue())); builder.append(spaces.get(box.getFormValue())).append(","); targetGroupsList.appendChild(liElement); targetSpaces.add(box.getFormValue()); } } if (builder.length() > 0) { builder.setLength(builder.length()-1); } targetGroups = builder.toString(); sendCompleteInformation(); }
private void addSpaceToList(String id, String spaceName) { Element trElement = Document.get().createTRElement(); Element tdCheckElement = Document.get().createTDElement(); SimpleCheckBox checkBox = SimpleCheckBox.wrap(Document.get().createCheckInputElement()); checkBox.setFormValue(id); Element tdTitleElement = Document.get().createTDElement(); Element spanElement = Document.get().createSpanElement(); spanElement.setInnerHTML(spaceName); tdCheckElement.appendChild(checkBox.getElement()); tdTitleElement.appendChild(spanElement); trElement.appendChild(tdCheckElement); trElement.appendChild(tdTitleElement); targetGroupsCheckBoxList.appendChild(trElement); checkBoxes.put(id, checkBox); targetSpacesListElements.put(id, trElement); }
public Switcher() { FlowPanel mainPanel = new FlowPanel(); mainPanel.setStyleName(RESOURCES.switcherCSS().onoffswitch()); final String elementId = DOM.createUniqueId(); checkbox = new SimpleCheckBox(); checkbox.getElement().setId(elementId); checkbox.setName("onoffswitch"); checkbox.setStyleName(RESOURCES.switcherCSS().onoffswitchCheckbox()); mainPanel.add(checkbox); Element label = DOM.createLabel(); label.setClassName(RESOURCES.switcherCSS().onoffswitchLabel()); label.setAttribute("for", elementId); Element inner = DOM.createDiv(); inner.setClassName(RESOURCES.switcherCSS().onoffswitchInner()); label.appendChild(inner); Element sw = DOM.createDiv(); sw.setClassName(RESOURCES.switcherCSS().onoffswitchSwitch()); label.appendChild(sw); mainPanel.getElement().appendChild(label); initWidget(mainPanel); }
protected void setFieldValue(Field f, String value) { Object field = f.field; if (value == null) value = f.defaultValue; if (field instanceof TextBox) setFieldValue((TextBox) field, value); else if (field instanceof IntegerBox) setFieldValue((IntegerBox) field, value); else if (field instanceof NumberSpinner) setFieldValue((NumberSpinner) field, value); else if (field instanceof LongSpinner) setFieldValue((LongSpinner) field, value); else if (field instanceof DoubleSpinner) setFieldValue((DoubleSpinner) field, value); else if (field instanceof DoubleBox) setFieldValue((DoubleBox) field, value); else if (field instanceof SimpleCheckBox) setFieldValue((SimpleCheckBox) field, value); else if (field instanceof ListBox) setFieldValue((ListBox) field, value); else if (field instanceof PassivesPanel) setFieldValue((PassivesPanel) field, value); else if (field instanceof GemsPanel) setFieldValue((GemsPanel) field, value); else if (field instanceof ItemPanel) setFieldValue((ItemPanel) field, value); else if (field instanceof SkillsPanel) setFieldValue((SkillsPanel) field, value); else if (field instanceof DamageTypePanel) setFieldValue((DamageTypePanel) field, value); else if (field instanceof SkillDamagePanel) setFieldValue((SkillDamagePanel) field, value); }
@Override public Widget render(Schema property) { checkbox = new SimpleCheckBox(); // Set it to true if that is the default. checkbox.setValue("true".equals(property.getDefault())); // If this property is locked, disable the checkbox if (property.locked()) { checkbox.setEnabled(false); } return checkbox; }
private void addSpaceToList(final String id) { HTML trHTML = HTML.wrap(Document.get().createTRElement()); Element checkTD = Document.get().createTDElement(); SimpleCheckBox checkBox = SimpleCheckBox.wrap(Document.get().createCheckInputElement()); checkBox.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (((SimpleCheckBox)event.getSource()).getValue()) { selectedSpaces.add(id); } else { selectedSpaces.remove(id); } updateParticipantsLabel(); } }); if (selectedSpaces.contains(id)) { checkBox.setValue(true); } checkTD.appendChild(checkBox.getElement()); Element nameTD = Document.get().createTDElement(); nameTD.setInnerHTML(spaces.get(id)); trHTML.getElement().appendChild(checkTD); trHTML.getElement().appendChild(nameTD); discussionGroupsTable.appendChild(trHTML.getElement()); tableElements.put(id, trHTML); groupCheckBoxes.put(id, checkBox); }
public AttachEvidenceDialog(final ARApp instance) { super(instance); dia = new DialogBox(); dia.setGlassEnabled(true); dia.setGlassStyleName("transparent"); attachedEvidences = new ArrayList<Evidence>(); evidenceSpaceIds = new ArrayList<String>(); // dataObjects = new HashMap<String, JavaScriptObject>(); listElements = new HashMap<String, HTML>(); checkBoxes = new HashMap<String, SimpleCheckBox>(); build(); }
private void addSpaceToList(final String id) { HTML trHTML = HTML.wrap(Document.get().createTRElement()); Element checkTD = Document.get().createTDElement(); SimpleCheckBox checkBox = SimpleCheckBox.wrap(Document.get().createCheckInputElement()); checkBox.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (((SimpleCheckBox)event.getSource()).getValue()) { evidenceSpaceIds.add(id); } else { evidenceSpaceIds.remove(id); } if (instance.persistenceServiceAvailable()) { int index = publishersListBox.getSelectedIndex(); String publisher = null; if (index > 0) { publisher = publishersListBox.getValue(index); } queryDataObjects(evidenceSpaceIds, publisher, time); } else { buildEvidenceList(); } } }); checkTD.appendChild(checkBox.getElement()); Element nameTD = Document.get().createTDElement(); nameTD.setInnerHTML(spaces.get(id)); trHTML.getElement().appendChild(checkTD); trHTML.getElement().appendChild(nameTD); spacesList.appendChild(trHTML.getElement()); listElements.put(id, trHTML); }
public SimpleCheckBox getAutoFill() { return autoFill; }
public SimpleCheckBox getOtherSets() { return otherSets; }
public SimpleCheckBox getSyncWithCoe() { return this.syncWithCoe; }
public SimpleCheckBox getSpenderFullHatred() { return spenderFullHatred; }
public SimpleCheckBox getWolf() { return wolf; }
public SimpleCheckBox getBbv() { return bbv; }
public SimpleCheckBox getMassConfusion() { return massConfusion; }
public SimpleCheckBox getInnerSanctuary() { return innerSanctuary; }
public SimpleCheckBox getConviction() { return conviction; }
public SimpleCheckBox getCripplingWave() { return cripplingWave; }
public SimpleCheckBox getPiranhas() { return piranhas; }
public SimpleCheckBox getFalter() { return falter; }
public SimpleCheckBox getToxin() { return toxin; }
public SimpleCheckBox getIceblink() { return iceblink; }
public SimpleCheckBox getOverawe() { return overawe; }
public SimpleCheckBox getValor() { return valor; }
public SimpleCheckBox getRetribution() { return retribution; }
public SimpleCheckBox getSlamDance() { return slamDance; }
public SimpleCheckBox getTimeWarp() { return timeWarp; }
public SimpleCheckBox getUnity() { return unity; }
public SimpleCheckBox getStretchTime() { return stretchTime; }
public SimpleCheckBox getOculus() { return oculus; }
public SimpleCheckBox getFocusedMind() { return focusedMind; }
public SimpleCheckBox getAnatomy() { return anatomy; }
public SimpleCheckBox getHysteria() { return hysteria; }
public SimpleCheckBox getInspire() { return inspire; }
protected String getFieldValue(Field f) { Object field = f.field; String defaultValue = f.defaultValue; if (field instanceof TextBox) return getFieldValue((TextBox) field, defaultValue); else if (field instanceof IntegerBox) return getFieldValue((IntegerBox) field, defaultValue); else if (field instanceof NumberSpinner) return getFieldValue((NumberSpinner) field, defaultValue); else if (field instanceof LongSpinner) return getFieldValue((LongSpinner) field, defaultValue); else if (field instanceof DoubleSpinner) return getFieldValue((DoubleSpinner) field, defaultValue); else if (field instanceof DoubleBox) return getFieldValue((DoubleBox) field, defaultValue); else if (field instanceof SimpleCheckBox) return getFieldValue((SimpleCheckBox) field, defaultValue); else if (field instanceof ListBox) return getFieldValue((ListBox) field, defaultValue); else if (field instanceof PassivesPanel) return getFieldValue(((PassivesPanel) field).getPassives(), defaultValue); else if (field instanceof GemsPanel) return getGemsFieldValue(((GemsPanel) field).getGems(), defaultValue); else if (field instanceof ItemPanel) return getSpecialItemsFieldValue(((ItemPanel) field).getItems(), ((ItemPanel) field).getSetCounts(), defaultValue); else if (field instanceof SkillsPanel) return getEnumFieldValue(((SkillsPanel) field).getSkills(), defaultValue); else if (field instanceof DamageTypePanel) return getFieldValue(((DamageTypePanel) field).getValues(), defaultValue); else if (field instanceof SkillDamagePanel) return getFieldValue(((SkillDamagePanel) field).getValues(), defaultValue); else return defaultValue; }
protected String getFieldValue(SimpleCheckBox field, String defaultValue) { return String.valueOf(field.getValue()); }
protected void setFieldValue(SimpleCheckBox field, String value) { field.setValue(Boolean.valueOf(value)); }
/** * If new information are available this method can be called to update the shown information. */ public void update() { Map<String, String> discussions = instance.getDiscussions(); if (discussions.get(discussionSpaceId) == null) { moderatorJid = instance.getBareJID(); isModerator = true; title.setText(discussionSpaceId); issueLabel.getElement().setInnerHTML(discussionEntryMessage.emptyIssueHtml()); solutionLabel.getElement().setInnerHTML(discussionEntryMessage.emptySolutionHtml()); ratingLabel.setInnerText(discussionEntryMessage.standardRatingText()); ratingTextArea.setText(discussionEntryMessage.standardRatingText()); benefit = null; effort = null; targetGroups = null; ref = null; targetGroups = ""; customId = null; participants.clear(); minuteEntries.clear(); dataObjects.clear(); attachedEvidences.clear(); targetSpaces.clear(); targetGroupsList.removeAllChildren(); if (checkBoxes != null) { for (SimpleCheckBox checkBox:checkBoxes.values()) { checkBox.setValue(false); } } participants.add(moderatorJid); updateParticipantsLabel(); sendNewEntry(discussionEntryMessage.openMessage(instance.getDisplayNameForJid(moderatorJid), HasTimestamp.MEDIUMDATE.format(new Date()))); } else { com.google.gwt.xml.client.Element discElem = Parser.parseXMLStringToElement(discussions.get(discussionSpaceId)); if (discElem != null) { List<RecommendationObject> objs = Parser.parseRecommendations(discElem); if (objs != null && objs.size() > 0) { final RecommendationObject obj = objs.get(0); final Map<String, String> infos = SessionObject.getAllInformation(discussions.get(discussionSpaceId)); updateInfosWithRecommendation(obj); updateInfos(infos); } } } }