org.apache.wicket.markup.html.form.TextArea Java Examples

The following examples show how to use org.apache.wicket.markup.html.form.TextArea. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JsonDiffPanel.java    From syncope with Apache License 2.0 6 votes vote down vote up
public JsonDiffPanel(
        final BaseModal<String> modal,
        final IModel<String> first,
        final IModel<String> second,
        final PageReference pageRef) {

    super(modal, pageRef);
    this.second = second;
    this.first = first;
    TextArea<String> jsonEditorInfoDefArea1 = new TextArea<>("jsonEditorInfo1", this.first);
    TextArea<String> jsonEditorInfoDefArea2 = new TextArea<>("jsonEditorInfo2", this.second);
    jsonEditorInfoDefArea1.setMarkupId("jsonEditorInfo1").setOutputMarkupPlaceholderTag(true);
    jsonEditorInfoDefArea2.setMarkupId("jsonEditorInfo2").setOutputMarkupPlaceholderTag(true);
    add(jsonEditorInfoDefArea1);
    add(jsonEditorInfoDefArea2);
}
 
Example #2
Source File: MailPanel.java    From nextreports-server with Apache License 2.0 6 votes vote down vote up
protected void initBasicComponents() {
	add(new Label("subject", getString("ActionContributor.Run.destination.subject")));

	TextField<String> subjectField = new TextField<String>("subjectField", new PropertyModel<String>(destination,
			"mailSubject"));
	subjectField.setLabel(new Model<String>(getString("ActionContributor.Run.destination.subject")));
	add(subjectField);

	add(new Label("body", getString("ActionContributor.Run.destination.body")));

	TextArea<String> bodyArea = new TextArea<String>("bodyArea", new PropertyModel<String>(destination, "mailBody"));
	bodyArea.setLabel(new Model<String>(getString("ActionContributor.Run.destination.body")));
	add(bodyArea);

	add(new Label("to", getString("ActionContributor.Run.destination.to")));
	addTableLinks();

	provider = new RecipientDataProvider((SmtpDestination) destination);
	recipientsPanel = new RecipientsPanel("recipientsPanel", provider);
	add(recipientsPanel);
			
}
 
Example #3
Source File: SourceFormComponent.java    From onedev with MIT License 6 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();
	
	Charset detectedCharset = ContentDetector.detectCharset(getModelObject());
	Charset charset = detectedCharset!=null?detectedCharset:Charset.defaultCharset();
	
	String source = new String(getModelObject(), charset);
	add(input = new TextArea<String>("input", Model.of(source)) {

		@Override
		protected boolean shouldTrimInput() {
			return false;
		}
		
	});
	setOutputMarkupId(true);
}
 
Example #4
Source File: CodeEditorPanel.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
private TextArea<String> createTextArea(String id) {
    return new TextArea<String>(id, CodeEditorPanel.this.getModel()) {
        @Override
        public void renderHead(IHeaderResponse response) {
            super.renderHead(response);

        }

        @Override
        protected void onInitialize() {
            super.onInitialize();
            setOutputMarkupPlaceholderTag(true);
        }

        @Override
        public void convertInput() {
            super.convertInput();
            CodeEditorPanel.this.setNewConvertedInput(getConvertedInput());
        }
    };
}
 
Example #5
Source File: AceEditorPanel.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
public AceEditorPanel(final String id, final IModel<String> model)
{
  super(id, model);
  editor = new WebMarkupContainer("editor");
  editor.setOutputMarkupId(true);
  textArea = new TextArea<String>("textArea", model);
  textArea.setOutputMarkupId(true);
  textArea.add(new AjaxFormComponentUpdatingBehavior("timerchange") { // event is thrown through JS
    @Override
    protected void onUpdate(AjaxRequestTarget target) {
      // java model is updated now
      onIdleModelUpdate();
    }
  });
  add(textArea);
  add(editor);
}
 
