Package com.vaadin.ui

Examples of com.vaadin.ui.DefaultFieldFactory


        tf.setEnabled(false);
        twoLayout.addComponent(tf);

        form = new Form();
        form.setCaption("Enabled");
        form.setFormFieldFactory(new DefaultFieldFactory() {

            @Override
            public Field<?> createField(Item item, Object propertyId,
                    Component uiContext) {
                Field<?> f = super.createField(item, propertyId, uiContext);
                f.setEnabled(!"disabled".equals(propertyId));
                return f;
            }

        });
        form.setItemDataSource(new BeanItem<MyBean>(new MyBean()));
        content.addComponent(form);

        table = new Table("Enabled");
        table.setPageLength(7);
        table.addContainerProperty("Text", String.class, null);
        for (int i = 0; i < 150; i++) {
            Item item = table.addItem("Item" + i);
            Property<String> p = item.getItemProperty("Text");
            p.setValue(i % 5 == 0 ? "enabled" : "disabled");
        }

        table.setTableFieldFactory(new DefaultFieldFactory() {

            @Override
            public Field<?> createField(Container container, Object itemId,
                    Object propertyId, Component uiContext) {
                Field<?> f = super.createField(container, itemId, propertyId,
View Full Code Here


        public MyForm() {
            setWidth(100, Unit.PERCENTAGE);
            setHeight(null);
            setImmediate(true);

            setFormFieldFactory(new DefaultFieldFactory() {

                @Override
                public TextField createField(Item item, Object propertyId,
                        Component uiContext) {
                    TextField t = new TextField();
View Full Code Here

        final VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);

        final Form form = new Form();
        form.setFooter(null);
        form.setFormFieldFactory(new DefaultFieldFactory() {
            @Override
            public Field createField(Item item, Object propertyId,
                    Component uiContext) {
                if ("custom".equals(propertyId)) {
                    return new BooleanField();
View Full Code Here

        it.getItemProperty(COL_A).setValue(fieldA);
        it.getItemProperty(COL_B).setValue("Some text here");

        final Table table = new Table("", container);
        table.setColumnCollapsingAllowed(true);
        table.setTableFieldFactory(new DefaultFieldFactory() {
            @Override
            public Field<?> createField(Container container, Object itemId,
                    Object propertyId, Component uiContext) {
                if (COL_B.equals(propertyId)) {
                    Field<String> field = new TextField() {
View Full Code Here

        layout.addComponent(new Label(
                "A customized field (a two-state button) for editing a boolean value."));

        final Form form = new Form();
        form.setFormFieldFactory(new DefaultFieldFactory() {
            @Override
            public Field createField(Item item, Object propertyId,
                    Component uiContext) {
                if ("custom".equals(propertyId)) {
                    return new BooleanField();
View Full Code Here

    public Form getTeamForm() {
        if (null == teamForm) {
            teamForm = new Form();
            teamForm.setWidth("350px");

            teamForm.setFormFieldFactory(new DefaultFieldFactory() {
                @Override
                public Field createField(Item item, Object propertyId,
                        Component uiContext) {
                    Field field = null;
                    if ("manager".equals(propertyId)) {
View Full Code Here

 
  public RightsTable(final I18NSource source, final GenericVaadinPortlet2BpmApplication application) {
    this.source = source;
    this.application = application;
    table.setContainerDataSource(dataSource);
    table.setTableFieldFactory(new DefaultFieldFactory() {
     
      @Override
      public Field createField(Container container, Object itemId,
          Object propertyId, Component uiContext) {
View Full Code Here

 
  private final static Logger logger = Logger.getLogger(QueueForm.class.getName());
 
  public QueueForm(final ProcessToolContext ctx, final I18NSource source, final GenericVaadinPortlet2BpmApplication application) {
   
    setFormFieldFactory(new DefaultFieldFactory() {
            @Override
            public Field createField(Item item, Object propertyId, Component uiContext) {
          Field field = super.createField(item, propertyId, uiContext);

          if ("process".equalsIgnoreCase(propertyId.toString())) {
View Full Code Here

TOP

Related Classes of com.vaadin.ui.DefaultFieldFactory

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.