/** * The preparePaintComponent method has been overridden to keep the data object bound to this wcomponent in sync * with any changes that control logic (Action implementations) or other wcomponents have made to the data. * * @param request the Request being responded to. */ @Override protected void preparePaintComponent(final Request request) { // Let the wcomponent do its own preparation first, if any. super.preparePaintComponent(request); Object data = getData(); if (data != null) { // Now update this wcomponent and its children with the data contained // in the data object. updateComponent(data); } } }
@Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); //To change body of generated methods, choose Tools | Templates. if (!isInitialised()) { setInitialised(true); WSuggestions suggestions = textRO.getSuggestions(); if (suggestions != null) { List<String> suggestionList = suggestions.getSuggestions(); if (suggestionList != null && suggestionList.size() > 0) { textRO.setText(suggestionList.get((int) Math.floor(suggestionList.size() / 2))); } } } }
/** * Set up the initial state of the video component. * @param request The http request being processed. */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); //To change body of generated methods, choose Tools | Templates. if (!isInitialised()) { setInitialised(true); setupVideo(); } }
/** * Set up the initial state of the audio component. * @param request The http request being processed. */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); //To change body of generated methods, choose Tools | Templates. if (!isInitialised()) { setInitialised(true); setupAudio(); } }
/** * {@inheritDoc} */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (Cache.getCache().get(DATA_KEY) != null) { poller.disablePoll(); } }
/** * Override preparePaintComponent in order to populate the recently accessed menu when a user accesses this panel * for the first time. * * @param request the request being responded to. */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (!isInitialised()) { List<ExampleData> recent = menuPanel.getRecent(); if (!recent.isEmpty()) { selectExample(recent.get(0)); } setInitialised(true); } lastLoaded.setText("Last loaded on ".concat(getMeAReadableDate(new Date()))); }
/** * Override the prepare paint to initialise the initial instance of the dropdown. * * @param request the request being responded to. */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (!isInitialised()) { applySettings(); setInitialised(true); } }
/** * preparePaintComponent is called to use the applySettings to configure the collapsible. * * @param request the web request. */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (!isInitialised()) { applySettings(); setInitialised(true); } } }
/** * Override prepaprePaintComponent to initialise the example the first time through. This just sets the text of * the text area to match the initial selections. * * @param request the request being responded to */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (!isInitialised()) { setInitialised(true); copySelectedValues(); } }
/** * When the example picker starts up, we want to display the last selection the user made in their previous session. * We can do this because the list of recent selections is stored in a file on the file system. * * @param request the request being responded to. */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (!this.isInitialised()) { List recent = loadRecentList(); if (recent != null && !recent.isEmpty()) { String selection = (String) recent.get(0); displaySelection(selection); } this.setInitialised(true); } updateTitle(); }
/** * {@inheritDoc} */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (!isInitialised()) { messageBox.addMessage("Message Box Example"); applySettings(); setInitialised(true); } }
/** * Override preparePaintComponent in order to set up the example data the first time through. * * @param request the request being responded to. */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (!isInitialised()) { List<Serializable> items = new ArrayList<>(); items.add(new SimpleTableBean("A", "none", "thing")); items.add(new SimpleTableBean("B", "some", "thing2")); items.add(new SimpleTableBean("C", "little", "thing3")); items.add(new SimpleTableBean("D", "lots", "thing4")); items.add(new SimpleTableBean("E", "none", "thing5")); items.add(new SimpleTableBean("F", "some", "thing6")); items.add(new SimpleTableBean("G", "little", "thing7")); items.add(new SimpleTableBean("H", "lots", "thing8")); items.add(new SimpleTableBean("I", "none", "thing9")); items.add(new SimpleTableBean("J", "some", "thing10")); items.add(new SimpleTableBean("K", "little", "thing11")); items.add(new SimpleTableBean("L", "lots", "thing12")); table.setDataModel(new SimpleBeanListTableDataModel( new String[]{"name", "type", "thing"}, items)); setInitialised(true); } }
/** * Override preparePaintComponent in order to set up the example data the first time that the example is accessed by * each user. * * @param request the request being responded to. */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (!isInitialised()) { // Needs to be set per user as the model holds the current page index and total row per user. ExampleScrollableModel model = new ExampleScrollableModel(table, new String[]{"firstName", "lastName", "dateOfBirth"}, "more"); model.setIterateFirstLevel(true); table.setTableModel(model); setInitialised(true); } }
@Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); boolean isHeader = panel.getType() == WPanel.Type.HEADER; heading.setVisible(isHeader); utilBar.setVisible(isHeader && showUtilBar.isSelected()); menu.setVisible(isHeader && showMenu.isSelected()); panelContentRO.setVisible(!isHeader); }
/** * {@inheritDoc} */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); stringValue.setText("Value as String: " + input.getValueAsString()); dataValue.setText("Data: " + formatValue(input.getData())); Object value = null; if (input instanceof WBeanComponent) { value = ((WBeanComponent) input).getBeanValue(); } beanValue.setText("Bean: " + value); }
/** * {@inheritDoc} */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (!isInitialised()) { setPresets(); setInitialised(true); } if (trigger instanceof Disableable) { ((Disableable) trigger).setDisabled(cbDisableTrigger.isSelected()); } if (trigger instanceof Input) { ((Input) trigger).setReadOnly(cbReadOnlyTrigger.isSelected()); } }
/** * {@inheritDoc} */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (!isInitialised()) { LookupTable lookup = Factory.newInstance(LookupTable.class); for (Object entry : lookup.getTable("sex")) { WAbbrText abbr = new WAbbrText(); abbr.setTextWithDesc(entry); crtSexPanel.add(abbr); } for (Object entry : lookup.getTable("icao")) { WAbbrText abbr = new WAbbrText(); abbr.setTextWithCode(entry); crtIcaoPanel.add(abbr); } setInitialised(true); } } }
/** * {@inheritDoc} */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (!isInitialised()) { // Setup model FilterableBeanBoundDataModel model = new FilterableBeanBoundDataModel(BEAN_PROPERTIES); table.setTableModel(model); // Set the data as the bean on the table table.setBean(ExampleDataUtil.createExampleData()); buildFilterMenus(); String caption = "Use the menus in the column headers to show only the rows where the column value matches the value" + ((SELECTION_MODE == MenuSelectContainer.SelectionMode.MULTIPLE) ? "s " : " ") + " of the selected option" + ((SELECTION_MODE == MenuSelectContainer.SelectionMode.MULTIPLE) ? "s." : "."); if (getFilterableTableModel().isCaseInsensitiveMatch()) { caption += " The case of the text is ignored."; } table.setCaption(caption); setInitialised(true); } setUpClearAllAction(); }