Skip to content
Snippets Groups Projects
Commit a74640ac authored by izabel's avatar izabel
Browse files

[LMS-1044] reason description - longer

SVN: 11905
parent 117ca309
No related branches found
No related tags found
No related merge requests found
/*
* Copyright 2009 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.lang.StringEscapeUtils;
/**
* Text field allowing to specify reason.
*
* @author Izabela Adamczyk
*/
public class ReasonField extends MultilineVarcharField
{
public static final String ID_SUFFIX = "_reason";
public ReasonField(IMessageProvider messageProvider, boolean mandatory)
{
super(messageProvider.getMessage(Dict.REASON), mandatory);
setMaxLength(GenericConstants.DESCRIPTION_1000);
}
public ReasonField(IMessageProvider messageProvider, boolean mandatory, String parentId)
{
this(messageProvider, mandatory);
setId(parentId + ID_SUFFIX);
}
public void setValueAndUnescape(String unescapedValue)
{
setValue(StringEscapeUtils.unescapeHtml(unescapedValue));
}
}
...@@ -18,10 +18,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget ...@@ -18,10 +18,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget
import java.util.List; import java.util.List;
import com.extjs.gxt.ui.client.widget.form.TextField;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.VarcharField; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.ReasonField;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider;
/** /**
...@@ -37,7 +35,7 @@ public abstract class AbstractDataListDeletionConfirmationDialog<T> extends ...@@ -37,7 +35,7 @@ public abstract class AbstractDataListDeletionConfirmationDialog<T> extends
private static final int FIELD_WIDTH = 180; private static final int FIELD_WIDTH = 180;
protected TextField<String> reason; protected ReasonField reason;
public AbstractDataListDeletionConfirmationDialog(IMessageProvider messageProvider, List<T> data) public AbstractDataListDeletionConfirmationDialog(IMessageProvider messageProvider, List<T> data)
{ {
...@@ -50,9 +48,8 @@ public abstract class AbstractDataListDeletionConfirmationDialog<T> extends ...@@ -50,9 +48,8 @@ public abstract class AbstractDataListDeletionConfirmationDialog<T> extends
formPanel.setLabelWidth(LABEL_WIDTH); formPanel.setLabelWidth(LABEL_WIDTH);
formPanel.setFieldWidth(FIELD_WIDTH); formPanel.setFieldWidth(FIELD_WIDTH);
reason = new VarcharField(messageProvider.getMessage(Dict.REASON), true); reason = new ReasonField(messageProvider, true);
reason.focus(); reason.focus();
reason.setMaxLength(250);
reason.addKeyListener(keyListener); reason.addKeyListener(keyListener);
formPanel.add(reason); formPanel.add(reason);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment