use of org.adempiere.webui.component.Label in project adempiere by adempiere.
the class WEditor method init.
private void init() {
label = new Label("");
label.setValue(strLabel);
label.setTooltiptext(description);
this.setMandatory(mandatory);
if (readOnly || !updateable) {
this.setReadWrite(false);
} else {
this.setReadWrite(true);
}
((HtmlBasedComponent) component).setTooltiptext(description);
if (gridField != null)
label.setTooltiptext(description + "\n\n" + gridField.getHelp());
else
label.setTooltiptext(description);
//init listeners
for (String event : this.getEvents()) {
component.addEventListener(event, this);
}
component.addEventListener(Events.ON_FOCUS, new EventListener() {
public void onEvent(Event event) throws Exception {
hasFocus = true;
if (gridTab != null) {
CWindowToolbar toolbar = tabPanel.getGlobalToolbar();
if (toolbar != null) {
if (tabPanel.getGlobalToolbar().getCurrentPanel() != toolbar.getCurrentPanel()) {
tabPanel.getGlobalToolbar().getCurrentPanel().setUnselected(toolbar.getCurrentPanel());
tabPanel.getGlobalToolbar().getCurrentPanel().setSelected(tabPanel);
}
}
}
}
});
component.addEventListener(Events.ON_BLUR, new EventListener() {
public void onEvent(Event event) throws Exception {
hasFocus = false;
}
});
repaintComponent();
}
use of org.adempiere.webui.component.Label in project adempiere by adempiere.
the class FindWindow method getEditorComponent.
// addOperators
/**
* Get Editor
* @param row row
* @return Editor component
**/
public Component getEditorComponent(ListItem row, boolean to) {
String columnName = getColumnName(row);
boolean between = false;
Listbox listOp = (Listbox) row.getFellow("listOperator" + row.getId());
String betweenValue = listOp.getSelectedItem().getValue().toString();
String opValue = MQuery.OPERATORS[MQuery.BETWEEN_INDEX].getValue();
if (to && betweenValue != null && betweenValue.equals(opValue))
between = true;
boolean enabled = !to || (to && between);
// Create Editor
GridField field = getTargetMField(columnName);
if (field == null)
return new Label("");
WEditor editor = null;
if (field.isKey())
editor = new WNumberEditor(field);
else
editor = WebEditorFactory.getEditor(field, true);
if (editor == null)
editor = new WStringEditor(field);
field.addPropertyChangeListener(editor);
editor.addValueChangeListener(this);
editor.setValue(null);
editor.setReadWrite(enabled);
editor.setVisible(enabled);
editor.dynamicDisplay();
// So we have to do this after setting the ReadWrite
if (enabled && editor instanceof WTableDirEditor) {
((WTableDirEditor) editor).actionRefresh();
}
//
return editor.getComponent();
}
use of org.adempiere.webui.component.Label in project adempiere by adempiere.
the class InfoAssignmentPanel method statInit.
// InfoAssignmentPanel
/**
* Static Setup - add fields to parameterPanel.
* <pre>
* ResourceType Resource DateTimeFrom DateTimeTo New
* </pre>
*/
private void statInit() {
fieldResourceType = new WTableDirEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MResourceType.Table_Name, MResourceType.COLUMNNAME_S_ResourceType_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "S_ResourceType_ID"), "", false, false, true);
fieldResourceType.getComponent().addEventListener(Events.ON_CHANGE, this);
;
fieldResourceType.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_S_ResourceType_ID");
fieldResource = new WTableDirEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MResource.Table_Name, MResource.COLUMNNAME_S_Resource_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "S_Resource_ID"), "", false, false, true);
fieldResource.getComponent().addEventListener(Events.ON_CHANGE, this);
fieldResource.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_S_Resource_ID");
bNew.setImage(ServletFns.resolveThemeURL("~./images/New16.png"));
fieldFrom.setWidth("180px");
fieldTo.setWidth("180px");
fieldFrom.setAttribute("zk_component_ID", "Lookup_Criteria_fieldFrom");
fieldFrom.addEventListener(Events.ON_CHANGE, this);
fieldTo.setAttribute("zk_component_ID", "Lookup_Criteria_fieldTo");
fieldTo.addEventListener(Events.ON_CHANGE, this);
SimpleDateFormat dateFormat = DisplayType.getDateFormat(DisplayType.Date, AEnv.getLanguage(Env.getCtx()));
fieldFrom.setFormat(dateFormat.toPattern());
fieldTo.setFormat(dateFormat.toPattern());
bNew.addEventListener(Events.ON_CLICK, this);
bNew.setAttribute("zk_component_ID", "Lookup_Criteria_bNew");
Rows rows = new Rows();
Row row = new Row();
rows.appendChild(row);
row.appendChild(fieldResourceType.getLabel().rightAlign());
row.appendChild(fieldResource.getLabel().rightAlign());
row.appendChild(labelFrom.rightAlign());
row.appendChild(labelTo.rightAlign());
row.appendChild(new Label());
row = new Row();
rows.appendChild(row);
row.appendChild(fieldResourceType.getComponent());
row.appendChild(fieldResource.getComponent());
Div div = new Div();
div.setAlign("right");
div.appendChild(fieldFrom);
row.appendChild(div);
div = new Div();
div.setAlign("right");
div.appendChild(fieldTo);
row.appendChild(div);
row.appendChild(bNew);
p_criteriaGrid.appendChild(rows);
super.setSizes();
}
use of org.adempiere.webui.component.Label in project adempiere by adempiere.
the class InfoBPartnerPanel method initComponents.
/**
* Initialize the zk components.
*/
private void initComponents() {
labelValue = new Label();
labelValue.setValue(Util.cleanAmp(Msg.translate(Env.getCtx(), "Value")));
labelName = new Label();
labelName.setValue(Util.cleanAmp(Msg.translate(Env.getCtx(), "Name")));
labelContact = new Label();
labelContact.setValue(Msg.translate(Env.getCtx(), "Contact"));
labelEMail = new Label();
labelEMail.setValue(Msg.getMsg(Env.getCtx(), "EMail"));
labelPostal = new Label();
labelPostal.setValue(Msg.getMsg(Env.getCtx(), "Postal"));
labelPhone = new Label();
labelPhone.setValue(Msg.translate(Env.getCtx(), "Phone"));
//Record_ID
fieldID = 0;
//
fieldValue = new Textbox();
fieldValue.setMaxlength(40);
fieldValue.setAttribute("zk_component_ID", "Lookup_Criteria_fieldValue");
fieldValue.addEventListener(Events.ON_CHANGE, this);
//
fieldName = new Textbox();
fieldName.setMaxlength(40);
fieldName.setAttribute("zk_component_ID", "Lookup_Criteria_fieldName");
fieldName.addEventListener(Events.ON_CHANGE, this);
//
fieldContact = new Textbox();
fieldContact.setMaxlength(40);
fieldContact.setAttribute("zk_component_ID", "Lookup_Criteria_fieldContact");
fieldContact.addEventListener(Events.ON_CHANGE, this);
//
fieldEMail = new Textbox();
fieldEMail.setMaxlength(40);
fieldEMail.setAttribute("zk_component_ID", "Lookup_Criteria_fieldEMail");
fieldEMail.addEventListener(Events.ON_CHANGE, this);
//
fieldPostal = new Textbox();
fieldPostal.setMaxlength(40);
fieldPostal.setAttribute("zk_component_ID", "Lookup_Criteria_fieldPostal");
fieldPostal.addEventListener(Events.ON_CHANGE, this);
//
fieldPhone = new Textbox();
fieldPhone.setMaxlength(40);
fieldPhone.setAttribute("zk_component_ID", "Lookup_Criteria_fieldPhone");
fieldPhone.addEventListener(Events.ON_CHANGE, this);
//
checkAND = new Checkbox();
checkAND.setText(Msg.getMsg(Env.getCtx(), "SearchAND"));
checkAND.setName("SearchAND");
checkAND.setTooltiptext(Msg.getMsg(Env.getCtx(), "SearchANDInfo"));
checkAND.setSelected(true);
checkAND.addActionListener(this);
checkAND.setAttribute("zk_component_ID", "Lookup_Criteria_checkAND");
//
checkCustomer = new Checkbox();
checkCustomer.addActionListener(this);
checkCustomer.setAttribute("zk_component_ID", "Lookup_Criteria_checkCustomer");
checkCustomer.setName("checkCustomer");
if (m_isSOTrx)
checkCustomer.setLabel(Msg.getMsg(Env.getCtx(), "OnlyCustomers"));
else
checkCustomer.setLabel(Msg.getMsg(Env.getCtx(), "OnlyVendors"));
checkCustomer.setSelected(m_isSOMatch);
}
use of org.adempiere.webui.component.Label in project adempiere by adempiere.
the class WTextEditorDialog method init.
private void init() {
setBorder("normal");
VerticalBox vbox = new VerticalBox();
appendChild(vbox);
tabbox = new Tabbox();
vbox.appendChild(tabbox);
Tabs tabs = new Tabs();
tabbox.appendChild(tabs);
Tabpanels tabPanels = new Tabpanels();
tabbox.appendChild(tabPanels);
Tab tab = new Tab("Text");
tabs.appendChild(tab);
Tabpanel tabPanel = new Tabpanel();
tabPanels.appendChild(tabPanel);
textBox = new Textbox(text);
textBox.setCols(80);
textBox.setRows(30);
textBox.setEnabled(editable);
textBox.setWidth("700px");
textBox.setHeight("500px");
tabPanel.appendChild(textBox);
tab = new Tab("HTML");
tabs.appendChild(tab);
tabPanel = new Tabpanel();
tabPanels.appendChild(tabPanel);
if (editable) {
editor = new FCKeditor();
tabPanel.appendChild(editor);
editor.setWidth("700px");
editor.setHeight("500px");
editor.setValue(text);
} else {
Div div = new Div();
div.setHeight("500px");
div.setWidth("700px");
div.setStyle("overflow: auto; border: 1px solid");
tabPanel.appendChild(div);
Html html = new Html();
div.appendChild(html);
html.setContent(text);
}
vbox.appendChild(new Separator());
ConfirmPanel confirmPanel = new ConfirmPanel(true);
vbox.appendChild(confirmPanel);
confirmPanel.addButton(confirmPanel.createButton(ConfirmPanel.A_RESET));
confirmPanel.addActionListener(this);
if (maxSize > 0) {
status = new Label();
appendChild(status);
updateStatus(text.length());
status.setStyle("margin-top:10px;");
textBox.addEventListener(Events.ON_CHANGE, this);
editor.addEventListener(Events.ON_CHANGE, this);
}
tabbox.addEventListener(Events.ON_SELECT, this);
}
Aggregations