Example #6
Source File: AbstractICSExportDialog.java    From projectforge-webapp with GNU General Public License v3.0 6 votes vote down vote up
@SuppressWarnings("serial")
public void redraw()
{
  clearContent();
  {
    gridBuilder.newSecurityAdviceBox(Model.of(getString("calendar.icsExport.securityAdvice")));
    addFormFields();
    final FieldsetPanel fs = gridBuilder.newFieldset(getString("calendar.abonnement.url")).setLabelSide(false);
    urlTextArea = new TextArea<String>(fs.getTextAreaId(), new Model<String>() {
      @Override
      public String getObject()
      {
        return WicketUtils.getAbsoluteContextPath() + getUrl();
      };
    });
    urlTextArea.setOutputMarkupId(true);
    fs.add(urlTextArea);
    urlTextArea.add(AttributeModifier.replace("onClick", "$(this).select();"));
    urlTextArea.add(new QRCodeDivAppenderBehavior());
  }
}
 
Example #7
Source File: TagEditorPanel.java    From webanno with Apache License 2.0 6 votes vote down vote up
public TagEditorPanel(String aId, IModel<TagSet> aTagSet, IModel<Tag> aTag)
{
    super(aId, aTag);
    
    setOutputMarkupId(true);
    setOutputMarkupPlaceholderTag(true);
    
    selectedTagSet = aTagSet;
    selectedTag = aTag;
    
    Form<Tag> form = new Form<>("form", CompoundPropertyModel.of(aTag));
    add(form);
    
    form.add(new TextField<String>("name")
            .add(new TagExistsValidator())
            .setRequired(true));
    form.add(new TextArea<String>("description"));
    
    form.add(new LambdaAjaxButton<>("save", this::actionSave));
    form.add(new LambdaAjaxLink("delete", this::actionDelete)
            .onConfigure(_this -> _this.setVisible(form.getModelObject().getId() != null)));
    form.add(new LambdaAjaxLink("cancel", this::actionCancel));
}
 
Example #8
Source File: UIVisualizersRegistry.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
public UIVisualizersRegistry()
{
	registerUIComponentFactory(DefaultVisualizer.INSTANCE);
	registerUIComponentFactory(new SimpleVisualizer("textarea", MultiLineLabel.class, TextArea.class, OType.STRING));
	registerUIComponentFactory(new SimpleVisualizer("table", true, LinksPropertyDataTablePanel.class, 
																   LinksPropertyDataTablePanel.class,
																   OType.LINKLIST, 
																   OType.LINKSET, 
																   OType.LINKBAG));
	registerUIComponentFactory(new SimpleVisualizer(VISUALIZER_RESTRICTED_WIDTH, TextBreakPanel.class, TextField.class, OType.STRING));
	registerUIComponentFactory(new ListboxVisualizer());
	registerUIComponentFactory(new PasswordVisualizer());
	registerUIComponentFactory(new HTMLVisualizer());
	registerUIComponentFactory(new UrlLinkVisualizer());
	registerUIComponentFactory(new MarkDownVisualizer());
	registerUIComponentFactory(new LocalizationVisualizer());
	registerUIComponentFactory(new ImageVisualizer());
	registerUIComponentFactory(new SuggestVisualizer());
	registerUIComponentFactory(new CodeVisualizer());
	registerUIComponentFactory(new JavaScriptCodeVisualizer());
	registerUIComponentFactory(new SqlCodeVisualizer());
	registerUIComponentFactory(new HexVisualizer());
	registerUIComponentFactory(new LinksAsEmbeddedVisualizer());
}
 
Example #9
Source File: ChainLayerTraitsEditor.java    From webanno with Apache License 2.0 6 votes vote down vote up
@Override
protected void initializeForm(Form<ChainLayerTraits> aForm)
{
    aForm.add(new ValidationModeSelect("validationMode", getLayerModel()));
    
    aForm.add(new AnchoringModeSelect("anchoringMode", getLayerModel()));
    
    aForm.add(new OverlapModeSelect("overlapMode", getLayerModel()));
    
    CheckBox linkedListBehavior = new CheckBox("linkedListBehavior");
    linkedListBehavior.setModel(PropertyModel.of(getLayerModel(), "linkedListBehavior"));
    aForm.add(linkedListBehavior);
    
    CheckBox crossSentence = new CheckBox("crossSentence");
    crossSentence.setOutputMarkupPlaceholderTag(true);
    crossSentence.setModel(PropertyModel.of(getLayerModel(), "crossSentence"));
    crossSentence.add(visibleWhen(() -> !isBlank(getLayerModelObject().getType())));
    aForm.add(crossSentence);
    
    TextArea<String> onClickJavascriptAction = new TextArea<String>("onClickJavascriptAction");
    onClickJavascriptAction.setModel(PropertyModel.of(getLayerModel(), "onClickJavascriptAction"));
    onClickJavascriptAction.add(new AttributeModifier("placeholder",
            "alert($PARAM.PID + ' ' + $PARAM.PNAME + ' ' + $PARAM.DOCID + ' ' + "
                    + "$PARAM.DOCNAME + ' ' + $PARAM.fieldname);"));
    aForm.add(onClickJavascriptAction);
}
 
