Example usage for com.google.gwt.user.cellview.client CellTable setLoadingIndicator

List of usage examples for com.google.gwt.user.cellview.client CellTable setLoadingIndicator

Introduction

In this page you can find the example usage for com.google.gwt.user.cellview.client CellTable setLoadingIndicator.

Prototype

@Override
    public void setLoadingIndicator(Widget widget) 

Source Link

Usage

From source file:com.codenvy.ide.client.propertiespanel.common.namespace.NameSpaceEditorViewImpl.java

License:Open Source License

private CellTable<NameSpace> createTable(@Nonnull CellTableResources resource) {
    CellTable<NameSpace> table = new CellTable<>(0, resource);

    Column<NameSpace, String> nameSpace = new Column<NameSpace, String>(new TextCell()) {
        @Override//from   w w  w. ja va 2  s .  c  o  m
        public String getValue(NameSpace object) {
            return object.toString();
        }
    };

    table.setLoadingIndicator(null);

    table.addColumn(nameSpace);
    table.setColumnWidth(nameSpace, 570, Style.Unit.PX);

    final SingleSelectionModel<NameSpace> selectionModel = new SingleSelectionModel<>();
    selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
        @Override
        public void onSelectionChange(SelectionChangeEvent event) {
            delegate.onSelectedNameSpace(selectionModel.getSelectedObject());
        }
    });
    table.setSelectionModel(selectionModel);

    return table;
}

From source file:com.codenvy.ide.client.propertiespanel.common.propertyconfig.PropertyConfigViewImpl.java

License:Open Source License

/**
 * Returns cell table entity. Adds column names and values to table. Sets selection model to table.
 *
 * @param localizationConstant//from w w  w.j a v  a  2 s . c  o m
 *         localization constant which contains special names of element in current table
 */
private CellTable<Property> createTable(@Nonnull final WSO2EditorLocalizationConstant localizationConstant,
        @Nonnull CellTableResources resource) {

    final CellTable<Property> table = new CellTable<>(0, resource);

    final SingleSelectionModel<Property> selectionModel = new SingleSelectionModel<>();
    selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
        @Override
        public void onSelectionChange(SelectionChangeEvent event) {
            delegate.onSelectedProperty(selectionModel.getSelectedObject());
        }
    });
    table.setSelectionModel(selectionModel);

    TextColumn<Property> name = new TextColumn<Property>() {
        @Override
        public String getValue(Property property) {
            String name = property.getProperty(NAME);

            return name == null ? "" : name;
        }
    };

    TextColumn<Property> expression = new TextColumn<Property>() {
        @Override
        public String getValue(Property property) {
            String value = property.getProperty(VALUE);

            return value == null ? "" : value;
        }
    };

    TextColumn<Property> type = new TextColumn<Property>() {
        @Override
        public String getValue(Property property) {
            ValueType type = property.getProperty(TYPE);

            return type == null ? "" : type.name();
        }
    };

    table.addColumn(name, localizationConstant.columnName());
    table.addColumn(type, localizationConstant.columnType());
    table.addColumn(expression, localizationConstant.columnExpression());

    table.setColumnWidth(name, 210, Style.Unit.PX);
    table.setColumnWidth(type, 120, Style.Unit.PX);
    table.setColumnWidth(expression, 210, Style.Unit.PX);

    table.setLoadingIndicator(null);

    return table;
}

From source file:com.codenvy.ide.client.propertiespanel.endpoints.address.property.PropertyViewImpl.java

License:Open Source License

/** Adds columns names and values to table. Sets selection model to table. */
private CellTable<Property> createTable(@Nonnull CellTableResources resource) {
    CellTable<Property> table = new CellTable<>(0, resource);

    final SingleSelectionModel<Property> selectionModel = new SingleSelectionModel<>();
    selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
        @Override/*from   w w  w. ja v a2  s . com*/
        public void onSelectionChange(SelectionChangeEvent event) {
            delegate.onPropertySelected(selectionModel.getSelectedObject());
        }
    });
    table.setSelectionModel(selectionModel);

    TextColumn<Property> name = new TextColumn<Property>() {
        @Override
        public String getValue(Property property) {
            return property.getProperty(NAME);
        }
    };

    TextColumn<Property> value = new TextColumn<Property>() {
        @Override
        public String getValue(Property property) {
            if (ValueType.LITERAL.equals(property.getProperty(TYPE))) {
                return property.getProperty(VALUE);
            }

            return property.getProperty(EXPRESSION);
        }
    };

    TextColumn<Property> type = new TextColumn<Property>() {
        @Override
        public String getValue(Property property) {
            ValueType type = property.getProperty(TYPE);

            if (type == null) {
                return "";
            }

            return type.name();
        }
    };

    TextColumn<Property> scope = new TextColumn<Property>() {
        @Override
        public String getValue(Property property) {
            Property.Scope scope = property.getProperty(SCOPE);

            if (scope == null) {
                return "";
            }

            return scope.getValue();
        }
    };

    table.addColumn(name, locale.columnName());
    table.addColumn(value, locale.columnValue());
    table.addColumn(type, locale.columnType());
    table.addColumn(scope, locale.columnScope());

    table.setColumnWidth(name, 150, Style.Unit.PX);
    table.setColumnWidth(value, 150, Style.Unit.PX);
    table.setColumnWidth(type, 60, Style.Unit.PX);
    table.setColumnWidth(scope, 100, Style.Unit.PX);

    table.setLoadingIndicator(null);

    return table;
}

