public AccessSectionEditor(ProjectAccess access) { projectAccess = access; permissionSelector = new ValueListBox<>(new PermissionNameRenderer(access.getCapabilities())); permissionSelector.addValueChangeHandler( new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { if (!AdminConstants.I.addPermission().equals(event.getValue())) { onAddPermission(event.getValue()); } } }); initWidget(uiBinder.createAndBindUi(this)); permissions = ListEditor.of(new PermissionEditorSource()); }
@Override protected void initDetailsTable() { super.initDetailsTable(); this.eventClassTypeName = new ValueListBox<String>(); this.eventClassTypeName.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { EventClassViewImpl.this.fireChanged(); } }); this.eventClassTypeName.setWidth("100%"); Label label = new Label("Class type"); label.addStyleName(this.avroUiStyle.requiredField()); detailsTable.setWidget(4, 0, label); this.detailsTable.setWidget(4, 1, this.eventClassTypeName); }
private void initPersonalTitle() { personalTitleListBox = new ValueListBox<PersonalTitle>(new Renderer<PersonalTitle>() { @Override public String render(PersonalTitle object) { return object != null ? object.toString() : ""; } @Override public void render(PersonalTitle object, Appendable appendable) throws IOException { appendable.append(render(object)); } }); List<PersonalTitle> titles = new ArrayList<PersonalTitle>(); titles.add(null); titles.addAll(Arrays.asList(PersonalTitle.values())); personalTitleListBox.setAcceptableValues(titles); }
@Override protected void onEntityRetrieved() { if (!create) { detailsView.setTitle(entity.getName()); detailsView.getApplicationToken().setValue(entity.getApplicationToken()); } detailsView.getApplicationName().setValue(entity.getName()); final ValueListBox<String> serviceNames = this.detailsView.getCredentialsServiceName(); if (serviceNames != null) { KaaAdmin.getDataSource().getCredentialsServiceNames(new AsyncCallback<List<String>>() { @Override public void onFailure(Throwable caught) { Utils.handleException(caught, ApplicationActivity.this.detailsView); } @Override public void onSuccess(List<String> result) { if (result != null && !result.isEmpty()) { serviceNames.setValue(result.get(0)); } ApplicationActivity.this.detailsView.getCredentialsServiceName() .setAcceptableValues(result); } }); serviceNames.setValue(this.entity.getCredentialsServiceName()); } }
@Override protected void onEntityRetrieved() { super.onEntityRetrieved(); ValueListBox<String> eventClassTypes = this.detailsView.getEventClassTypes(); if (eventClassTypes != null) { List<String> eventClassTypeList = new ArrayList<>(); for (EventClassType eventClassType : EventClassType.values()) { eventClassTypeList.add(eventClassType.name()); } EventClassActivity.this.detailsView .getEventClassTypes() .setAcceptableValues(eventClassTypeList); } if (place.getCtlSchemaId() != null) { KaaAdmin.getDataSource().getLastCtlSchemaReferenceDto(place.getCtlSchemaId(), new AsyncCallback<CtlSchemaReferenceDto>() { @Override public void onFailure(Throwable caught) { Utils.handleException(caught, EventClassActivity.this.detailsView); } @Override public void onSuccess(CtlSchemaReferenceDto ctlSchemaReferenceDto) { detailsView.getCtlSchemaReference().setValue(ctlSchemaReferenceDto); detailsView.getName().setValue(place.getNameEc()); place.setCtlSchemaId(null); } }); } }
@Override public ValueListBox<LogLevel> getLevelListBox() { return levelListBox; }
List() { list = new ValueListBox<>(rangeRenderer); initWidget(list); }
@Ignore public <T> ValueListBox<T> createToStringListBox(){ return createToStringListBox(null,null); }
@Override public ValueListBox<SchemaInfoDto> getConfigurationSchemaInfo() { return configurationSchemaInfo; }
@Override public ValueListBox<PluginInfoDto> getPluginInfo() { return pluginInfo; }
@Override protected void initDetailsTable() { applicationName = new KaaAdminSizedTextBox(DEFAULT_TEXTBOX_SIZE, editable); applicationName.setWidth("100%"); Label titleLabel = new Label(Utils.constants.title()); if (editable) { titleLabel.addStyleName(avroUiStyle.requiredField()); } detailsTable.setWidget(0, 0, titleLabel); detailsTable.setWidget(0, 1, applicationName); applicationName.addInputHandler(this); applicationName.setFocus(true); if (!create) { applicationToken = new KaaAdminSizedTextBox(DEFAULT_TEXTBOX_SIZE * 2, false); applicationToken.setWidth("100%"); applicationToken.setEnabled(false); applicationToken.setReadOnly(true); Label tokenLabel = new Label(Utils.constants.appToken()); detailsTable.setWidget(2, 0, tokenLabel); detailsTable.setWidget(2, 1, applicationToken); } if (KaaAdmin.isDevMode()) { generateSdkButton = new Button(Utils.constants.generateSdk()); detailsTable.setWidget(3, 0, generateSdkButton); } else { this.credentialsServiceName = new ValueListBox<String>(); this.credentialsServiceName.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { ApplicationViewImpl.this.fireChanged(); } }); this.credentialsServiceName.setWidth("100%"); Label label = new Label(Utils.constants.credentialsService()); label.addStyleName(this.avroUiStyle.requiredField()); this.detailsTable.setWidget(3, 0, label); this.detailsTable.setWidget(3, 1, this.credentialsServiceName); } }
@Override public ValueListBox<String> getCredentialsServiceName() { return this.credentialsServiceName; }
@Override public ValueListBox<Integer> getVersion() { return version; }
@Override public ValueListBox<String> getEventClassTypes() { return eventClassTypeName; }
@Override public ValueListBox<VersionDto> getConfigurationSchemaVersion() { return configurationSchemaVersion; }
@Override public ValueListBox<VersionDto> getProfileSchemaVersion() { return profileSchemaVersion; }
@Override public ValueListBox<VersionDto> getNotificationSchemaVersion() { return notificationSchemaVersion; }
@Override public ValueListBox<VersionDto> getLogSchemaVersion() { return logSchemaVersion; }
@Override public ValueListBox<UserVerifierDto> getDefaultUserVerifier() { return defaultUserVerifier; }
@Override public ValueListBox<Integer> getMinSchemaVersion() { return minSchemaVersion; }
@Override public ValueListBox<Integer> getMaxSchemaVersion() { return maxSchemaVersion; }
@Override public ValueListBox<SchemaInfoDto> getNotificationSchemaInfo() { return notificationSchemaInfo; }
/** * Returns a collection of classes whose non-abstract methods should always be replaced with * no-ops. By default, this list includes {@link Composite}, {@link DOM} {@link UIObject}, * {@link Widget}, {@link Image}, and most subclasses of {@link Panel}. It will also include any * classes specified via the {@link WithClassesToStub} annotation on the test class. This makes * it much safer to test code that uses or extends these types. * <p> * This list can be customized via {@link WithClassesToStub} or by defining a new test runner * extending {@link GwtMockitoTestRunner} and overriding this method. This allows users to * explicitly stub out particular classes that are causing problems in tests. If you override this * method, you will probably want to retain the classes that are stubbed here by doing something * like this: * * <pre> * @Override * protected Collection<Class<?>> getClassesToStub() { * Collection<Class<?>> classes = super.getClassesToStub(); * classes.add(MyBaseWidget.class); * return classes; * } * </pre> * * @return a collection of classes whose methods should be stubbed with no-ops while running tests */ protected Collection<Class<?>> getClassesToStub() { Collection<Class<?>> classes = new LinkedList<Class<?>>(); classes.add(Composite.class); classes.add(DOM.class); classes.add(UIObject.class); classes.add(Widget.class); classes.add(DataGrid.class); classes.add(HTMLTable.class); classes.add(Image.class); classes.add(AbsolutePanel.class); classes.add(CellList.class); classes.add(CellPanel.class); classes.add(CellTable.class); classes.add(ComplexPanel.class); classes.add(DeckLayoutPanel.class); classes.add(DeckPanel.class); classes.add(DecoratorPanel.class); classes.add(DockLayoutPanel.class); classes.add(DockPanel.class); classes.add(FlowPanel.class); classes.add(FocusPanel.class); classes.add(HorizontalPanel.class); classes.add(HTMLPanel.class); classes.add(LayoutPanel.class); classes.add(Panel.class); classes.add(PopupPanel.class); classes.add(RenderablePanel.class); classes.add(ResizeLayoutPanel.class); classes.add(SimpleLayoutPanel.class); classes.add(SimplePanel.class); classes.add(SplitLayoutPanel.class); classes.add(StackPanel.class); classes.add(VerticalPanel.class); classes.add(ValueListBox.class); WithClassesToStub annotation = unitTestClass.getAnnotation(WithClassesToStub.class); if (annotation != null) { classes.addAll(Arrays.asList(annotation.value())); } return classes; }
@Test @SuppressWarnings("unused") public void shouldBeAbleToCreateValueListBox() { new ValueListBox<Object>(); }
ValueListBox<LogLevel> getLevelListBox();
ValueListBox<SchemaInfoDto> getNotificationSchemaInfo();
ValueListBox<PluginInfoDto> getPluginInfo();
public ValueListBox<Integer> getVersion();
ValueListBox<String> getCredentialsServiceName();
ValueListBox<Integer> getMinSchemaVersion();
ValueListBox<Integer> getMaxSchemaVersion();
ValueListBox<SchemaInfoDto> getConfigurationSchemaInfo();
ValueListBox<String> getEventClassTypes();
ValueListBox<VersionDto> getConfigurationSchemaVersion();
ValueListBox<VersionDto> getProfileSchemaVersion();
ValueListBox<VersionDto> getNotificationSchemaVersion();
ValueListBox<VersionDto> getLogSchemaVersion();
ValueListBox<UserVerifierDto> getDefaultUserVerifier();