Example #10
Source File: TextAreaFeatureEditor.java    From webanno with Apache License 2.0 6 votes vote down vote up
@Override
protected AbstractTextComponent createInputField()
{
    TextArea<String> textarea = new TextArea<>("value");
    textarea.add(new AjaxPreventSubmitBehavior());
    try {
        String traitsString = getModelObject().feature.getTraits();
        StringFeatureTraits traits = 
                JSONUtil.fromJsonString(StringFeatureTraits.class, traitsString);
        textarea.add(new AttributeModifier("rows", traits.getCollapsedRows()));
        textarea.add(new AttributeAppender("onfocus",
                "this.rows=" + traits.getExpandedRows() + ";"));
        textarea.add(new AttributeAppender("onblur",
                "this.rows=" + traits.getCollapsedRows() + ";"));
    }
    catch (IOException e) {
        e.printStackTrace();
    }
    return textarea;
}
 
Example #11
Source File: XMLEditorPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
public XMLEditorPanel(
        final BaseModal<String> modal,
        final IModel<String> content,
        final boolean readOnly,
        final PageReference pageRef) {

    super(modal, pageRef);
    this.content = content;
    this.readOnly = readOnly;
    final TextArea<String> xmlEditorInfoDefArea = new TextArea<>("xmlEditorInfo", this.content);
    xmlEditorInfoDefArea.setMarkupId("xmlEditorInfo").setOutputMarkupPlaceholderTag(true);
    add(xmlEditorInfoDefArea);
}
 
Example #12
Source File: QualifierEditor.java    From inception with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new fragement for editing a qualifier.<br>
 * The editor has two slightly different behaviors, depending on the value of
 * {@code isNewQualifier}:
 * <ul>
 * <li>{@code !isNewQualifier}: Save button commits changes, cancel button discards unsaved
 * changes, delete button removes the qualifier from the statement.</li>
 * <li>{@code isNewQualifier}: Save button commits changes (creates a new qualifier in the
 * statement), cancel button removes the qualifier from the UI, delete button is not visible
 * .</li>
 * </ul>
 *
 * @param aId
 *            markup ID
 * @param aQualifier
 *            qualifier model
 * @param isNewQualifier
 *            whether the qualifier being edited is new, meaning it has no corresponding
 *            qualifier in the KB backend
 */
public EditMode(String aId, IModel<KBQualifier> aQualifier, boolean isNewQualifier)
{
    super(aId, "editMode", QualifierEditor.this, aQualifier);

    IModel<KBQualifier> compoundModel = CompoundPropertyModel.of(aQualifier);

    Form<KBQualifier> form = new Form<>("form", compoundModel);
    DropDownChoice<KBProperty> type = new BootstrapSelect<>("property");
    type.setChoiceRenderer(new ChoiceRenderer<>("uiLabel"));
    type.setChoices(kbService.listProperties(kbModel.getObject(), false));
    type.setRequired(true);
    type.setOutputMarkupId(true);
    form.add(type);
    initialFocusComponent = type;

    form.add(new TextField<>("language"));

    Component valueTextArea = new TextArea<String>("value");
    form.add(valueTextArea);

    form.add(new LambdaAjaxButton<>("create", QualifierEditor.this::actionSave));
    form.add(new LambdaAjaxLink("cancel", t -> {
        if (isNewQualifier) {
            QualifierEditor.this.actionCancelNewQualifier(t);
        } else {
            QualifierEditor.this.actionCancelExistingQualifier(t);
        }
    }));
    form.add(new LambdaAjaxLink("delete", QualifierEditor.this::actionDelete)
        .setVisibilityAllowed(!isNewQualifier));

    add(form);
}
 
