IDEMPIERE-77 Start on the left, Cancel on the right

This commit is contained in:
David Peñuela 2012-10-11 14:00:08 -05:00
parent 462cd17efc
commit 549f7c3249
13 changed files with 84 additions and 67 deletions

View File

@ -19,7 +19,7 @@
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}"/> <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}"/>
<stringAttribute key="pde.version" value="3.3"/> <stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.adempiere.server.server_product"/> <stringAttribute key="product" value="org.adempiere.server.server_product"/>
<stringAttribute key="selected_target_plugins" value="com.springsource.javax.activation@default:default,com.springsource.javax.ejb@default:default,com.springsource.javax.jms@default:default,com.springsource.javax.mail@default:default,com.springsource.javax.management.j2ee@default:default,com.springsource.javax.xml.rpc@default:default,com.springsource.javax.xml.soap@default:default,com.springsource.net.sf.cglib@default:default,com.springsource.org.apache.activemq@default:default,com.springsource.org.apache.commons.logging@default:default,com.springsource.org.apache.kahadb@default:default,javax.el@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,javax.xml@default:default,org.apache.ant@default:default,org.apache.commons.collections@default:default,org.apache.commons.logging@default:default,org.apache.commons.net@default:default,org.apache.poi@default:default,org.eclipse.ant.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.junit@default:default,org.restlet@default:default"/> <stringAttribute key="selected_target_plugins" value="com.springsource.javax.activation@default:default,com.springsource.javax.ejb@default:default,com.springsource.javax.jms@default:default,com.springsource.javax.mail@default:default,com.springsource.javax.management.j2ee@default:default,com.springsource.javax.xml.rpc@default:default,com.springsource.javax.xml.soap@default:default,com.springsource.net.sf.cglib@default:default,com.springsource.org.apache.activemq@default:default,com.springsource.org.apache.commons.logging@default:default,com.springsource.org.apache.kahadb@default:default,javax.el@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,javax.xml@default:default,org.apache.ant@default:default,org.apache.commons.collections@default:default,org.apache.commons.logging@default:default,org.apache.commons.net@default:default,org.apache.poi@default:default,org.eclipse.ant.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.junit@default:default,org.restlet*2.0.14.0@default:default,org.restlet*2.0.15.0@default:default"/>
<stringAttribute key="selected_workspace_plugins" value="org.adempiere.base@default:default,org.adempiere.extend@default:false,org.adempiere.install@default:true,org.apache.ecs@default:default,org.compiere.db.oracle.provider@default:default,org.compiere.db.postgresql.provider@default:default"/> <stringAttribute key="selected_workspace_plugins" value="org.adempiere.base@default:default,org.adempiere.extend@default:false,org.adempiere.install@default:true,org.apache.ecs@default:default,org.compiere.db.oracle.provider@default:default,org.compiere.db.postgresql.provider@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/> <booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/> <stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>

View File

