public void removeMainSection(String sectionID) { mainSectionStack.removeSection(sectionID); }
/* * (non-Javadoc) * @see * cz.fi.muni.xkremser.editor.client.presenter.DigitalObjectMenuPresenter. * MyView#showInputQueue(com.gwtplatform.dispatch.client.DispatchAsync) */ @Override public void showInputQueue( InputQueueTree tree, DispatchAsync dispatcher, final PlaceManager placeManager) { SectionStackSection section1 = new SectionStackSection(); section1.setTitle(lang.inputQueue()); if (tree == null) { inputTree = new InputQueueTree(dispatcher, lang, eventBus); inputTree .getCreateMenuItem() .addClickHandler( new com.smartgwt.client.widgets.menu.events.ClickHandler() { @Override public void onClick(final MenuItemClickEvent event) { String msg = event.getMenu().getEmptyMessage(); String model = msg.substring(0, msg.indexOf("/")); String path = msg.substring(msg.indexOf("/") + 1); String id = path; if (path.contains("/")) { id = path.substring(0, path.indexOf("/")); } placeManager.revealRelativePlace( new PlaceRequest(NameTokens.FIND_METADATA) .with(Constants.ATTR_MODEL, model) .with(Constants.URL_PARAM_SYSNO, id) .with(Constants.URL_PARAM_PATH, path)); } }); } else { String isInputSection = sectionStack.getSection(0).getAttribute(SECTION_INPUT_ID); if (isInputSection != null && "yes".equals(isInputSection)) { sectionStack.removeSection(0); } inputTree = tree; } section1.setItems(inputTree); refreshButton = new ImgButton(); refreshButton.setSrc("[SKIN]headerIcons/refresh.png"); refreshButton.setSize(16); refreshButton.setShowRollOver(true); refreshButton.setCanHover(true); refreshButton.setShowDownIcon(false); refreshButton.setShowDown(false); refreshButton.setHoverStyle("interactImageHover"); refreshButton.setHoverOpacity(75); refreshButton.addHoverHandler( new HoverHandler() { @Override public void onHover(HoverEvent event) { refreshButton.setPrompt(lang.inputQueueRescan()); } }); section1.setControls(refreshButton); section1.setResizeable(true); section1.setExpanded(true); sectionStack.addSection(section1, 0); section1.setAttribute(SECTION_INPUT_ID, "yes"); }
public static void setInputTreeToSection( final DispatchAsync dispatcher, final LangConstants lang, final EventBus eventBus, SectionStack sectionStack, final PlaceManager placeManager, final MessageBus messageBus, boolean force) { SectionStackSection section1 = new SectionStackSection(); section1.setTitle(lang.inputQueue()); String isInputSection = sectionStack.getSection(0).getAttribute(Constants.SECTION_INPUT_ID); boolean notContains = isInputSection == null || !"yes".equals(isInputSection); if (notContains || force) { if (!notContains) { sectionStack.collapseSection(0); sectionStack.removeSection(0); } if (inputQueueTree == null) { inputQueueTree = new InputQueueTree(dispatcher, lang, eventBus); inputQueueTree .getCreateMenuItem() .addClickHandler( new com.smartgwt.client.widgets.menu.events.ClickHandler() { @Override public void onClick(final MenuItemClickEvent event) { String msg = event.getMenu().getEmptyMessage(); String model = msg.substring(0, msg.indexOf("/")); String path = msg.substring(msg.indexOf("/") + 1); String id = path; if (path.contains("/")) { id = path.substring(0, path.indexOf("/")); } placeManager.revealRelativePlace( new PlaceRequest(NameTokens.FIND_METADATA) .with(Constants.ATTR_MODEL, model) .with(Constants.URL_PARAM_SYSNO, id) .with(Constants.URL_PARAM_PATH, path)); } }); messageBus.subscribe( "InputQueueBroadcastReceiver", new MessageCallback() { @Override public void callback(Message message) { String inputItem = message.get(String.class, "ingested"); for (ListGridRecord record : inputQueueTree.getRecords()) { if (record.getAttribute(Constants.ATTR_ID).equals(inputItem)) { record.setAttribute(Constants.ATTR_INGEST_INFO, true); inputQueueTree.redraw(); } } } }); } section1.setItems(inputQueueTree); section1.setControls(getRefreshButton(lang, eventBus, dispatcher)); section1.setResizeable(true); section1.setExpanded(true); sectionStack.addSection(section1, 0); section1.setAttribute(Constants.SECTION_INPUT_ID, "yes"); } }