Example #13
Source File: JsonEditorPanel.java    From syncope with Apache License 2.0 5 votes vote down vote up
public JsonEditorPanel(
        final BaseModal<String> modal,
        final IModel<String> content,
        final boolean readOnly,
        final PageReference pageRef) {

    super(modal, pageRef);
    this.content = content;
    this.readOnly = readOnly;
    TextArea<String> jsonEditorInfoDefArea = new TextArea<>("jsonEditorInfo", this.content);
    jsonEditorInfoDefArea.setMarkupId("jsonEditorInfo").setOutputMarkupPlaceholderTag(true);
    add(jsonEditorInfoDefArea);
}
 
Example #14
Source File: HexVisualizer.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
public <V> Component createComponent(String id, DisplayMode mode, IModel<ODocument> documentModel,
		IModel<OProperty> propertyModel, IModel<V> valueModel) {
	IModel<byte[]> model = (IModel<byte[]>)valueModel;
	switch (mode)
       {
           case VIEW:
               return new MultiLineLabel(id, valueModel);
           case EDIT:
               return new TextArea<>(id, valueModel).setType(byte[].class);
           default:
               return null;
       }
}
 
Example #15
Source File: MarkDownVisualizer.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <V> Component createComponent(String id, DisplayMode mode, IModel<ODocument> documentModel,
                                     IModel<OProperty> propertyModel, IModel<V> valueModel) {
    switch (mode) {
        case VIEW:
            return new Label(id, new MarkDownModel((IModel<String>) valueModel)).setEscapeModelStrings(false);
        case EDIT:
            return new TextArea<String>(id, (IModel<String>) valueModel).setType(String.class);
        default:
            return null;
    }
}
 
Example #16
Source File: AbstractFieldsetPanel.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
/**
 * @param textArea
 * @return The created InputPanel.
 * @see TextAreaPanel#TextAreaPanel(String, Component)
 */
public TextAreaPanel add(final TextArea< ? > textArea, final boolean autogrow)
{
  final TextAreaPanel panel = new TextAreaPanel(newChildId(), textArea, autogrow);
  add(panel);
  return panel;
}
 
Example #17
Source File: BatchDefinitionPanel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
private void init() {
  	
  	// Scheduler Batch is shown only for NEXT REPORTS
  	if (!ReportConstants.NEXT.equals(schedulerJob.getReport().getType())) {
  		return;
  	}
  	
  	Label parameter = new Label("parameter", getString("ActionContributor.Run.batch.parameter"));
      add(parameter);
              
      ro.nextreports.engine.Report report = NextUtil.getNextReport(storageService.getSettings(), schedulerJob.getReport());
      Map<String, QueryParameter> paramMap = ParameterUtil.getUsedNotHiddenParametersMap(report);
      List<String> parameters = new ArrayList<String>();
      for (QueryParameter qp : paramMap.values()) {
      	if (qp.getSelection().equals(QueryParameter.SINGLE_SELECTION) && (qp.getSource() != null)) {
      		parameters.add(qp.getName());
      	}
      }               
      
      parameterChoice = new DropDownChoice<String>("parameterChoice", 
      		new PropertyModel<String>(schedulerJob, "batchDefinition.parameter"), parameters);
      parameterChoice.setNullValid(true);
      add(parameterChoice);
      
      add(new Label("dataQuery", getString("ActionContributor.Run.batch.dataQuery")));

TextArea<String> dataQueryArea = new TextArea<String>("dataQueryArea", new PropertyModel<String>(schedulerJob, "batchDefinition.dataQuery"));
dataQueryArea.setLabel(new Model<String>(getString("ActionContributor.Run.batch.dataQuery")));
add(dataQueryArea);		

add(new Label("infoDynamic", getString("ActionContributor.Run.batch.dynamic")));
add(new Label("infoDependent", getString("ActionContributor.Run.batch.dependent")));
  }
 
Example #18
Source File: ChangeJasperParameterPanel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
private void selectType(TextArea selectArea) {
    if (JasperParameterSource.SINGLE.equals(parameter.getType())) {
        parameter.setSelect("");
        selectArea.setEnabled(false);
    } else {
        selectArea.setEnabled(true);
    }
}
 
