Package org.apache.wicket.markup.html

Examples of org.apache.wicket.markup.html.WebMarkupContainer


        buildNew(newFragment);
        form.add(newFragment);
       
        form.add(new Image("add", new ResourceReference(EditorTemplate.class, "add.png")));

        WebMarkupContainer footer = new WebMarkupContainer("footer");
        Button saveButton = saveButton("save");
        saveButton.setDefaultModel(new ResourceModel("pam.details.action.save"));
        footer.add(saveButton);
        Button deleteBtn = deleteButton("delete");
        deleteBtn.add(new JavascriptEventConfirmation("onclick", new ResourceModel("pam.details.action.delete.confirm")));
        footer.add(deleteBtn);
        footer.add(new AttributeModifier("colspan", true, new Model<Integer>(Integer.valueOf(getColumnCount()))));
       
        form.add(footer);
        add(form);
       
        return this;
View Full Code Here


                }               
                item.add(actionLink);
            }
        };
        listview.setOutputMarkupId(true);
        final WebMarkupContainer tableGroup = new WebMarkupContainer("tableGroup");
        tableGroup.setOutputMarkupId(true);
        //tableGroup.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(5)));
        tableGroup.add(new PagingNavigator("navigator", listview));
        tableGroup.add(listview);
        final MultiLineLabel statusLabel = new MultiLineLabel("status",
                new PropertyModel(this, "message"));
        statusLabel.setOutputMarkupId(true);
        final Label tickerLabel =new Label("ticker",new PropertyModel(this,"ticker"));
        tickerLabel.setOutputMarkupId(true);