From source file:com.codenvy.ide.client.propertiespanel.mediators.arguments.ArgumentsConfigViewImpl.java

License:Open Source License

private CellTable<Arg> createTable(@Nonnull final WSO2EditorLocalizationConstant localizationConstant,
        @Nonnull CellTableResources resource) {

    final CellTable<Arg> table = new CellTable<>(0, resource);

    final SingleSelectionModel<Arg> selectionModel = new SingleSelectionModel<>();
    selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
        @Override// ww w  .  j a v a  2s.  com
        public void onSelectionChange(SelectionChangeEvent event) {
            delegate.onSelectedArg(selectionModel.getSelectedObject());
        }
    });
    table.setSelectionModel(selectionModel);

    TextColumn<Arg> value = new TextColumn<Arg>() {
        @Override
        public String getValue(Arg object) {
            return object.getProperty(ARG_VALUE);
        }
    };

    TextColumn<Arg> type = new TextColumn<Arg>() {
        @Override
        public String getValue(Arg arg) {
            ArgType argType = arg.getProperty(ARG_TYPE);

            return argType == null ? "" : argType.getValue();
        }
    };

    TextColumn<Arg> evaluator = new TextColumn<Arg>() {
        @Override
        public String getValue(Arg arg) {
            Evaluator evaluator = arg.getProperty(ARG_EVALUATOR);

            return evaluator == null ? "" : evaluator.getValue();
        }
    };

    table.addColumn(type, localizationConstant.columnType());
    table.addColumn(value, localizationConstant.columnValue());
    table.addColumn(evaluator, localizationConstant.columnEvaluator());

    table.setColumnWidth(type, 120, PX);
    table.setColumnWidth(value, 210, PX);
    table.setColumnWidth(evaluator, 120, PX);

    table.setLoadingIndicator(null);

    return table;
}

From source file:org.eclipse.che.ide.extension.machine.client.perspective.widgets.machine.appliance.processes.ProcessesViewImpl.java

License:Open Source License

private CellTable<MachineProcessDto> createTable(@NotNull TableResources tableResources) {
    CellTable<MachineProcessDto> table = new CellTable<>(0, tableResources);

    TextColumn<MachineProcessDto> name = new TextColumn<MachineProcessDto>() {
        @Override//from  ww  w. j a  v a  2s.c  om
        public String getValue(MachineProcessDto descriptor) {
            return "Process " + descriptor.getPid();
        }
    };

    TextColumn<MachineProcessDto> protocol = new TextColumn<MachineProcessDto>() {
        @Override
        public String getValue(MachineProcessDto descriptor) {
            //TODO it's stub. Need add real value
            return "tcp";
        }
    };

    TextColumn<MachineProcessDto> port = new TextColumn<MachineProcessDto>() {
        @Override
        public String getValue(MachineProcessDto descriptor) {
            //TODO it's stub. Need add real value
            return "8000";
        }
    };

    TextColumn<MachineProcessDto> time = new TextColumn<MachineProcessDto>() {
        @Override
        public String getValue(MachineProcessDto descriptor) {
            //TODO it's stub. Need add real value
            return "10:12:24";
        }
    };

    TextColumn<MachineProcessDto> active = new TextColumn<MachineProcessDto>() {
        @Override
        public String getValue(MachineProcessDto descriptor) {
            boolean isActive = descriptor.isAlive();

            //TODO it's stub. Need add real value
            return isActive ? locale.processActive() : locale.processActive();
        }
    };

    table.addColumn(name, locale.processTableName());
    table.addColumn(protocol, locale.processTableProtocol());
    table.addColumn(port, locale.processTablePort());
    table.addColumn(time, locale.processTableTime());
    table.addColumn(active, locale.processTableActive());

    final SingleSelectionModel<MachineProcessDto> selectionModel = new SingleSelectionModel<>();
    selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
        @Override
        public void onSelectionChange(SelectionChangeEvent event) {
            delegate.onProcessClicked(selectionModel.getSelectedObject());
        }
    });
    table.setSelectionModel(selectionModel);
    table.setLoadingIndicator(null);

    return table;
}

From source file:org.eclipse.che.ide.extension.machine.client.perspective.widgets.machine.appliance.server.ServerViewImpl.java

License:Open Source License

@NotNull
private CellTable<Server> createTable(@NotNull TableResources tableResources) {
    CellTable<Server> table = new CellTable<>(0, tableResources);
    table.setLoadingIndicator(null);

    TextColumn<Server> ref = new TextColumn<Server>() {
        @Override/* w  w  w . ja v a  2  s.c  om*/
        public String getValue(Server server) {
            return server.getRef();
        }
    };

    TextColumn<Server> exposedPort = new TextColumn<Server>() {
        @Override
        public String getValue(Server server) {
            return server.getPort();
        }
    };

    TextColumn<Server> address = new TextColumn<Server>() {
        @Override
        public String getValue(Server server) {
            return server.getAddress();
        }
    };

    TextColumn<Server> url = new TextColumn<Server>() {
        @Override
        public String getValue(Server server) {
            return server.getUrl();
        }
    };

    table.addColumn(ref, locale.infoServerRef());
    table.addColumn(exposedPort, locale.infoServerPort());
    table.addColumn(address, locale.infoServerAddress());
    table.addColumn(url, locale.infoServerUrl());

    return table;
}