public int load(Topic topic) { super.load(topic); childPanel.clear(); int childCount = 0; for (Iterator iterator = topic.getInstances().iterator(); iterator.hasNext(); ) { TopicTypeConnector conn = (TopicTypeConnector) iterator.next(); Topic child = conn.getTopic(); if (manager.isEdittable() || child.isPublicVisible()) { childPanel.add(new TopicLink(child)); } childCount++; } if (childCount < 1) { childPanel.add(new Label(" ")); } int scrollH = childCount * HEIGHT_PER_ENTRY; scrollH = (scrollH < MAX_HEIGHT) ? scrollH : MAX_HEIGHT; scroll.setHeight(scrollH + "px"); System.out.println("ChildGadg scroll heigh " + scrollH); return childCount; }
// @Override public void executeCommand() throws HippoBusinessException { List<Topic> topicsToProcess = getTopicsToProcess(); Topic tag = getTagToAddThingsTo(); Topic removeFromThis = getRemoveFromThis(); System.out.println(toString()); for (Topic toProcess : topicsToProcess) { // System.out.println("AddToTagCommand to process " + toProcess + " occ " // + (toProcess instanceof Occurrence)); if (toProcess instanceof Occurrence) { Occurrence occToProcces = (Occurrence) toProcess; // System.out.println("AddToTagCommand. Process as occ"); tag.addOccurence(occToProcces); } else { // System.out.println("AddToTagCommand. Process as topic"); toProcess.tagTopic(tag); } if (null != removeFromThis) { if (toProcess instanceof Occurrence) { Occurrence occToProcces = (Occurrence) toProcess; removeFromThis.removeOcc(occToProcces); } else { toProcess.removeType(removeFromThis); } // throw new HippoBusinessException("Error Removing Occurrence"); } } }
// @Override public boolean isOnForTopic(Topic topic) { return !topic.getInstances().isEmpty(); }