Example #19
Source File: ViewInfoPanel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
public ViewInfoPanel(String id, final Report report, final Report original, String versionName) {
     super(id, new Model<Report>(report));

     String name = report.getName();
     if (versionName != null) {
         name += " (" +  getString("ActionContributor.Info.version")   + ": " + versionName + ")";
     }
     add(new Label("legend", getString("ActionContributor.Info.reportInfo")));
     add(new Label("entityId", getString("ActionContributor.Info.id")));
     add(new Label("reportId", report.getId()));
     add(new Label("entityName", getString("ActionContributor.Info.entityName")));
     add(new Label("reportName", name));
     add(new Label("descLabel", getString("ActionContributor.Info.description")));
     add(new TextArea<String>("description", new Model<String>(report.getDescription())));

     addParametersTable(report);
     
     String sql = "NA";
     if (ReportConstants.NEXT.equals(report.getType())) {
     	sql = ReportUtil.getSql(NextUtil.getNextReport(settings.getSettings(), report));
     } else if (ReportConstants.JASPER.equals(report.getType())) {
     	sql = JasperReportsUtil.getMasterQuery(report);
     }
     add(new MultiLineLabel("sql", new Model<String>(sql)));

     add(new AjaxLink<Void>("cancel") {
     	
private static final long serialVersionUID = 1L;

@Override
         public void onClick(AjaxRequestTarget target) {
             EntityBrowserPanel panel = findParent(EntityBrowserPanel.class);
             panel.backwardWorkspace(target);
         }
         
     });
 }
 
Example #20
Source File: ViewInfoPanel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
public ViewInfoPanel(String id, final Chart chart, final Chart original, String versionName) {
     super(id, new Model<Chart>(chart));

     String name = chart.getName();
     if (versionName != null) {
         name += " (" +  getString("ActionContributor.Info.version")  + ": " + versionName + ")";
     }
     add(new Label("legend", getString("ActionContributor.Info.chartInfo")));
     add(new Label("entityId", getString("ActionContributor.Info.id")));
     add(new Label("reportId", chart.getId()));
     add(new Label("entityName", getString("ActionContributor.Info.entityName")));
     add(new Label("reportName", name));
     add(new Label("descLabel", getString("ActionContributor.Info.description")));
     add(new TextArea<String>("description", new Model<String>(chart.getDescription())));

     addParametersTable(chart);
     
     String sql = ReportUtil.getSql(NextUtil.getNextReport(settings.getSettings(), chart));        
     add(new MultiLineLabel("sql", new Model<String>(sql)));

     add(new AjaxLink<Void>("cancel") {
     	
private static final long serialVersionUID = 1L;

@Override
         public void onClick(AjaxRequestTarget target) {
             EntityBrowserPanel panel = findParent(EntityBrowserPanel.class);
             panel.backwardWorkspace(target);
         }

     });
 }
 
Example #21
Source File: UserProfilePanel.java    From openmeetings with Apache License 2.0 5 votes vote down vote up
@Override
protected void onInitialize() {
	User u = (User)getDefaultModelObject();

	infoPanel.add(new ProfileImagePanel("img", u.getId()));
	infoPanel.add(new Label("firstname"));
	infoPanel.add(new Label("lastname"));
	infoPanel.add(new Label("timeZoneId"));
	infoPanel.add(new Label("regdate"));
	infoPanel.add(new TextArea<String>("userOffers").setEnabled(false));
	infoPanel.add(new TextArea<String>("userSearchs").setEnabled(false));
	if (getUserId().equals(u.getId()) || u.isShowContactData()
			|| (u.isShowContactDataToContacts() && contactDao.isContact(u.getId(), getUserId())))
	{
		addressDenied.setVisible(false);
		address.add(new Label("address.phone"));
		address.add(new Label("address.street"));
		address.add(new Label("address.additionalname"));
		address.add(new Label("address.zip"));
		address.add(new Label("address.town"));
		address.add(new Label("country", getCountryName(u.getAddress().getCountry(), getLocale())));
		address.add(new Label("address.comment"));
	} else {
		address.setVisible(false);
		addressDenied.setDefaultModelObject(getString(u.isShowContactDataToContacts() ? "1269" : "1268"));
	}
	infoPanel.add(address.setDefaultModel(getDefaultModel()));
	infoPanel.add(addressDenied);

	add(infoPanel.setOutputMarkupId(true));
	super.onInitialize();
}
 
