Example usage for com.google.gwt.editor.client.adapters ListEditor of

List of usage examples for com.google.gwt.editor.client.adapters ListEditor of

Introduction

In this page you can find the example usage for com.google.gwt.editor.client.adapters ListEditor of.

Prototype

public static <T, E extends Editor<T>> ListEditor<T, E> of(EditorSource<E> source) 

Source Link

Document

Create a ListEditor backed by an EditorSource.

Usage

From source file:com.google.gerrit.client.admin.AccessSectionEditor.java

License:Apache License

public AccessSectionEditor(ProjectAccess access) {
    projectAccess = access;//  w w  w  . j  a v  a  2  s.c  o  m

    permissionSelector = new ValueListBox<String>(PermissionNameRenderer.INSTANCE);
    permissionSelector.addValueChangeHandler(new ValueChangeHandler<String>() {
        @Override
        public void onValueChange(ValueChangeEvent<String> event) {
            if (!Util.C.addPermission().equals(event.getValue())) {
                onAddPermission(event.getValue());
            }
        }
    });

    initWidget(uiBinder.createAndBindUi(this));
    permissions = ListEditor.of(new PermissionEditorSource());
}

From source file:com.google.gerrit.client.admin.PermissionEditor.java

License:Apache License

public PermissionEditor(Project.NameKey projectName, boolean readOnly, AccessSection section,
        LabelTypes labelTypes) {/*  w  w w. j  av  a  2s . c om*/
    this.readOnly = readOnly;
    this.section = section;
    this.projectName = projectName;
    this.labelTypes = labelTypes;

    normalName = new ValueLabel<String>(PermissionNameRenderer.INSTANCE);
    deletedName = new ValueLabel<String>(PermissionNameRenderer.INSTANCE);

    initWidget(uiBinder.createAndBindUi(this));
    groupToAdd.setProject(projectName);
    rules = ListEditor.of(new RuleEditorSource());

    exclusiveGroup.setEnabled(!readOnly);
    exclusiveGroup.setVisible(RefConfigSection.isValid(section.getName()));

    if (readOnly) {
        addContainer.removeFromParent();
        addContainer = null;

        deletePermission.removeFromParent();
        deletePermission = null;
    }
}

From source file:com.google.gerrit.client.admin.ProjectAccessEditor.java

License:Apache License

public ProjectAccessEditor() {
    initWidget(uiBinder.createAndBindUi(this));
    local = ListEditor.of(new Source(localContainer));
}

From source file:com.google.gwt.sample.dynatablerf.client.widgets.FavoritesWidget.java

License:Apache License

public FavoritesWidget(EventBus eventBus, RequestFactory factory, FavoritesManager manager) {
    this.eventBus = eventBus;
    this.factory = factory;
    this.manager = manager;

    // Create the UI
    initWidget(GWT.<Binder>create(Binder.class).createAndBindUi(this));

    // Create the driver which manages the data-bound widgets
    Driver driver = GWT.<Driver>create(Driver.class);

    // Use a ListEditor that uses our NameLabelSource
    ListEditor<PersonProxy, NameLabel> editor = ListEditor.of(new NameLabelSource());

    // Configure the driver
    ListEditor<PersonProxy, NameLabel> listEditor = editor;
    driver.initialize(eventBus, factory, listEditor);

    // Notice the backing list is essentially anonymous.
    driver.display(new ArrayList<PersonProxy>());

    // Modifying this list triggers widget creation and destruction
    displayedList = listEditor.getList();
}

From source file:com.tasktop.c2c.server.tasks.client.widgets.admin.products.ProjectAdminTasksEditView.java

License:Open Source License

private ProjectAdminTasksEditView() {
    createComponentsTable();/*w  w  w.  j  a va  2s .c  o m*/
    createReleasesTable();
    initWidget(ourUiBinder.createAndBindUi(this));
    productName.setErrorMap(errorTable);
    componentsEditor = ListEditor.of(new EditorSource<ComponentEditor>() {
        @Override
        public ComponentEditor create(int index) {
            return new ComponentEditor();
        }

    });
    milestonesEditor = ListEditor.of(new EditorSource<MilestoneEditor>() {
        @Override
        public MilestoneEditor create(int index) {
            return new MilestoneEditor();
        }
    });
    driver.initialize(this);
}

From source file:org.dashbuilder.client.widgets.dataset.editor.column.ColumnListEditor.java

License:Apache License

@PostConstruct
public void init() {
    listEditor = ListEditor.of(createDataColumnDefEditorSource());
    view.init(this);
}