@ -23,6 +23,7 @@ import java.awt.HeadlessException;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JFrame; import javax.swing.JFrame;
@ -86,11 +87,14 @@ public class KeyStoreDialog extends JDialog implements ActionListener
private JTextField fS = new JTextField(20); private JTextField fS = new JTextField(20);
private JLabel lC = new JLabel("(C) Country (2 Char)"); private JLabel lC = new JLabel("(C) Country (2 Char)");
private JTextField fC = new JTextField(2); private JTextField fC = new JTextField(2);
// Invert OK/Cancel IDEMPIERE-77
private JButton bOK = ConfirmPanel.createOKButton("OK"); private JButton bOK = ConfirmPanel.createOKButton("");
private JButton bCancel = ConfirmPanel.createCancelButton("Cancel"); private JButton bCancel = ConfirmPanel.createCancelButton("");
private boolean m_ok = false; private boolean m_ok = false;
/** /**
* Static Layout * Static Layout
*/ */
@ -115,12 +119,14 @@ public class KeyStoreDialog extends JDialog implements ActionListener
getContentPane().add (panel, BorderLayout.CENTER); getContentPane().add (panel, BorderLayout.CENTER);
// //
JPanel confirmPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JPanel confirmPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
confirmPanel.add(bCancel); // Invert OK/Cancel IDEMPIERE-77
confirmPanel.add(bOK); confirmPanel.add(bOK);
confirmPanel.add(bCancel);
getContentPane().add (confirmPanel, BorderLayout.SOUTH); getContentPane().add (confirmPanel, BorderLayout.SOUTH);
// //
bCancel.addActionListener(this);
bOK.addActionListener(this); bOK.addActionListener(this);
bCancel.addActionListener(this);
} // jbInit } // jbInit
/** /**

View File

@ -24,6 +24,7 @@ import java.awt.event.ActionListener;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JFrame; import javax.swing.JFrame;
@ -48,7 +49,8 @@ public final class ConfirmPanel extends JPanel
* *
*/ */
private static final long serialVersionUID = 6041019802043360966L; private static final long serialVersionUID = 6041019802043360966L;
private static ImageIcon ImagenCancel = new ImageIcon("/images/Cancel24.png");
private static ImageIcon ImagenOk = new ImageIcon("/images/Ok24.png");
/** /**
* Create OK Button with label text and F4 Shortcut * Create OK Button with label text and F4 Shortcut
@ -61,6 +63,7 @@ public final class ConfirmPanel extends JPanel
JButton button = (JButton)aa.getButton(); JButton button = (JButton)aa.getButton();
button.setMargin(s_insets); button.setMargin(s_insets);
button.setDefaultCapable(true); button.setDefaultCapable(true);
button.setIcon(ImagenOk);
return button; return button;
} // createOKButton } // createOKButton
@ -86,6 +89,7 @@ public final class ConfirmPanel extends JPanel
AppsAction aa = new AppsAction (A_CANCEL, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), text); AppsAction aa = new AppsAction (A_CANCEL, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), text);
JButton button = (JButton)aa.getButton(); JButton button = (JButton)aa.getButton();
button.setMargin(s_insets); button.setMargin(s_insets);
button.setIcon(ImagenCancel);
return button; return button;
} // createCancelButton } // createCancelButton
@ -494,10 +498,11 @@ public final class ConfirmPanel extends JPanel
// //
JPanel okCancel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JPanel okCancel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
okCancel.setOpaque(false); okCancel.setOpaque(false);
bCancel = createCancelButton(withText); // Invert OK/Cancel IDEMPIERE-77
okCancel.add(bCancel);
bOK = createOKButton(withText); bOK = createOKButton(withText);
okCancel.add(bOK); okCancel.add(bOK);
bCancel = createCancelButton(withText);
okCancel.add(bCancel);
setCancelVisible(withCancelButton); setCancelVisible(withCancelButton);
this.add(okCancel, BorderLayout.EAST); this.add(okCancel, BorderLayout.EAST);
// //

File diff suppressed because one or more lines are too long

View File

@ -1903,7 +1903,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
div.appendChild(hbox); div.appendChild(hbox);
Button btnOk = new Button(); Button btnOk = new Button();
btnOk.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "OK"))); // Invert - Unify OK/Cancel IDEMPIERE-77
//btnOk.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "OK")));
btnOk.setImage("/images/Ok16.png"); btnOk.setImage("/images/Ok16.png");
btnOk.addEventListener(Events.ON_CLICK, new EventListener<Event>() btnOk.addEventListener(Events.ON_CLICK, new EventListener<Event>()
{ {
@ -1953,7 +1954,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
hbox.appendChild(btnOk); hbox.appendChild(btnOk);
Button btnCancel = new Button(); Button btnCancel = new Button();
btnCancel.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Cancel"))); //btnCancel.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Cancel")));
btnCancel.setImage("/images/Cancel16.png"); btnCancel.setImage("/images/Cancel16.png");
btnCancel.addEventListener(Events.ON_CLICK, new EventListener<Event>() btnCancel.addEventListener(Events.ON_CLICK, new EventListener<Event>()
{ {

View File

@ -168,15 +168,17 @@ public class ProcessDialog extends Window implements EventListener<Event>, IProc
Div div = new Div(); Div div = new Div();
Hbox hbox = new Hbox(); Hbox hbox = new Hbox();
String label = Msg.getMsg(Env.getCtx(), "Start"); String label = Msg.getMsg(Env.getCtx(), "Start");
bOK = new Button(label.replaceAll("&", "")); // Invert - Unify OK/Cancel IDEMPIERE-77
//bOK = new Button(label.replaceAll("&", ""));
bOK = new Button();
bOK.setImage("/images/Ok16.png"); bOK.setImage("/images/Ok16.png");
bOK.setId("Ok"); bOK.setId("Ok");
bOK.addEventListener(Events.ON_CLICK, this); bOK.addEventListener(Events.ON_CLICK, this);
bOK.setSclass("action-image-text-button"); bOK.setSclass("action-image-text-button");
hbox.appendChild(bOK); hbox.appendChild(bOK);
label = Msg.getMsg(Env.getCtx(), "Cancel"); //label = Msg.getMsg(Env.getCtx(), "Cancel");
Button btn = new Button(label.replaceAll("&", "")); Button btn = new Button();
btn.setImage("/images/Cancel16.png"); btn.setImage("/images/Cancel16.png");
btn.setId("Cancel"); btn.setId("Cancel");
btn.addEventListener(Events.ON_CLICK, this); btn.addEventListener(Events.ON_CLICK, this);

View File

@ -174,13 +174,15 @@ public class ProcessModalDialog extends Window implements EventListener<Event>,
Hbox hbox = new Hbox(); Hbox hbox = new Hbox();
hbox.setWidth("100%"); hbox.setWidth("100%");
hbox.setStyle("margin-top: 10px"); hbox.setStyle("margin-top: 10px");
Button btn = new Button("Ok"); Button btn = new Button("");
btn.setImage("/images/Ok24.png");
LayoutUtils.addSclass("action-text-button", btn); LayoutUtils.addSclass("action-text-button", btn);
btn.setId("Ok"); btn.setId("Ok");
btn.addEventListener(Events.ON_CLICK, this); btn.addEventListener(Events.ON_CLICK, this);
hbox.appendChild(btn); hbox.appendChild(btn);
btn = new Button("Cancel"); btn = new Button("");
btn.setImage("/images/Cancel24.png");
btn.setId("Cancel"); btn.setId("Cancel");
LayoutUtils.addSclass("action-text-button", btn); LayoutUtils.addSclass("action-text-button", btn);
btn.addEventListener(Events.ON_CLICK, this); btn.addEventListener(Events.ON_CLICK, this);

View File

@ -171,12 +171,12 @@ public final class ConfirmPanel extends Hbox
init(); init();
addComponentsRight(createButton(A_OK));
setVisible(A_CANCEL, withCancelButton); setVisible(A_CANCEL, withCancelButton);
if (withCancelButton) if (withCancelButton)
addComponentsRight(createButton(A_CANCEL)); addComponentsRight(createButton(A_CANCEL));
addComponentsRight(createButton(A_OK));
if (withRefreshButton) if (withRefreshButton)
{ {
addComponentsLeft(createButton(A_REFRESH)); addComponentsLeft(createButton(A_REFRESH));

View File

@ -112,13 +112,13 @@ public class Messagebox extends Window implements EventListener<Event>
Properties ctx = Env.getCtx(); Properties ctx = Env.getCtx();
lblMsg.setEncode(false); lblMsg.setEncode(false);
lblMsg.setValue(msg); lblMsg.setValue(msg);
// Invert - Unify OK/Cancel IDEMPIERE-77
btnOk.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "OK"))); //btnOk.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "OK")));
btnOk.setImage("/images/Ok16.png"); btnOk.setImage("/images/Ok16.png");
btnOk.addEventListener(Events.ON_CLICK, this); btnOk.addEventListener(Events.ON_CLICK, this);
LayoutUtils.addSclass("action-text-button", btnOk); LayoutUtils.addSclass("action-text-button", btnOk);
btnCancel.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "Cancel"))); //btnCancel.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "Cancel")));
btnCancel.setImage("/images/Cancel16.png"); btnCancel.setImage("/images/Cancel16.png");
btnCancel.addEventListener(Events.ON_CLICK, this); btnCancel.addEventListener(Events.ON_CLICK, this);
LayoutUtils.addSclass("action-text-button", btnCancel); LayoutUtils.addSclass("action-text-button", btnCancel);

View File

@ -271,7 +271,7 @@ public class CustomizeGridViewPanel extends Panel
southPanel.setAlign("Right"); southPanel.setAlign("Right");
southPanel.setStyle("margin-top: 2px; margin-right: 4px"); southPanel.setStyle("margin-top: 2px; margin-right: 4px");
String label = Msg.getMsg(Env.getCtx(), "save"); String label = Msg.getMsg(Env.getCtx(), "save");
Button bOK = new Button(label); Button bOK = new Button();
bOK.setImage("/images/Ok16.png"); bOK.setImage("/images/Ok16.png");
bOK.setId("Ok"); bOK.setId("Ok");
EventListener onClickListener = new EventListener() EventListener onClickListener = new EventListener()
@ -290,7 +290,7 @@ public class CustomizeGridViewPanel extends Panel
bOK.setSclass("action-button"); bOK.setSclass("action-button");
southPanel.appendChild(bOK); southPanel.appendChild(bOK);
label = Msg.getMsg(Env.getCtx(), "Cancel"); label = Msg.getMsg(Env.getCtx(), "Cancel");
Button btn = new Button(label.replaceAll("&", "")); Button btn = new Button();
btn.setImage("/images/Cancel16.png"); btn.setImage("/images/Cancel16.png");
btn.setId("Cancel"); btn.setId("Cancel");
EventListener onClickCancelListener = new EventListener() EventListener onClickCancelListener = new EventListener()

View File

@ -291,8 +291,9 @@ public class WAttachment extends Window implements EventListener<Event>
confirmPanel.appendChild(bDeleteAll); confirmPanel.appendChild(bDeleteAll);
confirmPanel.appendChild(bRefresh); confirmPanel.appendChild(bRefresh);
confirmPanel.appendChild(bCancel);
confirmPanel.appendChild(bOk); confirmPanel.appendChild(bOk);
confirmPanel.appendChild(bCancel);
text.setTooltiptext(Msg.getElement(Env.getCtx(), "TextMsg")); text.setTooltiptext(Msg.getElement(Env.getCtx(), "TextMsg"));

View File

@ -255,14 +255,14 @@ public class WLocatorDialog extends Window implements EventListener
boxButtons.setStyle("padding: 5px;"); boxButtons.setStyle("padding: 5px;");
boxButtons.setPack("end"); boxButtons.setPack("end");
btnCancel.setImage("/images/Cancel16.png");
btnCancel.addEventListener(Events.ON_CLICK, this);
btnOk.setImage("/images/Ok16.png"); btnOk.setImage("/images/Ok16.png");
btnOk.addEventListener(Events.ON_CLICK, this); btnOk.addEventListener(Events.ON_CLICK, this);
boxButtons.appendChild(btnCancel); btnCancel.setImage("/images/Cancel16.png");
btnCancel.addEventListener(Events.ON_CLICK, this);
boxButtons.appendChild(btnOk); boxButtons.appendChild(btnOk);
boxButtons.appendChild(btnCancel);
mainBox.setWidth("250px"); mainBox.setWidth("250px");
mainBox.setStyle("text-align:right"); mainBox.setStyle("text-align:right");

View File

@ -180,14 +180,14 @@ public class WMediaDialog extends Window implements EventListener<Event>
southPane.appendChild(confirmPanel); southPane.appendChild(confirmPanel);
southPane.setHeight("30px"); southPane.setHeight("30px");
bCancel.setImage("/images/Cancel24.png");
bCancel.addEventListener(Events.ON_CLICK, this);
bOk.setImage("/images/Ok24.png"); bOk.setImage("/images/Ok24.png");
bOk.addEventListener(Events.ON_CLICK, this); bOk.addEventListener(Events.ON_CLICK, this);
confirmPanel.appendChild(bCancel); bCancel.setImage("/images/Cancel24.png");
bCancel.addEventListener(Events.ON_CLICK, this);
confirmPanel.appendChild(bOk); confirmPanel.appendChild(bOk);
confirmPanel.appendChild(bCancel);
addEventListener(Events.ON_UPLOAD, this); addEventListener(Events.ON_UPLOAD, this);
} }