use of org.adempiere.webui.component.Label in project adempiere by adempiere.
the class WPreference method init.
private void init() {
ThemeUtils.addSclass("ad-wpreference", this);
Div div = new Div();
autoCommit = new WYesNoEditor("AutoCommit", Msg.getMsg(Env.getCtx(), "AutoCommit", true), null, false, false, true);
div.appendChild(autoCommit.getComponent());
autoCommit.getComponent().setTooltiptext(Msg.getMsg(Env.getCtx(), "AutoCommit", false));
autoCommit.getComponent().setAttribute("zk_component_ID", "Preference_autoCommit");
autoCommit.getComponent().setAttribute("zk_component_prefix", "Preference_");
this.appendChild(div);
autoNew = new WYesNoEditor("AutoNew", Msg.getMsg(Env.getCtx(), "AutoNew", true), null, false, false, true);
autoNew.getComponent().setTooltiptext(Msg.getMsg(Env.getCtx(), "AutoNew", false));
autoNew.getComponent().setAttribute("zk_component_ID", "Preference_autoNew");
autoNew.getComponent().setAttribute("zk_component_prefix", "Preference_");
div = new Div();
div.appendChild(autoNew.getComponent());
this.appendChild(div);
tabCollapsible = new WYesNoEditor("WindowTabCollapsible", Msg.getMsg(Env.getCtx(), "WindowTabCollapsible", true), null, false, false, true);
tabCollapsible.getComponent().setTooltiptext(Msg.getMsg(Env.getCtx(), "WindowTabCollapsible", false));
tabCollapsible.getComponent().setAttribute("zk_component_ID", "Preference_tabCollapsible");
tabCollapsible.getComponent().setAttribute("zk_component_prefix", "Preference_");
div = new Div();
div.appendChild(tabCollapsible.getComponent());
this.appendChild(div);
div = new Div();
Label label = new Label(Msg.getMsg(Env.getCtx(), "WindowTabPlacement", true));
label.setTooltiptext(Msg.getMsg(Env.getCtx(), "WindowTabPlacement", false));
div.appendChild(label);
div.appendChild(new Space());
tabPlacement = new Combobox();
tabPlacement.appendItem(Msg.getMsg(Env.getCtx(), "Left", true), "Left");
tabPlacement.appendItem(Msg.getMsg(Env.getCtx(), "Right", true), "Right");
tabPlacement.setAttribute("zk_component_ID", "Preference_tabPlacement");
tabPlacement.setAttribute("zk_component_prefix", "Preference_");
div.appendChild(tabPlacement);
this.appendChild(div);
div = new Div();
label = new Label(Msg.getMsg(Env.getCtx(), "Theme", true));
label.setTooltiptext(Msg.getMsg(Env.getCtx(), "SelectTheme", false));
div.appendChild(label);
div.appendChild(new Space());
selectedTheme = new WTableDirEditor("AD_Theme_ID", true, false, true, MLookupFactory.get(Env.getCtx(), 0, 0, MColumn.getColumn_ID(MTheme.Table_Name, MTheme.COLUMNNAME_AD_Theme_ID), DisplayType.TableDir));
selectedTheme.getComponent().addEventListener(Events.ON_CHANGE, this);
selectedTheme.getComponent().setAttribute("zk_component_ID", "Preference_SetTheme");
selectedTheme.getComponent().setAttribute("zk_component_prefix", "Preference_");
div.appendChild(selectedTheme.getComponent());
this.appendChild(div);
Separator separator = new Separator();
separator.setSpacing("20px");
div = new Div();
div.appendChild(separator);
this.appendChild(div);
ToolBar toolbar = new ToolBar();
toolbar.setAlign("end");
this.appendChild(toolbar);
ToolBarButton btn = new ToolBarButton("");
btn.setName("btnSave");
btn.setImage(ServletFns.resolveThemeURL("~./images/Save24.png"));
btn.setTooltiptext(Msg.getMsg(Env.getCtx(), "Save"));
btn.addEventListener(Events.ON_CLICK, this);
toolbar.appendChild(btn);
UserPreference preference = SessionManager.getSessionApplication().getUserPreference();
if (Integer.parseInt(preference.getProperty(UserPreference.P_ZK_THEME_PREFERENCE)) > 0) {
m_preferredTheme_ID = Integer.parseInt(preference.getProperty(UserPreference.P_ZK_THEME_PREFERENCE));
}
autoCommit.setValue(preference.getProperty(UserPreference.P_AUTO_COMMIT));
autoNew.setValue(preference.getProperty(UserPreference.P_AUTO_NEW));
tabCollapsible.setValue(preference.getProperty(UserPreference.P_WINDOW_TAB_COLLAPSIBLE));
tabPlacement.setValue(preference.getProperty(UserPreference.P_WINDOW_TAB_PLACEMENT));
selectedTheme.setValue(m_preferredTheme_ID);
}
use of org.adempiere.webui.component.Label in project adempiere by adempiere.
the class WRecordAccessDialog method jbInit.
// dynInit
/**
* Static Init
* @throws Exception
*/
private void jbInit() throws Exception {
bDelete.setImage(ServletFns.resolveThemeURL("~./images/Delete16.png"));
bDelete.setTooltiptext(Msg.getMsg(Env.getCtx(), "Delete"));
bNew.setImage(ServletFns.resolveThemeURL("~./images/New16.png"));
bNew.setTooltiptext(Msg.getMsg(Env.getCtx(), "New"));
bUp.setImage(ServletFns.resolveThemeURL("~./images/Previous16.png"));
bUp.setTooltiptext(Msg.getMsg(Env.getCtx(), "Previous"));
bDown.setImage(ServletFns.resolveThemeURL("~./images/Next16.png"));
bDown.setTooltiptext(Msg.getMsg(Env.getCtx(), "Next"));
cbActive.setText(Msg.translate(Env.getCtx(), "IsActive"));
cbExclude.setText(Msg.translate(Env.getCtx(), "IsExclude"));
cbReadOnly.setText(Msg.translate(Env.getCtx(), "IsReadOnly"));
cbDependent.setText(Msg.translate(Env.getCtx(), "IsDependentEntities"));
Grid grid = GridFactory.newGridLayout();
this.appendChild(grid);
Rows rows = new Rows();
grid.appendChild(rows);
Row row = new Row();
rows.appendChild(row);
row.appendChild(bUp);
row.appendChild(new Label());
row.appendChild(new Label());
row.appendChild(new Label());
row.appendChild(new Label());
row.appendChild(new Label());
row.appendChild(bNew);
row = new Row();
rows.appendChild(row);
row.appendChild(roleLabel);
row.appendChild(roleField);
row.appendChild(cbActive);
row.appendChild(cbExclude);
row.appendChild(cbReadOnly);
row.appendChild(cbDependent);
row.appendChild(bDelete);
row = new Row();
rows.appendChild(row);
row.appendChild(bDown);
row.appendChild(new Label());
row.appendChild(new Label());
row.appendChild(new Label());
row.appendChild(new Label());
row.appendChild(new Label());
row.appendChild(rowNoLabel);
row = new Row();
rows.appendChild(row);
row.setSpans("7");
Div div = new Div();
div.setAlign("right");
div.appendChild(confirmPanel);
row.appendChild(div);
bUp.addEventListener(Events.ON_CLICK, this);
bDown.addEventListener(Events.ON_CLICK, this);
bDelete.addEventListener(Events.ON_CLICK, this);
bNew.addEventListener(Events.ON_CLICK, this);
confirmPanel.addActionListener(this);
}
use of org.adempiere.webui.component.Label in project adempiere by adempiere.
the class WLocationDialog method initComponents.
private void initComponents() {
lblAddress1 = new Label(Msg.getElement(Env.getCtx(), "Address1"));
lblAddress1.setStyle(LABEL_STYLE);
lblAddress2 = new Label(Msg.getElement(Env.getCtx(), "Address2"));
lblAddress2.setStyle(LABEL_STYLE);
lblAddress3 = new Label(Msg.getElement(Env.getCtx(), "Address3"));
lblAddress3.setStyle(LABEL_STYLE);
lblAddress4 = new Label(Msg.getElement(Env.getCtx(), "Address4"));
lblAddress4.setStyle(LABEL_STYLE);
lblCity = new Label(Msg.getMsg(Env.getCtx(), "City"));
lblCity.setStyle(LABEL_STYLE);
lblZip = new Label(Msg.getMsg(Env.getCtx(), "Postal"));
lblZip.setStyle(LABEL_STYLE);
lblRegion = new Label(Msg.getMsg(Env.getCtx(), "Region"));
lblRegion.setStyle(LABEL_STYLE);
lblPostal = new Label(Msg.getMsg(Env.getCtx(), "Postal"));
lblPostal.setStyle(LABEL_STYLE);
lblPostalAdd = new Label(Msg.getMsg(Env.getCtx(), "PostalAdd"));
lblPostalAdd.setStyle(LABEL_STYLE);
lblCountry = new Label(Msg.getMsg(Env.getCtx(), "Country"));
lblCountry.setStyle(LABEL_STYLE);
txtAddress1 = new Textbox();
txtAddress1.setCols(20);
txtAddress2 = new Textbox();
txtAddress2.setCols(20);
txtAddress3 = new Textbox();
txtAddress3.setCols(20);
txtAddress4 = new Textbox();
txtAddress4.setCols(20);
//autocomplete City
txtCity = new WAutoCompleterCity(m_WindowNo);
txtCity.setCols(20);
txtCity.setAutodrop(true);
txtCity.setAutocomplete(true);
txtCity.addEventListener(Events.ON_CHANGING, this);
//txtCity
txtPostal = new Textbox();
txtPostal.setCols(20);
txtPostalAdd = new Textbox();
txtPostalAdd.setCols(20);
lstRegion = new Listbox();
lstRegion.setMold("select");
lstRegion.setWidth("154px");
lstRegion.setRows(0);
lstCountry = new Listbox();
lstCountry.setMold("select");
lstCountry.setWidth("154px");
lstCountry.setRows(0);
btnUrl = new Button();
btnUrl.setImage(ServletFns.resolveThemeURL("~./images/Online10.png"));
btnUrl.addEventListener(Events.ON_CLICK, this);
btnOk = new Button();
btnOk.setImage(ServletFns.resolveThemeURL("~./images/Ok16.png"));
btnOk.addEventListener(Events.ON_CLICK, this);
btnCancel = new Button();
btnCancel.setImage(ServletFns.resolveThemeURL("~./images/Cancel16.png"));
btnCancel.addEventListener(Events.ON_CLICK, this);
mainPanel = GridFactory.newGridLayout();
mainPanel.setStyle("padding:5px");
}
use of org.adempiere.webui.component.Label in project adempiere by adempiere.
the class WLocatorDialog method initComponents.
// WLocatorDialog
private void initComponents() {
lblLocator.setValue(Msg.translate(Env.getCtx(), "M_Locator_ID"));
lblWarehouse.setValue(Msg.translate(Env.getCtx(), "M_Warehouse_ID"));
lblAisleX.setValue(Msg.getElement(Env.getCtx(), "X"));
lblBinY.setValue(Msg.getElement(Env.getCtx(), "Y"));
lblLevelZ.setValue(Msg.getElement(Env.getCtx(), "Z"));
lblKey.setValue(Msg.translate(Env.getCtx(), "Value"));
Hbox boxLocator = new Hbox();
boxLocator.setWidth("100%");
boxLocator.setWidths("30%, 70%");
// Elaine 2009/02/02 - fixed the locator width
lstLocator.setWidth("150px");
lstLocator.setMold("select");
lstLocator.setRows(0);
boxLocator.appendChild(lblLocator);
boxLocator.appendChild(lstLocator);
Hbox boxCheckbox = new Hbox();
boxCheckbox.setWidth("100%");
boxCheckbox.setWidths("30%, 70%");
boxCheckbox.setStyle("text-align:left");
chkCreateNew.setLabel(Msg.getMsg(Env.getCtx(), "CreateNew"));
boxCheckbox.appendChild(new Label());
boxCheckbox.appendChild(chkCreateNew);
Hbox boxWarehouse = new Hbox();
boxWarehouse.setWidth("100%");
boxWarehouse.setWidths("30%, 70%");
lstWarehouse.setWidth("100px");
lstWarehouse.setMold("select");
lstWarehouse.setRows(0);
boxWarehouse.appendChild(lblWarehouse);
boxWarehouse.appendChild(lstWarehouse);
boxWarehouse.appendChild(txtWarehouse);
Hbox boxAisle = new Hbox();
boxAisle.setWidth("100%");
boxAisle.setWidths("30%, 70%");
boxAisle.appendChild(lblAisleX);
boxAisle.appendChild(txtAisleX);
Hbox boxBin = new Hbox();
boxBin.setWidth("100%");
boxBin.setWidths("30%, 70%");
boxBin.appendChild(lblBinY);
boxBin.appendChild(txtBinY);
Hbox boxLevel = new Hbox();
boxLevel.setWidth("100%");
boxLevel.setWidths("30%, 70%");
boxLevel.appendChild(lblLevelZ);
boxLevel.appendChild(txtLevelZ);
Hbox boxKey = new Hbox();
boxKey.setWidth("100%");
boxKey.setWidths("30%, 70%");
boxKey.appendChild(lblKey);
boxKey.appendChild(txtKey);
Hbox boxButtons = new Hbox();
boxButtons.setWidth("100%");
boxButtons.setWidths("80%, 10%, 10%");
boxButtons.setStyle("text-align:right");
btnCancel.setImage(ServletFns.resolveThemeURL("~./images/Cancel16.png"));
btnCancel.addEventListener(Events.ON_CLICK, this);
btnOk.setImage(ServletFns.resolveThemeURL("~./images/Ok16.png"));
btnOk.addEventListener(Events.ON_CLICK, this);
boxButtons.appendChild(new Label());
boxButtons.appendChild(btnCancel);
boxButtons.appendChild(btnOk);
mainBox.setWidth("250px");
mainBox.setStyle("text-align:right");
mainBox.appendChild(boxLocator);
mainBox.appendChild(new Separator());
mainBox.appendChild(boxCheckbox);
mainBox.appendChild(new Separator());
mainBox.appendChild(boxWarehouse);
mainBox.appendChild(boxAisle);
mainBox.appendChild(boxBin);
mainBox.appendChild(boxLevel);
mainBox.appendChild(boxKey);
mainBox.appendChild(new Separator());
mainBox.appendChild(boxButtons);
this.appendChild(mainBox);
this.setTitle(title);
this.setClosable(true);
this.setBorder("normal");
this.setWidth("260Px");
this.setAttribute("mode", "modal");
// Elaine 2009/02/02 - window set to resizable
this.setSizable(true);
}
use of org.adempiere.webui.component.Label in project adempiere by adempiere.
the class WAcctViewer method actionAcctSchema.
// onEvent
/**
* New Acct Schema
*/
private void actionAcctSchema() {
Listitem listitem = selAcctSchema.getSelectedItem();
KeyNamePair kp = null;
if (listitem != null)
kp = (KeyNamePair) listitem.getValue();
if (kp == null)
return;
m_data.C_AcctSchema_ID = kp.getKey();
m_data.ASchema = MAcctSchema.get(Env.getCtx(), m_data.C_AcctSchema_ID);
log.info(m_data.ASchema.toString());
// Sort Options
sortBy1.getChildren().clear();
sortBy2.getChildren().clear();
sortBy3.getChildren().clear();
sortBy4.getChildren().clear();
sortAddItem(new ValueNamePair("", ""));
sortAddItem(new ValueNamePair("DateAcct", Msg.translate(Env.getCtx(), "DateAcct")));
sortAddItem(new ValueNamePair("DateTrx", Msg.translate(Env.getCtx(), "DateTrx")));
sortAddItem(new ValueNamePair("C_Period_ID", Msg.translate(Env.getCtx(), "C_Period_ID")));
Label[] labels = new Label[] { lsel1, lsel2, lsel3, lsel4, lsel5, lsel6, lsel7, lsel8 };
Button[] buttons = new Button[] { sel1, sel2, sel3, sel4, sel5, sel6, sel7, sel8 };
int selectionIndex = 0;
MAcctSchemaElement[] elements = m_data.ASchema.getAcctSchemaElements();
for (int i = 0; i < elements.length && selectionIndex < labels.length; i++) {
MAcctSchemaElement acctSchemaElement = elements[i];
String columnName = acctSchemaElement.getColumnName();
String displayColumnName;
if (columnName.equals("User1_ID") || columnName.equals("User2_ID") || columnName.equals("User3_ID") || columnName.equals("User4_ID"))
displayColumnName = acctSchemaElement.getName();
else
displayColumnName = acctSchemaElement.getDisplayColumnName();
// Add Sort Option
sortAddItem(new ValueNamePair(columnName, Msg.translate(Env.getCtx(), displayColumnName)));
if (!acctSchemaElement.isElementType(X_C_AcctSchema_Element.ELEMENTTYPE_Organization) && !acctSchemaElement.isElementType(X_C_AcctSchema_Element.ELEMENTTYPE_Account)) {
labels[selectionIndex].setValue(Msg.translate(Env.getCtx(), displayColumnName));
labels[selectionIndex].setVisible(true);
// actionCommand
buttons[selectionIndex].setName(columnName);
buttons[selectionIndex].addEventListener(Events.ON_CLICK, this);
buttons[selectionIndex].setImage(ServletFns.resolveThemeURL("~./images/Find16.png"));
buttons[selectionIndex].setLabel("");
buttons[selectionIndex].setVisible(true);
selectionIndex++;
}
}
while (selectionIndex < labels.length) {
labels[selectionIndex].setVisible(false);
buttons[selectionIndex++].setVisible(false);
}
}
Aggregations