IDEMPIERE-724 Zk: Make iDempiere theme more easily customizable - Added css class to info account, busy dialog, tab editor, workflow activity, menu panel, request, feedback request and find window.

This commit is contained in:
Elaine Tan 2013-06-14 08:46:07 +08:00
parent 91971e5bd3
commit e62bef147d
10 changed files with 192 additions and 58 deletions

View File

@ -83,6 +83,7 @@ import org.zkoss.zul.Listitem;
import org.zkoss.zul.Paging;
import org.zkoss.zul.Separator;
import org.zkoss.zul.South;
import org.zkoss.zul.Space;
/**
* Account Viewer : Based on class AcctViewer
@ -264,6 +265,7 @@ public class WAcctViewer extends Window implements EventListener<Event>
column.setWidth("30%");
columns.appendChild(column);
column = new Column();
column.setWidth("60%");
columns.appendChild(column);
Rows rows = grid.newRows();
@ -275,6 +277,7 @@ public class WAcctViewer extends Window implements EventListener<Event>
Row row = rows.newRow();
row.appendChild(lacctSchema);
row.appendChild(selAcctSchema);
selAcctSchema.setHflex("1");
selDocument.setLabel(Msg.getMsg(Env.getCtx(), "SelectDocument"));
selDocument.addEventListener(Events.ON_CHECK, this);
@ -298,6 +301,7 @@ public class WAcctViewer extends Window implements EventListener<Event>
row = rows.newRow();
row.appendChild(lpostingType);
row.appendChild(selPostingType);
selPostingType.setHflex("1");
// Date
@ -321,6 +325,7 @@ public class WAcctViewer extends Window implements EventListener<Event>
row = rows.newRow();
row.appendChild(lOrg);
row.appendChild(selOrg);
selOrg.setHflex("1");
// Account
@ -383,6 +388,7 @@ public class WAcctViewer extends Window implements EventListener<Event>
displayPanel.appendChild(displayDocumentInfo);
displayPanel.appendChild(displaySourceAmt);
displayPanel.appendChild(displayQty);
displayPanel.appendChild(new Space());
grid = new Grid();
grid.setSclass("grid-layout");
@ -402,30 +408,35 @@ public class WAcctViewer extends Window implements EventListener<Event>
lSort.setValue(Msg.getMsg(Env.getCtx(), "SortBy"));
lGroup.setValue(Msg.getMsg(Env.getCtx(), "GroupBy"));
row.appendChild(lSort);
lSort.setHflex("1");
row.appendChild(lGroup);
row = rows.newRow();
sortBy1.setMold("select");
sortBy1.setRows(1);
row.appendChild(sortBy1);
sortBy1.setHflex("1");
row.appendChild(group1);
row = rows.newRow();
sortBy2.setMold("select");
sortBy2.setRows(1);
row.appendChild(sortBy2);
sortBy2.setHflex("1");
row.appendChild(group2);
row = rows.newRow();
sortBy3.setMold("select");
sortBy3.setRows(1);
row.appendChild(sortBy3);
sortBy3.setHflex("1");
row.appendChild(group3);
row = rows.newRow();
sortBy4.setMold("select");
sortBy4.setRows(1);
row.appendChild(sortBy4);
sortBy4.setHflex("1");
row.appendChild(group4);
//"images/InfoAccount16.png"

View File

@ -13,12 +13,13 @@
*****************************************************************************/
package org.adempiere.webui.apps;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Window;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Image;
import org.zkoss.zul.Div;
import org.zkoss.zul.Span;
/**
*
@ -32,18 +33,22 @@ public class BusyDialog extends Window {
public BusyDialog() {
super();
Hbox box = new Hbox();
box.setStyle("padding: 5px");
LayoutUtils.addSclass("busy-dialog", this);
Div box = new Div();
LayoutUtils.addSclass("busy-dialog-box", box);
appendChild(box);
label = new Label(Msg.getMsg(Env.getCtx(), "Processing"));
box.appendChild(label);
Image image = new Image();
Span image = new Span();
LayoutUtils.addSclass("busy-dialog-img", image);
box.appendChild(image);
image.setHeight("16px");
image.setWidth("16px");
image.setSrc("~./zk/img/progress3.gif");
label = new Label(Msg.getMsg(Env.getCtx(), "Processing"));
LayoutUtils.addSclass("busy-dialog-label", label);
box.appendChild(label);
setPosition("center");
setShadow(true);
setShadow(true);
}
public void statusUpdate(String message) {

View File

@ -57,9 +57,10 @@ import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.event.UploadEvent;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Center;
import org.zkoss.zul.Div;
import org.zkoss.zul.Separator;
import org.zkoss.zul.Vlayout;
import org.zkoss.zul.South;
/**
*
@ -89,7 +90,9 @@ public class FeedbackRequestWindow extends Window implements EventListener<Event
setTitle(Msg.getMsg(Env.getCtx(), "RequestNew"));
setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
setWidth("400px");
this.setSclass("popup-dialog");
this.setBorder("normal");
this.setShadow(true);
this.setClosable(true);
boolean readOnly = !MRole.getDefault().canUpdate(
@ -188,17 +191,24 @@ public class FeedbackRequestWindow extends Window implements EventListener<Event
row.setStyle("padding: 0px 4px 4px 6px");
row.appendChild(attachmentBox);
Vlayout vlayout = new Vlayout();
appendChild(vlayout);
Borderlayout borderlayout = new Borderlayout();
this.appendChild(borderlayout);
borderlayout.setHflex("1");
borderlayout.setVflex("min");
vlayout.appendChild(grid);
grid.setVflex("min");
Center centerPane = new Center();
centerPane.setSclass("dialog-content");
centerPane.setAutoscroll(true);
borderlayout.appendChild(centerPane);
centerPane.appendChild(grid);
grid.setVflex("1");
grid.setHflex("1");
Separator separator = new Separator();
separator.setOrient("horizontal");
vlayout.appendChild(separator);
vlayout.appendChild(confirmPanel);
South southPane = new South();
southPane.setSclass("dialog-footer");
borderlayout.appendChild(southPane);
southPane.appendChild(confirmPanel);
Button btn = new Button();
btn.setImage(ThemeManager.getThemeResource("images/Attachment24.png"));

View File

@ -28,6 +28,7 @@ import org.adempiere.webui.component.Column;
import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.EditorBox;
import org.adempiere.webui.component.Grid;
import org.adempiere.webui.component.GridFactory;
import org.adempiere.webui.component.Group;
import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.ListHead;
@ -127,6 +128,7 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
public WTabEditor()
{
tabform = new WTabEditorForm(this);
LayoutUtils.addSclass("tab-editor-form", tabform);
}
public void initForm() {
@ -390,31 +392,40 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
*/
private Grid createPropertiesGrid()
{
Grid gridView = new Grid();
Grid gridView = GridFactory.newGridLayout();
//
Columns columns = new Columns();
gridView.appendChild(columns);
//
Column column = new Column();
columns.appendChild(column);
column.setLabel(Msg.getMsg(Env.getCtx(), "Property"));
column.setWidth("30%");
column.setHflex("min");
column.setAlign("right");
column = new Column();
columns.appendChild(column);
column.setWidth("70%");
column.setHflex("1");
Rows rows = new Rows();
gridView.appendChild(rows);
Row row = null;
row = new Row();
Group group = new Group(Msg.getMsg(Env.getCtx(), "Property"));
Cell cell = (Cell) group.getFirstChild();
cell.setSclass("z-group-inner");
cell.setColspan(1);
group.setOpen(true);
rows.appendChild(group);
row = new Row();
Label labelName = new Label(Msg.getElement(Env.getCtx(), MField.COLUMNNAME_Name));
editorName = new WStringEditor(MField.COLUMNNAME_Name, false, true, false, 0, 0, null, null);
((WStringEditor) editorName).getComponent().setCols(30);
((WStringEditor) editorName).getComponent().setHflex("1");
row.appendChild(labelName.rightAlign());
row.appendChild(editorName.getComponent());
// editorName.addValueChangeListener(this);
row.setGroup(group);
rows.appendChild(row);
row = new Row();
@ -423,6 +434,7 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
row.appendChild(labelIsDisplayed.rightAlign());
row.appendChild(editorIsDisplayed.getComponent());
// editorIsDisplayed.addValueChangeListener(this);
row.setGroup(group);
rows.appendChild(row);
row = new Row();
@ -431,15 +443,18 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
row.appendChild(labelSeqNo.rightAlign());
row.appendChild(editorSeqNo.getComponent());
// editorSeqNo.addValueChangeListener(this);
row.setGroup(group);
rows.appendChild(row);
row = new Row();
Label labelAD_FieldGroup_ID = new Label(Msg.getElement(Env.getCtx(), MField.COLUMNNAME_AD_FieldGroup_ID));
MLookup lookup = MLookupFactory.get (Env.getCtx(), tabform.getWindowNo(), 0, COLUMN_AD_FIELD_AD_FIELDGROUP_ID, DisplayType.TableDir);
editorAD_FieldGroup_ID = new WTableDirEditor(MField.COLUMNNAME_AD_FieldGroup_ID, false, false, true, lookup);
((WTableDirEditor) editorAD_FieldGroup_ID).getComponent().setHflex("1");
row.appendChild(labelAD_FieldGroup_ID.rightAlign());
row.appendChild(editorAD_FieldGroup_ID.getComponent());
editorAD_FieldGroup_ID.addValueChangeListener(this);
row.setGroup(group);
rows.appendChild(row);
row = new Row();
@ -448,6 +463,7 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
row.appendChild(labelXPosition.rightAlign());
row.appendChild(editorXPosition.getComponent());
editorXPosition.addValueChangeListener(this);
row.setGroup(group);
rows.appendChild(row);
row = new Row();
@ -456,6 +472,7 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
row.appendChild(labelColumnSpan.rightAlign());
row.appendChild(editorColumnSpan.getComponent());
editorColumnSpan.addValueChangeListener(this);
row.setGroup(group);
rows.appendChild(row);
row = new Row();
@ -464,6 +481,19 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
row.appendChild(labelNumLines.rightAlign());
row.appendChild(editorNumLines.getComponent());
editorNumLines.addValueChangeListener(this);
row.setGroup(group);
rows.appendChild(row);
row = new Row();
Separator esep = new Separator("horizontal");
esep.setSpacing("10px");
row.appendCellChild(esep, 2);
row.setGroup(group);
rows.appendChild(row);
row = new Row();
row.appendCellChild(confirmPanel, 2);
row.setGroup(group);
rows.appendChild(row);
return gridView;
@ -487,16 +517,10 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
Grid propGrid = createPropertiesGrid();
Vlayout eastVLayout = new Vlayout();
eastVLayout.appendChild(propGrid);
Separator esep = new Separator("horizontal");
esep.setSpacing("10px");
eastVLayout.appendChild(esep);
eastVLayout.appendChild(confirmPanel);
East east = new East();
LayoutUtils.addSclass("tab-editor-form-east-panel", east);
mainLayout.appendChild(east);
east.appendChild(eastVLayout);
east.appendChild(propGrid);
east.setWidth("320px");
ListHead visibleHead = new ListHead();
@ -528,10 +552,12 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
centerVLayout.setStyle("overflow:auto");
Center center = new Center();
LayoutUtils.addSclass("tab-editor-form-center-panel", east);
mainLayout.appendChild(center);
center.appendChild(centerVLayout);
West west = new West();
LayoutUtils.addSclass("tab-editor-form-west-panel", east);
mainLayout.appendChild(west);
west.appendChild(westVLayout);
west.setCollapsible(true);

View File

@ -20,6 +20,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Grid;
@ -117,10 +118,11 @@ public class WWFActivity extends ADForm implements EventListener<Event>
private ListModelTable model = null;
private WListbox listbox = new WListbox();
private final static String HISTORY_DIV_START_TAG = "<div style='width: 100%; height: 100px; border: 1px solid #7F9DB9;'>";
private final static String HISTORY_DIV_START_TAG = "<div style='height: 100px; border: 1px solid #7F9DB9;'>";
public WWFActivity()
{
super();
LayoutUtils.addSclass("workflow-activity-form", this);
}
protected void initForm()

View File

@ -87,8 +87,9 @@ public class RequestWindow extends Window implements EventListener<Event> {
setTitle(Msg.getMsg(Env.getCtx(),"Event"));
setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
setWidth("400px");
setHeight("500px");
this.setSclass("popup-dialog");
this.setBorder("normal");
this.setShadow(true);
this.setClosable(true);
m_readOnly = !MRole.getDefault().canUpdate(
@ -158,6 +159,7 @@ public class RequestWindow extends Window implements EventListener<Event> {
txtSummary = new Textbox();
txtSummary.setRows(3);
txtSummary.setWidth("95%");
txtSummary.setHeight("100%");
dbxStartPlan = new Datebox();
dbxCompletePlan = new Datebox();
@ -243,17 +245,23 @@ public class RequestWindow extends Window implements EventListener<Event> {
tbxEndTime.setWidth("40%");
Borderlayout borderlayout = new Borderlayout();
appendChild(borderlayout);
this.appendChild(borderlayout);
borderlayout.setHflex("1");
borderlayout.setVflex("min");
Center center = new Center();
borderlayout.appendChild(center);
center.appendChild(grid);
Center centerPane = new Center();
centerPane.setSclass("dialog-content");
centerPane.setAutoscroll(true);
borderlayout.appendChild(centerPane);
centerPane.appendChild(grid);
grid.setVflex("1");
grid.setHflex("1");
South south = new South();
borderlayout.appendChild(south);
south.appendChild(confirmPanel);
South southPane = new South();
southPane.setSclass("dialog-footer");
borderlayout.appendChild(southPane);
southPane.appendChild(confirmPanel);
dbxStartPlan.setValue(ce.getBeginDate());
dbxCompletePlan.setValue(ce.getEndDate());

View File

@ -194,8 +194,7 @@ public abstract class AbstractMenuPanel extends Panel implements EventListener<E
link.setImage(ThemeManager.getThemeResource("images/mWindow.png"));
treeitem.setAttribute("menu.type", "window");
Toolbarbutton newBtn = new Toolbarbutton(null, ThemeManager.getThemeResource("images/New10.png"));
newBtn.setStyle("padding-left:3px; margin-bottom:5px");
Toolbarbutton newBtn = createNewButton();
treeCell.appendChild(newBtn);
newBtn.addEventListener(Events.ON_CLICK, this);
}
@ -209,6 +208,13 @@ public abstract class AbstractMenuPanel extends Panel implements EventListener<E
}
}
public Toolbarbutton createNewButton()
{
Toolbarbutton newBtn = new Toolbarbutton(null, ThemeManager.getThemeResource("images/New10.png"));
newBtn.setStyle("padding-left:3px; margin-bottom:5px");
return newBtn;
}
public void onEvent(Event event)
{
Component comp = event.getTarget();

View File

@ -39,6 +39,7 @@ import java.util.logging.Level;
import java.util.regex.Pattern;
import org.adempiere.webui.AdempiereWebUI;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Column;
import org.adempiere.webui.component.Columns;
@ -250,6 +251,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
this.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "findWindow");
this.setId("findWindow_"+targetWindowNo);
LayoutUtils.addSclass("find-window", this);
}
public boolean initialize()
@ -366,7 +368,8 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
contentSimple.setVflex(true);
Borderlayout layout = new Borderlayout();
layout.setStyle("height: 100%; width: 99%; position: relative");
layout.setHflex("1");
layout.setVflex("1");
winLookupRecord.appendChild(layout);
Center center = new Center();
@ -382,6 +385,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
winLookupRecord.setWidth("100%");
winLookupRecord.setHeight("100%");
winLookupRecord.addEventListener(Events.ON_OK, this);
LayoutUtils.addSclass("find-window-simple", winLookupRecord);
} // initSimple
@ -468,19 +472,25 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
advancedPanel.appendChild(listhead);
advancedPanel.setVflex(true);
Vlayout vlayout = new Vlayout();
vlayout.setStyle("width: 100%; height: 100%; position: relative");
vlayout.setVflex("1");
winAdvanced.appendChild(vlayout);
toolBar.setVflex("0");
vlayout.appendChild(toolBar);
vlayout.appendChild(advancedPanel);
confirmPanel.setVflex("0");
vlayout.appendChild(confirmPanel);
Borderlayout layout = new Borderlayout();
layout.setHflex("1");
layout.setVflex("1");
winAdvanced.appendChild(layout);
Center center = new Center();
layout.appendChild(center);
center.appendChild(advancedPanel);
advancedPanel.setVflex("1");
advancedPanel.setHflex("1");
South south = new South();
layout.appendChild(south);
south.appendChild(confirmPanel);
winAdvanced.setHeight("100%");
winAdvanced.setWidth("99%");
winAdvanced.addEventListener(Events.ON_OK,this);
LayoutUtils.addSclass("find-window-advanced", winAdvanced);
} // initAdvanced

