Package org.openengsb.ui.common.model

Examples of org.openengsb.ui.common.model.LocalizableStringModel


        createEditor();
    }

    private void initEditor() {
        retrieveDescriptor(connectorType);
        add(new Label("service.name", new LocalizableStringModel(this, descriptor.getName())));
        add(new Label("service.description", new LocalizableStringModel(this, descriptor.getDescription())));
    }
View Full Code Here


    private ListView<DomainProvider> makeServiceList() {
        return new ListView<DomainProvider>("domains", domainProvider) {
            @Override
            protected void populateItem(final ListItem<DomainProvider> item) {
                final String domainType = item.getModelObject().getId();
                item.add(new Label("domain.name", new LocalizableStringModel(this, item.getModelObject().getName())));
                item.add(new Link<DomainProvider>("proxy.create.new", item.getModel()) {
                    @Override
                    public void onClick() {
                        setResponsePage(new ConnectorEditorPage(getModelObject().getId(),
                            Constants.EXTERNAL_CONNECTOR_PROXY));
                    }
                });
                item.add(new Label("domain.description", new LocalizableStringModel(this, item.getModelObject()
                    .getDescription())));

                item.add(new Label("domain.class", item.getModelObject().getDomainInterface().getName()));

                IModel<? extends List<? extends ConnectorProvider>> connectorProviderModel =
                    new LoadableDetachableModel<List<? extends ConnectorProvider>>() {
                        @Override
                        protected List<? extends ConnectorProvider> load() {
                            return utilsService.listServices(ConnectorProvider.class,
                                String.format("(%s=%s)", Constants.DOMAIN_KEY, domainType));
                        }
                    };
                item.add(new ListView<ConnectorProvider>("services", connectorProviderModel) {

                    @Override
                    protected void populateItem(ListItem<ConnectorProvider> item) {
                        ServiceDescriptor desc = item.getModelObject().getDescriptor();
                        item.add(new Link<ConnectorProvider>("create.new", item.getModel()) {
                            @Override
                            public void onClick() {
                                setResponsePage(new ConnectorEditorPage(domainType, getModelObject().getId()));
                            }
                        });
                        item.add(new Label("service.name", new LocalizableStringModel(this, desc.getName())));
                        item.add(new Label("service.description", new LocalizableStringModel(this, desc
                            .getDescription())));
                    }
                });
            }
        };
View Full Code Here

        mainComponent.setEnabled(editable);
        if (validator != null) {
            mainComponent.add(validator);
        }
        mainComponent.setRequired(attribute.isRequired());
        mainComponent.setLabel(new LocalizableStringModel(this, attribute.getName()));
        SimpleFormComponentLabel label = new SimpleFormComponentLabel("name", mainComponent);
        label.add(AttributeModifier.replace("for", attribute.getId()));
        if (attribute.isRequired()) {
            label.add(AttributeModifier.replace("class", "required"));
        }
View Full Code Here

    }

    private void addTooltip(AttributeDefinition attribute) {
        Image tooltip = new Image("tooltip", new PackageResourceReference(AbstractField.class, "balloon.png"));
        if (attribute.hasDescription()) {
            tooltip.add(new AttributeModifier("title", new LocalizableStringModel(this, attribute
                .getDescription())));
        } else {
            tooltip.setVisible(false);
        }
        add(tooltip);
View Full Code Here

    @Override
    protected ModelFacade<String> createFormComponent(AttributeDefinition attribute, IModel<String> model) {
        final Map<String, LocalizableStringModel> labels = new HashMap<String, LocalizableStringModel>();
        final List<String> values = new ArrayList<String>();
        for (Option o : attribute.getOptions()) {
            labels.put(o.getValue(), new LocalizableStringModel(this, o.getLabel()));
            values.add(o.getValue());
        }
        DropDownChoice<String> choice = new DropDownChoice<String>("field", model, values,
                new IChoiceRenderer<String>() {
                    @Override
View Full Code Here

TOP

Related Classes of org.openengsb.ui.common.model.LocalizableStringModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.