From 9d0d7f9b5f4c41fd861a19c736b16c043c60b350 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 22 Oct 2015 09:14:59 -0500 Subject: [PATCH] IDEMPIERE-2896 UX: Doubleclick in text fields / Peer review --- .../oracle/201510221522_IDEMPIERE-2896.sql | 8 ------ .../201510221522_IDEMPIERE-2896.sql | 8 ------ .../compiere/model/I_AD_UserPreference.java | 13 ++++++++++ .../compiere/model/X_AD_UserPreference.java | 26 ++++++++++++++++++- .../adempiere/webui/adwindow/ADTabpanel.java | 2 +- 5 files changed, 39 insertions(+), 18 deletions(-) diff --git a/migration/i2.1z/oracle/201510221522_IDEMPIERE-2896.sql b/migration/i2.1z/oracle/201510221522_IDEMPIERE-2896.sql index 3732467d57..c6adc1acee 100644 --- a/migration/i2.1z/oracle/201510221522_IDEMPIERE-2896.sql +++ b/migration/i2.1z/oracle/201510221522_IDEMPIERE-2896.sql @@ -10,18 +10,10 @@ INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,Cr INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType) VALUES (212330,0,'Toggle on Double Click','Defines if double click in a field on grid mode switch to form view','Defines if double click in a field on grid mode switch to form view',200174,'ToggleOnDoubleClick','N',1,'N','N','N','N','N',0,'N',20,0,0,'Y',TO_DATE('2015-10-22 15:21:43','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2015-10-22 15:21:43','YYYY-MM-DD HH24:MI:SS'),0,202920,'Y','N','D','N','N','N','Y','82ce8855-972f-4673-bfe4-b2f74219a50b','Y',0,'N','N','N') ; --- Oct 22, 2015 3:21:49 PM CEST -INSERT INTO AD_TreeNode (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNode_UU) SELECT t.AD_Client_ID, 0, 'Y', SysDate, 0, SysDate, 0,t.AD_Tree_ID, 200000, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='TL' AND t.AD_Table_ID=282 AND NOT EXISTS (SELECT * FROM AD_TreeNode e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200000) -; - -- Oct 22, 2015 3:21:49 PM CEST ALTER TABLE AD_UserPreference ADD ToggleOnDoubleClick CHAR(1) DEFAULT 'N' CHECK (ToggleOnDoubleClick IN ('Y','N')) ; --- Oct 22, 2015 3:22:22 PM CEST -INSERT INTO AD_TreeNode (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNode_UU) SELECT t.AD_Client_ID, 0, 'Y', SysDate, 0, SysDate, 0,t.AD_Tree_ID, 200001, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='TL' AND t.AD_Table_ID=282 AND NOT EXISTS (SELECT * FROM AD_TreeNode e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200001) -; - -- Oct 22, 2015 3:22:22 PM CEST INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (203913,'Toggle on Double Click','Defines if double click in a field on grid mode switch to form view','Defines if double click in a field on grid mode switch to form view',200189,212330,'Y',1,80,'N','N','N','N',0,0,'Y',TO_DATE('2015-10-22 15:22:22','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2015-10-22 15:22:22','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','606eb6b0-a10e-4807-af1b-a2f7c8519115','Y',80,2,2) ; diff --git a/migration/i2.1z/postgresql/201510221522_IDEMPIERE-2896.sql b/migration/i2.1z/postgresql/201510221522_IDEMPIERE-2896.sql index 62afe810fd..55bfc2fe99 100644 --- a/migration/i2.1z/postgresql/201510221522_IDEMPIERE-2896.sql +++ b/migration/i2.1z/postgresql/201510221522_IDEMPIERE-2896.sql @@ -7,18 +7,10 @@ INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,Cr INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType) VALUES (212330,0,'Toggle on Double Click','Defines if double click in a field on grid mode switch to form view','Defines if double click in a field on grid mode switch to form view',200174,'ToggleOnDoubleClick','N',1,'N','N','N','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2015-10-22 15:21:43','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2015-10-22 15:21:43','YYYY-MM-DD HH24:MI:SS'),0,202920,'Y','N','D','N','N','N','Y','82ce8855-972f-4673-bfe4-b2f74219a50b','Y',0,'N','N','N') ; --- Oct 22, 2015 3:21:49 PM CEST -INSERT INTO AD_TreeNode (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNode_UU) SELECT t.AD_Client_ID, 0, 'Y', statement_timestamp(), 0, statement_timestamp(), 0,t.AD_Tree_ID, 200000, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='TL' AND t.AD_Table_ID=282 AND NOT EXISTS (SELECT * FROM AD_TreeNode e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200000) -; - -- Oct 22, 2015 3:21:49 PM CEST ALTER TABLE AD_UserPreference ADD COLUMN ToggleOnDoubleClick CHAR(1) DEFAULT 'N' CHECK (ToggleOnDoubleClick IN ('Y','N')) ; --- Oct 22, 2015 3:22:22 PM CEST -INSERT INTO AD_TreeNode (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo, AD_TreeNode_UU) SELECT t.AD_Client_ID, 0, 'Y', statement_timestamp(), 0, statement_timestamp(), 0,t.AD_Tree_ID, 200001, 0, 999, Generate_UUID() FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='TL' AND t.AD_Table_ID=282 AND NOT EXISTS (SELECT * FROM AD_TreeNode e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=200001) -; - -- Oct 22, 2015 3:22:22 PM CEST INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (203913,'Toggle on Double Click','Defines if double click in a field on grid mode switch to form view','Defines if double click in a field on grid mode switch to form view',200189,212330,'Y',1,80,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2015-10-22 15:22:22','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2015-10-22 15:22:22','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','606eb6b0-a10e-4807-af1b-a2f7c8519115','Y',80,2,2) ; diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_UserPreference.java b/org.adempiere.base/src/org/compiere/model/I_AD_UserPreference.java index 29de2ad2f5..7d602188a6 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_UserPreference.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_UserPreference.java @@ -155,6 +155,19 @@ public interface I_AD_UserPreference */ public boolean isActive(); + /** Column name ToggleOnDoubleClick */ + public static final String COLUMNNAME_ToggleOnDoubleClick = "ToggleOnDoubleClick"; + + /** Set Toggle on Double Click. + * Defines if double click in a field on grid mode switch to form view + */ + public void setToggleOnDoubleClick (boolean ToggleOnDoubleClick); + + /** Get Toggle on Double Click. + * Defines if double click in a field on grid mode switch to form view + */ + public boolean isToggleOnDoubleClick(); + /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_UserPreference.java b/org.adempiere.base/src/org/compiere/model/X_AD_UserPreference.java index 890f60bdd2..7bbf2e67d1 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_UserPreference.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_UserPreference.java @@ -29,7 +29,7 @@ public class X_AD_UserPreference extends PO implements I_AD_UserPreference, I_Pe /** * */ - private static final long serialVersionUID = 20150427L; + private static final long serialVersionUID = 20151022L; /** Standard Constructor */ public X_AD_UserPreference (Properties ctx, int AD_UserPreference_ID, String trxName) @@ -193,4 +193,28 @@ public class X_AD_UserPreference extends PO implements I_AD_UserPreference, I_Pe } return false; } + + /** Set Toggle on Double Click. + @param ToggleOnDoubleClick + Defines if double click in a field on grid mode switch to form view + */ + public void setToggleOnDoubleClick (boolean ToggleOnDoubleClick) + { + set_Value (COLUMNNAME_ToggleOnDoubleClick, Boolean.valueOf(ToggleOnDoubleClick)); + } + + /** Get Toggle on Double Click. + @return Defines if double click in a field on grid mode switch to form view + */ + public boolean isToggleOnDoubleClick () + { + Object oo = get_Value(COLUMNNAME_ToggleOnDoubleClick); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } } \ No newline at end of file diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java index 3a14df4769..96f479bc4a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java @@ -246,7 +246,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer form.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "form"); listPanel = new GridView(); - if( "Y".equals(Env.getContext(Env.getCtx(), "ToggleOnDoubleClick")) ) + if( "Y".equals(Env.getContext(Env.getCtx(), "P|ToggleOnDoubleClick")) ) listPanel.getListbox().addEventListener(Events.ON_DOUBLE_CLICK, this); }