@Override protected void onInit() { super.onInit(); contents = new LocatableVLayout(extendLocatorId("Contents")); contents.setWidth100(); contents.setHeight100(); addMember(contents); filterForm = new CarouselFilter(this); /* * carousel filters and search bar are currently mutually exclusive */ if (getSearchSubsystem() == null) { configureCarouselFilters(); } else { if (!this.hideSearchBar) { final EnhancedSearchBarItem searchFilter = new EnhancedSearchBarItem( "search", getSearchSubsystem(), getInitialSearchBarSearchText()); setFilterFormItems(searchFilter); } } carouselHolder = new LocatableHLayout(extendLocatorId("Holder")); carouselHolder.setOverflow(Overflow.AUTO); carouselHolder.setWidth100(); contents.addMember(carouselHolder); }
@Override protected LocatableVLayout defaultView() { LocatableVLayout vLayout = new LocatableVLayout(this.extendLocatorId("Default")); vLayout.setWidth100(); // TODO: Help icon. TitleBar titleBar = new TitleBar(this, MSG.common_title_help()); vLayout.addMember(titleBar); Label label = new Label(MSG.view_helpTop_description()); label.setPadding(10); vLayout.addMember(label); return vLayout; }
public SystemSettingsView(String locatorId) { super(locatorId); setHeight100(); setWidth100(); TitleBar titleBar = new TitleBar( this, MSG.view_adminConfig_systemSettings(), "subsystems/configure/Configure_24.png"); addMember(titleBar); canvas = new LocatableVLayout("innerLayout"); canvas.setHeight100(); canvas.setWidth100(); canvas.setMargin(15); addMember(canvas); }
@Override protected void onInit() { if (!isInitialized) { super.onInit(); this.setWidth100(); this.setHeight100(); this.addMember(buildEditForm()); buildPortlets(); isInitialized = true; } }
@Override protected void onInit() { if (!isInitialized()) { super.onInit(); // first async call to get global permissions new PermissionsLoader() .loadExplicitGlobalPermissions( new PermissionsLoadedListener() { public void onPermissionsLoaded(Set<Permission> permissions) { globalPermissions = permissions; // now make async call to look for customized dash for this user and entity DashboardCriteria criteria = new DashboardCriteria(); criteria.addFilterCategory(DashboardCategory.RESOURCE); criteria.addFilterResourceId(resourceComposite.getResource().getId()); dashboardService.findDashboardsByCriteria( criteria, new AsyncCallback<PageList<Dashboard>>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler() .handleError(MSG.view_dashboardsManager_error1(), caught); } public void onSuccess(final PageList<Dashboard> result) { Dashboard dashboard = result.isEmpty() ? getDefaultDashboard() : result.get(0); setDashboard(dashboard); isInitialized = true; // draw() may be done since onInit finishes asynchronously, if so redraw if (isDrawn()) { markForRedraw(); } } }); } }); } }
@Override protected void onDraw() { super.onDraw(); setEditMode(editMode); }
@Override protected void onDraw() { super.onDraw(); GWTServiceLookup.getSystemService() .getSystemSettings( new AsyncCallback<SystemSettings>() { @Override public void onSuccess(SystemSettings result) { canvas.addMember(getServerDetails()); Configuration config = new Configuration(); for (Map.Entry<String, String> entry : result.getSystemConfiguration().entrySet()) { String name = entry.getKey(); String value = (entry.getValue() == null) ? "" : entry.getValue(); // some of our properties are actually different values on the server than how // they are to be // visualized in the UI. // -- JAASProvider is a boolean in the UI but is "LDAP" if it was true and "JDBC" // if it was false // -- LDAPProtocol is a boolean in the UI but is "ssl" if true and "" if it was // false // -- some other numerical values need to be converted from milliseconds if (Constant.JAASProvider.equals(name)) { value = Boolean.toString(value.equals(Constant.LDAPJAASProvider)); } else if (Constant.LDAPProtocol.equals(name)) { value = Boolean.toString(value.equalsIgnoreCase("ssl")); } else if (Constant.AgentMaxQuietTimeAllowed.equals(name)) { value = convertMillisToMinutes(value); } else if (Constant.DataMaintenance.equals(name)) { value = convertMillisToHours(value); } else if (Constant.AvailabilityPurge.equals(name) || Constant.AlertPurge.equals(name) || Constant.TraitPurge.equals(name) || Constant.RtDataPurge.equals(name) || Constant.EventPurge.equals(name) || Constant.DriftFilePurge.equals(name) || Constant.BaselineFrequency.equals(name) || Constant.BaselineDataSet.equals(name)) { value = convertMillisToDays(value); } else if (Constant.EnableAgentAutoUpdate.equals(name)) { if (value.trim().length() == 0) { value = "false"; // if, for some reason, this value was empty, use false - let the // user explicitly enable it } } else if (Constant.EnableDebugMode.equals(name)) { if (value.trim().length() == 0) { value = "false"; } } else if (Constant.EnableExperimentalFeatures.equals(name)) { if (value.trim().length() == 0) { value = "false"; } } else if (Constant.DataReindex.equals(name)) { if (value.trim().length() == 0) { value = "true"; } } PropertySimple prop = new PropertySimple(name, value); config.put(prop); } // build our config definition and populate our config editor editor = new ConfigurationEditor( extendLocatorId("configEditor"), getSystemSettingsDefinition(config, result.getDriftPlugins()), config); editor.addPropertyValueChangeListener(SystemSettingsView.this); canvas.addMember(editor); ToolStrip toolStrip = new ToolStrip(); toolStrip.setWidth100(); toolStrip.setMembersMargin(5); toolStrip.setLayoutMargin(5); saveButton = new LocatableIButton(extendLocatorId("Save"), MSG.common_button_save()); saveButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent clickEvent) { save(); } }); toolStrip.addMember(saveButton); canvas.addMember(toolStrip); } @Override public void onFailure(Throwable t) { CoreGUI.getErrorHandler() .handleError(MSG.view_admin_systemSettings_cannotLoadSettings(), t); } }); }
@Override protected void onDraw() { try { super.onDraw(); for (Canvas child : contents.getMembers()) { contents.removeChild(child); } // Title this.titleCanvas = new HTMLFlow(); setTitleString(this.titleString); if (showTitle) { titleLayout = new LocatableHLayout(contents.extendLocatorId("Title")); titleLayout.setAutoHeight(); titleLayout.setAlign(VerticalAlignment.BOTTOM); titleLayout.setMembersMargin(4); contents.addMember(titleLayout, 0); } if (null != carouselDetails) { contents.addMember(carouselDetails); } if (filterForm.hasContent()) { contents.addMember(filterForm); } contents.addMember(carouselHolder); // Footer // A second toolstrip that optionally appears before the main footer - it will contain extra // widgets. // This is hidden from view unless extra widgets are actually added to the carousel above the // main footer. this.footerExtraWidgets = new LocatableToolStrip(contents.extendLocatorId("FooterExtraWidgets")); footerExtraWidgets.setPadding(5); footerExtraWidgets.setWidth100(); footerExtraWidgets.setMembersMargin(15); footerExtraWidgets.hide(); contents.addMember(footerExtraWidgets); this.footer = new LocatableToolStrip(contents.extendLocatorId("Footer")); footer.setPadding(5); footer.setWidth100(); footer.setMembersMargin(15); contents.addMember(footer); // The ListGrid has been created and configured // Now give subclasses a chance to configure the carousel configureCarousel(); Label carouselInfo = new Label(); carouselInfo.setWrap(false); setCarouselInfo(carouselInfo); if (showTitle) { drawTitle(); } if (showFooter) { drawFooter(); } } catch (Exception e) { CoreGUI.getErrorHandler().handleError(MSG.view_table_drawFail(this.toString()), e); } }