Example #22
Source File: StringLiteralValueEditor.java    From inception with Apache License 2.0 5 votes vote down vote up
public StringLiteralValueEditor(String aId, IModel<KBStatement> aModel)
{
    super(aId, CompoundPropertyModel.of(aModel));

    value = new TextArea<>("value");
    value.setOutputMarkupId(true);
    // Statement values cannot be null/empty - well, in theory they could be the empty string,
    // but we treat the empty string as null
    value.setRequired(true);
    add(value);

    add(new TextField<>("language"));
}
 
Example #23
Source File: CodePropertyViewer.java    From onedev with MIT License 5 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();
	
	input = new TextArea<>("input", Model.of(StringUtils.join(code, "\n")));
	add(input);
	
	input.setOutputMarkupId(true);
}
 
Example #24
Source File: PlainEditPanel.java    From onedev with MIT License 5 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();
	
	add(input = new TextArea<String>("input", Model.of(new String(getModelObject(), StandardCharsets.UTF_8))) {

		@Override
		protected boolean shouldTrimInput() {
			return false;
		}
		
	});
}
 
Example #25
Source File: DynamicTextAreaFeatureEditor.java    From webanno with Apache License 2.0 5 votes vote down vote up
@Override
protected AbstractTextComponent createInputField()
{
    textarea = new TextArea<>("value");
    textarea.setOutputMarkupId(true);
    textarea.add(new AjaxPreventSubmitBehavior());
    return textarea;
}
 
Example #26
Source File: RelationLayerTraitsEditor.java    From webanno with Apache License 2.0 5 votes vote down vote up
@Override
protected void initializeForm(Form<RelationLayerTraits> aForm)
{
    aForm.add(new ValidationModeSelect("validationMode", getLayerModel()));
    
    OverlapModeSelect overlapMode = new OverlapModeSelect("overlapMode", getLayerModel());
    // Not configurable for layers that attach to tokens (currently that is the only layer on
    // which we use the attach feature)
    overlapMode.add(enabledWhen(() -> getLayerModelObject().getAttachFeature() == null));
    aForm.add(overlapMode);
    
    aForm.add(new ColoringRulesConfigurationPanel("coloringRules",
            getLayerModel(), getTraitsModel().bind("coloringRules.rules")));
    
    CheckBox crossSentence = new CheckBox("crossSentence");
    crossSentence.setOutputMarkupPlaceholderTag(true);
    crossSentence.setModel(PropertyModel.of(getLayerModel(), "crossSentence"));
    // Not configurable for layers that attach to tokens (currently that is the only layer on
    // which we use the attach feature)
    crossSentence.add(enabledWhen(() -> getLayerModelObject().getAttachFeature() == null));
    aForm.add(crossSentence);

    TextArea<String> onClickJavascriptAction = new TextArea<String>("onClickJavascriptAction");
    onClickJavascriptAction.setModel(PropertyModel.of(getLayerModel(), "onClickJavascriptAction"));
    onClickJavascriptAction.add(new AttributeModifier("placeholder",
            "alert($PARAM.PID + ' ' + $PARAM.PNAME + ' ' + $PARAM.DOCID + ' ' + "
                    + "$PARAM.DOCNAME + ' ' + $PARAM.fieldname);"));
    aForm.add(onClickJavascriptAction);
}
 
Example #27
Source File: LdapForm.java    From openmeetings with Apache License 2.0 5 votes vote down vote up
public LdapForm(String id, WebMarkupContainer listContainer, final LdapConfig ldapConfig) {
	super(id, new CompoundPropertyModel<>(ldapConfig));
	setOutputMarkupId(true);
	this.listContainer = listContainer;

	add(new CheckBox("active"));
	add(new DateLabel("inserted"));
	add(new Label("insertedby.login"));
	add(new DateLabel("updated"));
	add(new Label("updatedby.login"));
	add(new CheckBox("addDomainToUserName"));
	add(new TextField<String>("domain"));
	add(new TextArea<String>("comment"));
}
 
