iDempiere IDEMPIERE-234 Configure Toolbar.

This commit is contained in:
Heng Sin Low 2012-10-19 20:45:19 +08:00
parent 44d6da7dd8
commit c9c663dfa9
5 changed files with 93 additions and 4 deletions

View File

@ -1970,4 +1970,9 @@ public class GridField
return m_vo.NumLines;
}
public boolean isToolbarButton()
{
return m_vo.displayType == DisplayType.Button && m_vo.IsToolbarButton;
}
} // MField

View File

@ -204,6 +204,8 @@ public class GridFieldVO implements Serializable
vo.ColumnSpan=rs.getInt(i);
else if (columnName.equalsIgnoreCase("NumLines"))
vo.NumLines=rs.getInt(i);
else if (columnName.equalsIgnoreCase("IsToolbarButton"))
vo.IsToolbarButton = "Y".equals(rs.getString(i));
}
if (vo.Header == null)
vo.Header = vo.ColumnName;
@ -537,6 +539,8 @@ public class GridFieldVO implements Serializable
public boolean IsAutocomplete = false;
/* Allow copy - IDEMPIERE-67 - Carlos Ruiz - globalqss */
public boolean IsAllowCopy = false;
/** Toolbar Button **/
public boolean IsToolbarButton = false;
/**
* Set Context including contained elements

View File

@ -480,6 +480,19 @@ public interface I_AD_Column
*/
public String getIsSyncDatabase();
/** Column name IsToolbarButton */
public static final String COLUMNNAME_IsToolbarButton = "IsToolbarButton";
/** Set Toolbar Button.
* Add the column button to the toolbar
*/
public void setIsToolbarButton (boolean IsToolbarButton);
/** Get Toolbar Button.
* Add the column button to the toolbar
*/
public boolean isToolbarButton();
/** Column name IsTranslated */
public static final String COLUMNNAME_IsTranslated = "IsTranslated";
@ -556,6 +569,19 @@ public interface I_AD_Column
*/
public int getSeqNo();
/** Column name SeqNoSelection */
public static final String COLUMNNAME_SeqNoSelection = "SeqNoSelection";
/** Set Selection Column Sequence.
* Selection Column Sequence
*/
public void setSeqNoSelection (int SeqNoSelection);
/** Get Selection Column Sequence.
* Selection Column Sequence
*/
public int getSeqNoSelection();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";

View File

@ -205,10 +205,18 @@ public class MColumn extends X_AD_Column
else if (DisplayType.isDate (displayType))
setFieldLength(7);
else
{
log.saveError("FillMandatory", Msg.getElement(getCtx(), "FieldLength"));
return false;
{
log.saveError("FillMandatory", Msg.getElement(getCtx(), "FieldLength"));
return false;
}
}
if (displayType != DisplayType.Button)
{
if (isToolbarButton())
{
setIsToolbarButton(false);
}
}
/** Views are not updateable

View File

@ -32,7 +32,7 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20110918L;
private static final long serialVersionUID = 20121019L;
/** Standard Constructor */
public X_AD_Column (Properties ctx, int AD_Column_ID, String trxName)
@ -60,6 +60,8 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
setIsMandatory (false);
setIsParent (false);
setIsSelectionColumn (false);
setIsToolbarButton (true);
// Y
setIsTranslated (false);
setIsUpdateable (true);
// Y
@ -742,6 +744,30 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
return (String)get_Value(COLUMNNAME_IsSyncDatabase);
}
/** Set Toolbar Button.
@param IsToolbarButton
Add the column button to the toolbar
*/
public void setIsToolbarButton (boolean IsToolbarButton)
{
set_Value (COLUMNNAME_IsToolbarButton, Boolean.valueOf(IsToolbarButton));
}
/** Get Toolbar Button.
@return Add the column button to the toolbar
*/
public boolean isToolbarButton ()
{
Object oo = get_Value(COLUMNNAME_IsToolbarButton);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Translated.
@param IsTranslated
This column is translated
@ -858,6 +884,26 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
return ii.intValue();
}
/** Set Selection Column Sequence.
@param SeqNoSelection
Selection Column Sequence
*/
public void setSeqNoSelection (int SeqNoSelection)
{
set_Value (COLUMNNAME_SeqNoSelection, Integer.valueOf(SeqNoSelection));
}
/** Get Selection Column Sequence.
@return Selection Column Sequence
*/
public int getSeqNoSelection ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_SeqNoSelection);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Max. Value.
@param ValueMax
Maximum Value for a field