public boolean hasPreloader() { return RootPanel.get().getWidgetIndex(preloader) >= 0; }
@Override public boolean isShown() { return getRootPanel().getWidgetIndex(view) != -1; }
private void addHeader() { // Note: the presence of absence of headerSlot in the html determines // whether or not this is a "naked" iPSCellSearch page if ( headerSlot == null ) { hasHeaderFlag = false; } else { hasHeaderFlag = true; topPanel = new StemCellSearchTopPanel(); } if ( hasHeaderFlag && headerSlot.getWidgetIndex( topPanel ) == -1 ) { headerSlot.add( topPanel ); } }
/** * <p> Hides the Modal Window </p> */ public void hide() { int index = RootPanel.get().getWidgetIndex(drapePanel); try { if (index > -1) RootPanel.get().remove(index); } catch (java.lang.AssertionError ignore) { } window.hide(); } }
@Test public void hide() { when(mockRootPanel.getWidgetIndex(mockView)).thenReturn(1); baseMenu.hide(); verify(baseMenu, times(1)).isShown(); verify(mockStyle, times(1)).setDisplay(Style.Display.NONE); when(mockRootPanel.getWidgetIndex(mockView)).thenReturn(-1); reset(baseMenu); reset(mockStyle); baseMenu.hide(); verify(baseMenu, times(1)).isShown(); verify(mockStyle, times(0)).setDisplay(Style.Display.NONE); }
@Test public void isShown() { when(mockRootPanel.getWidgetIndex(mockView)).thenReturn(1); assertTrue(baseMenu.isShown()); when(mockRootPanel.getWidgetIndex(mockView)).thenReturn(-1); assertFalse(baseMenu.isShown()); }
@Override public void onSuccess(SearchUIConfig searchUIConfig) { SearchApplicationContext.initializeSearchApplicationContext(searchUIConfig); if ( !SearchApplicationContext.getInstance().requiresLogin() ) { SessionContext.INSTANCE.noAuthLogin(); } controller = new SearchApplicationController(); addHeader(); addMain(); addFooter(); if ( hasHeader && headerSlot.getWidgetIndex( headerPanel ) == -1 ) { headerSlot.add( headerPanel ); } if ( hasFooter && footerSlot.getWidgetIndex( footerPanel ) == -1 ) { footerSlot.add( footerPanel ); } if ( hasFeedback ) { feedbackSlot.removeStyleName( "hide" ); } SearchApplicationContext.getInstance().clearHistory(); } });
private void addFooter() { String navigationString = ""; String version = null; Element el = footerSlot.getElement(); if (el != null) { version = el.getInnerText(); AppInfoAnalytics appInfoAnalytics = new AppInfoAnalytics(version); StemCellSearchApplicationState.recordAnalyticsEvent(appInfoAnalytics.toString()); } // for now, we use isInstitution to determine if we are the full (central) IPS-search // or the naked (no header and a much-reduced footer) institution IPSc search. // If we are to have a regular, wrapped institutional iPSC search, this will have to change. if (!StemCellSearchApplicationState.getInstance().isInstitution()) { // central - a full footer, complete with nav-bar: navigationString = StemCellSearchApplicationState.getInstance().getExternalData(UI_CENTRAL_FOOTERNAV_URL); // and we populate the version information in all cases: if (el != null) { el.setInnerText(""); log.info("version: " + version); } else { log.info("footerSlot's element is null!!!!"); } footerPanel = new FooterPanel( version, navigationString ); if ( hasFooterFlag && footerSlot.getWidgetIndex( footerPanel ) == -1 ) { footerSlot.add( footerPanel ); } } }
private void reset() { metaFileLocation .setValue( resBundle.getString( "importDialog.SELECT_METAFILE_LABEL", "browse for metadata file" ) ); importDialogModel.removeAllLocalizedBundles(); importDialogModel.setUploadedFile( null ); if ( formPanel != null && RootPanel.get().getWidgetIndex( formPanel ) != -1 ) { RootPanel.get().remove( formPanel ); } acceptButton.setDisabled( true ); domainIdText.setValue( "" ); overwrite = false; formPanel = null; importCompleteCallback = null; removeHiddenPanels(); }
private void reset() { analysisFileLabel.setValue( resBundle.getString( "importDialog.IMPORT_MONDRIAN", "Browse for analysis file" ) ); if ( formPanel != null && RootPanel.get().getWidgetIndex( formPanel ) != -1 ) { RootPanel.get().remove( formPanel ); } formPanel = null; submitHandler = null; reloadConnections(); importDialogModel.removeAllParameters(); importDialogModel.setUploadedFile( null ); availableRadio.setSelected( true ); acceptButton.setDisabled( true ); schemaNameLabel.setValue( "" ); setPreference( DATASOURCE_MODE ); overwrite = false; removeHiddenPanels(); }