Example #28
Source File: ProjectDetailPanel.java    From webanno with Apache License 2.0 5 votes vote down vote up
public ProjectDetailPanel(String id, IModel<Project> aModel)
{
    super(id, aModel);
    
    projectModel = aModel;
    
    Form<Project> form = new Form<>("form", CompoundPropertyModel.of(aModel));
    add(form);
    
    TextField<String> projectNameTextField = new TextField<>("name");
    projectNameTextField.setRequired(true);
    projectNameTextField.add(new ProjectExistsValidator());
    projectNameTextField.add(new ProjectNameValidator());
    form.add(projectNameTextField);

    // If we run in development mode, then also show the ID of the project
    form.add(idLabel = new Label("id"));
    idLabel.setVisible(RuntimeConfigurationType.DEVELOPMENT
            .equals(getApplication().getConfigurationType()));

    form.add(new TextArea<String>("description").setOutputMarkupId(true));
    
    DropDownChoice<ScriptDirection> scriptDirection = new BootstrapSelect<>("scriptDirection");
    scriptDirection.setChoiceRenderer(new EnumChoiceRenderer<>(this));
    scriptDirection.setChoices(Arrays.asList(ScriptDirection.values()));
    form.add(scriptDirection);
    
    form.add(new CheckBox("disableExport").setOutputMarkupPlaceholderTag(true));

    form.add(new CheckBox("anonymousCuration").setOutputMarkupPlaceholderTag(true));

    form.add(projectTypes = makeProjectTypeChoice());
    
    form.add(new LambdaAjaxButton<>("save", this::actionSave));
}
 
Example #29
Source File: PollEditForm.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
/**
 * @see org.projectforge.web.wicket.AbstractEditForm#init()
 */
@Override
protected void init()
{
  super.init();

  final Collection<PFUserDO> attendeePFUserList = new ArrayList<PFUserDO>();
  final Collection<String> emailList = new ArrayList<String>();
  for (final PollAttendeeDO attendee : pollAttendeeDao.getListByPoll(data)) {
    if (attendee.getUser() != null) {
      attendeePFUserList.add(attendee.getUser());
    } else {
      if (attendee.getEmail() != null) {
        emailList.add(attendee.getEmail());
      }
    }
  }

  gridBuilder.newSplitPanel(GridSize.COL50);

  // new title
  final FieldsetPanel fsTitle = gridBuilder.newFieldset(getString("plugins.poll.new.title"));
  final RequiredTextField<String> title = new RequiredTextField<String>(fsTitle.getTextFieldId(), new PropertyModel<String>(this.data, "title"));
  fsTitle.add(title);

  // new location
  final FieldsetPanel fsLocation = gridBuilder.newFieldset(getString("plugins.poll.new.location"));
  final PFAutoCompleteTextField<String> location = new PFAutoCompleteTextField<String>(fsLocation.getTextFieldId(), new PropertyModel<String>(
      this.data, "location")) {
    private static final long serialVersionUID = -2309992819521957913L;

    @Override
    protected List<String> getChoices(final String input)
    {
      return getBaseDao().getAutocompletion("location", input);
    }
  };
  fsLocation.add(location);

  // new description
  final FieldsetPanel fsDesc = gridBuilder.newFieldset(getString("plugins.poll.new.description"));
  final TextArea<String> desc = new TextArea<String>(fsDesc.getTextAreaId(), new PropertyModel<String>(this.data, "description"));
  fsDesc.add(desc);

  // attendee list
  final FieldsetPanel fsAttendee = gridBuilder.newFieldset(getString("plugins.poll.attendee.users"));
  final UsersProvider usersProvider = new UsersProvider();
  final MultiChoiceListHelper<PFUserDO> attendeeHelper = new MultiChoiceListHelper<PFUserDO>().setComparator(new UsersComparator())
      .setFullList(usersProvider.getSortedUsers());
  attendeeHelper.setAssignedItems(attendeePFUserList);
  final Select2MultiChoice<PFUserDO> attendees = new Select2MultiChoice<PFUserDO>(fsAttendee.getSelect2MultiChoiceId(),
      new PropertyModel<Collection<PFUserDO>>(attendeeHelper, "assignedItems"), usersProvider);
  fsAttendee.add(attendees);

  // new email list
  // TODO email list
}
 
Example #30
Source File: TextAreaPanel.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
public TextAreaPanel(final String id, final TextArea< ? > field)
{
  this(id, field, false);
}