View Full Code Here

            protected Object load()
            {
                return getRepo();
            }
        };
        final WebMarkupContainer tableGroup = new WebMarkupContainer(
                "tableGroup");
        final ModalWindow metaDataModalWindow = new ModalWindow("modalwindow");
        final PageableListView listview = new PageableListView("repositories",
                getRepo, 10)
        {
            @Override
            protected void populateItem(final ListItem item)
            {
                final Repository repo = (Repository) item.getModelObject();
                item.add(new Label("name", repo.getName()));
                item.add(new Label("url", repo.getConfigPath()));
                item.add(new AjaxLink("edit", item.getModel())
                {

                    @Override
                    public void onClick(AjaxRequestTarget target)
                    {
                        metaDataModalWindow.setContent(new RepositoryPanel(
                                metaDataModalWindow.getContentId(), repo,
                                tableGroup));
                        metaDataModalWindow.show(target);
                    }
                });
                item.add(new AjaxLink("remove", item.getModel()){

                    @Override
                    public void onClick(AjaxRequestTarget target)
                    {
                        try
                        {
                            getPortletRequest().getPreferences().reset(repo.getName());
                            getRepositoryManager().reload(RemotePortletAppDeployer.getReposList(getPortletRequest()));
                            target.addComponent(tableGroup);
                        } catch (ReadOnlyException e)
                        {
                            logger.error("The preference is read-only: {}", repo.getName());
                        }
                    }                   
                });
            }
        };
        listview.setOutputMarkupId(true);

        tableGroup.setOutputMarkupId(true);
        tableGroup.add(new PagingNavigator("navigator", listview));
        tableGroup.add(listview);
        add(metaDataModalWindow);       
        add(tableGroup);
        add(new AjaxLink("newRepo"){

            @Override
View Full Code Here

*/
public class ApplicationsListEdit extends AdminPortletWebPage
{
    public ApplicationsListEdit()
    {
        WebMarkupContainer formGroup = new WebMarkupContainer("formGroup");
        add(formGroup);
        int appRows = ((ApplicationsListApplication)this.getApplication()).getPreferenceValueAsInteger("appRows");
        int portletRows = ((ApplicationsListApplication)this.getApplication()).getPreferenceValueAsInteger("portletRows");
        EditModeForm form = new EditModeForm("editModeForm", appRows, portletRows);       
        formGroup.add(form);
    }
View Full Code Here

 
  public LabelExample(String id)
  {
    super(id);

    final WebMarkupContainer container = new WebMarkupContainer("container");
    add(container);
    container.add(new DragSource()
    {
      @Override
      public Set<Operation> getOperations()
      {
        return dragOperations();
      }

      @Override
      public String[] getTypes()
      {
        return types();
      }

      @Override
      public void onAfterDrop(AjaxRequestTarget target, Transfer transfer)
      {
        if (transfer.getOperation() == Operation.MOVE)
        {
          Foo foo = transfer.getData();
          if (foo == model.getObject()) {
            model.setObject(null);
          }
         
          target.add(container);
        }
      }
    }.drag("span"));
    container.add(new DropTarget()
    {
      @Override
      public Set<Operation> getOperations()
      {
        return dropOperations();
      }

      @Override
      public String[] getTypes()
      {
        return types();
      }

      @Override
      public void onDrop(AjaxRequestTarget target, Transfer transfer, Location location)
          throws Reject
      {
        model.setObject(operate(transfer));

        target.add(container);
      }
    }.dropCenter(".labelContainer"));
   
    final Label label = new Label("label", model)
    {
      @Override
      public boolean isVisible()
      {
        return model.getObject() != null;
      }
    };
    label.setOutputMarkupId(true);
    container.add(label);
  }
View Full Code Here

  private Component newList(String id)
  {
    final FooList foos = new FooList();

    final WebMarkupContainer list = new WebMarkupContainer(id);
    final ListView<Foo> items = new ListView<Foo>("items", foos)
    {
      @Override
      protected ListItem<Foo> newItem(int index, IModel<Foo> model)
      {
        ListItem<Foo> item = super.newItem(index, model);
        item.setOutputMarkupId(true);
        return item;
      }

      @Override
      protected void populateItem(ListItem<Foo> item)
      {
        item.add(new Label("name", new PropertyModel<String>(item.getModel(), "name")));
      }
    };
    list.add(items);
    list.add(new DragSource()
    {
      @Override
      public Set<Operation> getOperations()
      {
        return dragOperations();
      }

      @Override
      public String[] getTypes()
      {
        return types();
      }

      @Override
      public void onAfterDrop(AjaxRequestTarget target, Transfer transfer)
      {
        if (transfer.getOperation() == Operation.MOVE)
        {
          foos.remove(transfer.getData());

          target.add(list);
        }
      }
    }.drag("div.item").initiate("span.initiate"));
    DropTarget dropTarget = new DropTarget()
    {
      @Override
      public Set<Operation> getOperations()
      {
        return dropOperations();
      }

      @Override
      public String[] getTypes()
      {
        return types();
      }

      @Override
      public void onDrop(AjaxRequestTarget target, Transfer transfer, Location location)
      {
        if (location.getComponent() == list)
        {
          foos.add(operate(transfer));
        }
        else
        {
          Foo foo = location.getModelObject();
          switch (location.getAnchor())
          {
            case TOP :
            case LEFT :
              foos.addBefore(operate(transfer), foo);
              break;
            case BOTTOM :
            case RIGHT :
              foos.addAfter(operate(transfer), foo);
              break;
            default :
              transfer.reject();
          }

          target.add(list);
        }
      }
    };
    if ("vertical".equals(id))
    {
      dropTarget.dropTopAndBottom("div.item");
    }
    else
    {
      dropTarget.dropLeftAndRight("div.item");
    }
    list.add(dropTarget);

    return list;
  }
View Full Code Here

        return name.substring(0, name.indexOf("Example"));
      }
    }));

    WebMarkupContainer controls = new WebMarkupContainer("controls",
        new CompoundPropertyModel<Example>(this));
    add(controls);

    controls.add(new CheckBoxMultipleChoice<Operation>("dragOperations", operations)
        .setSuffix(""));

    controls.add(new CheckBoxMultipleChoice<Operation>("dropOperations", operations)
        .setSuffix(""));

    controls.add(new TextField<String[]>("types", String[].class)
    {
      @Override
      @SuppressWarnings("unchecked")
      public <C> IConverter<C> getConverter(Class<C> type)
      {
View Full Code Here

    if (selectCallback == null)
    {
      throw new IllegalArgumentException("ISelectCallback must not be null.");
    }

    flatCalendar = new WebMarkupContainer("flatCalendar");
    flatCalendar.setOutputMarkupId(true);
    add(flatCalendar);

    add(new CallbackScript("callbackScript", selectCallback)
    {
View Full Code Here

    if (selectCallback == null)
    {
      throw new IllegalArgumentException("ISelectCallback must not be null.");
    }

    flatCalendar = new WebMarkupContainer("flatCalendar");
    flatCalendar.setOutputMarkupId(true);
    add(flatCalendar);

    add(new CallbackScript("callbackScript", selectCallback)
    {
View Full Code Here

    {
        super(id);
       
        setRenderBodyOnly(true);
       
        WebMarkupContainer button;
        if (Boolean.valueOf(ajaxFlag)) {
            button = new AjaxSubmitLink("button", form) {
                private static final long serialVersionUID = 1L;

                @Override
                protected void onSubmit(AjaxRequestTarget target, Form form)
                {
                    BeanSubmitButton.this.onAction(target, form, bean);
                    updateFeedbackPanels(target); // see comments in function javadoc
                }
   
   
                @Override
                protected void onError(AjaxRequestTarget target, Form form)
                {
                    BeanSubmitButton.this.onError(target, form, bean);
                    updateFeedbackPanels(target); // see comments in function javadoc
                }
   
                @Override
                protected IAjaxCallDecorator getAjaxCallDecorator()
                {
                    return decorator;
                }
   
                @Override
                protected void onComponentTag(ComponentTag tag)
                {
                    super.onComponentTag(tag);
                    tag.put("class", (label instanceof Label ? "beanSubmitButton" : "beanSubmitImageButton") );
                    tag.put("href", "javascript:void(0)"); // don't do href="#"
                }
            };
        }
        else {
            button = new SubmitLink("button", form) {
                private static final long serialVersionUID = 1L;

                @Override
                public void onSubmit()
                {
                    BeanSubmitButton.this.onAction(null, getForm(), bean);
                }
   
                @Override
                protected void onComponentTag(ComponentTag tag)
                {
                    super.onComponentTag(tag);
                    tag.put("class", (label instanceof Label ? "beanSubmitButton" : "beanSubmitImageButton") );
                }
            };
        }
           
        if (confirmMsg != null) {
            button.add( new AttributeModifier("onclick", true, null) {
                private static final long serialVersionUID = 1L;

                @Override
                protected String newValue(String currentValue, String replacementValue)
                {
                    return "if (!confirm('" + confirmMsg + "')) return false; else { " + currentValue + " }";
                }
            });
        }
       
        if (Boolean.valueOf(isDefault)) {
            button.add( new SimpleAttributeModifier("id", "bfDefaultButton") );
        }

        button.setOutputMarkupId(true);
        add(button);
        button.add(label);
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.WebMarkupContainer

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.