View File

@ -1605,3 +1605,59 @@ table.z-vbox > tbody > tr > td > table {
}
.about-main-panel-links {
}
<%-- busy dialog --%>
.busy-dialog {
cursor: wait;
background-color: transparent;
}
.busy-dialog-box {
background-color: transparent;
padding: 9px;
}
.busy-dialog-img {
height: 16px;
width: 16px;
background: transparent no-repeat center;
background-image: url(../images/progress3.gif) !important;
display: -moz-inline-box;
vertical-align: top;
display: inline-block;
}
.busy-dialog-label {
color: #363636;
}
<%-- tab editor --%>
.tab-editor-form {
}
.tab-editor-form-east-panel {
}
.tab-editor-form-center-panel {
}
.tab-editor-form-west-panel {
}
<%-- workflow activity --%>
.workflow-activity-form {
}
<%-- find window --%>
.find-window {
}
.find-window-simple {
}
.find-window-advanced {
}
.find-window-simple .z-south .z-hbox, .find-window-advanced .z-south .z-hbox {
margin-top: 5px;
}
.find-window-simple .img-btn, .find-window-simple .img-btn.btn-ok.z-button-os, .find-window-simple .img-btn.btn-cancel.z-button-os,
.find-window-advanced .img-btn, .find-window-advanced .img-btn.btn-ok.z-button-os, .find-window-advanced .img-btn.btn-cancel.z-button-os {
margin: 0 2px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB