Skip to content

Commit

Permalink
Merge branch 'refactor-2'
Browse files Browse the repository at this point in the history
  • Loading branch information
hyyan committed Mar 19, 2018
2 parents a4f7782 + 0bcf813 commit 7f82064
Show file tree
Hide file tree
Showing 14 changed files with 4,415 additions and 56 deletions.
4 changes: 4 additions & 0 deletions .buildpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
<buildpathentry excluding="wbp-meta/**|backups/**|.metadata/**|.project|build.log|.work/**|.builaunches/**|.guilaunches/**|.buildpath|.settings/**|.bdtPath|.classpath" kind="src" path=""/>
</buildpath>
1 change: 1 addition & 0 deletions .metadata/resourcesModel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"1.0.0","buildpathModel":{"exclusionPatterns":["wbp-meta/**",".classpath",".guilaunches/**",".buildpath","build.log",".builaunches/**",".metadata/**",".bdtPath",".project",".work/**","backups/**",".settings/**"]},"sourcepathModel":{"resourceIndex":{"bbj-plugin.json":{"sourcePath":false,"mediaType":"application/json","resourceType":"file"},"BBjGridExWidget.bbj":{"sourcePath":true,"mediaType":"application/vnd.businessbasic.bbj","resourceType":"file"},"docs":{"sourcePath":true,"resourceType":"folder"},"docs\\_config.yml":{"sourcePath":false,"mediaType":"text/plain","resourceType":"file"},"docs\\Demo.bbj.md":{"sourcePath":false,"mediaType":"text/x-web-markdown","resourceType":"file"},"docs\\index.md":{"sourcePath":false,"mediaType":"text/x-web-markdown","resourceType":"file"},"docs\\javadoc":{"sourcePath":true,"resourceType":"folder"},"docs\\javadoc\\allclasses-frame.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\allclasses-noframe.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\BBjGridExWidget.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\BBjGridExWidgetRowDoubleClickEvent.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\BBjGridExWidgetSelectRowEvent.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\constant-values.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\deprecated-list.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\help-doc.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\index-all.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\index.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\overview-tree.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\package-frame.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\package-list":{"sourcePath":false,"mediaType":"text/plain","resourceType":"file"},"docs\\javadoc\\package-summary.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\package-tree.html":{"sourcePath":false,"mediaType":"text/html","resourceType":"file"},"docs\\javadoc\\script.js":{"sourcePath":false,"mediaType":"text/x-matlab","resourceType":"file"},"docs\\javadoc\\stylesheet.css":{"sourcePath":false,"mediaType":"text/css","resourceType":"file"},"js":{"sourcePath":true,"resourceType":"folder"},"js\\ag-grid.js":{"sourcePath":false,"mediaType":"application/javascript","resourceType":"file"},"js\\ag-grid.min.js":{"sourcePath":false,"mediaType":"application/javascript","resourceType":"file"},"js\\BBjGridExWidget.js":{"sourcePath":false,"mediaType":"application/javascript","resourceType":"file"},"js\\format.js":{"sourcePath":false,"mediaType":"application/javascript","resourceType":"file"},"js\\masks.js":{"sourcePath":false,"mediaType":"text/x-matlab","resourceType":"file"},"LICENSE":{"sourcePath":false,"mediaType":"text/plain","resourceType":"file"},"README.md":{"sourcePath":false,"mediaType":"text/x-web-markdown","resourceType":"file"},"bin":{"sourcePath":true,"resourceType":"folder"},"src":{"sourcePath":true,"resourceType":"folder"},"js\\ag-grid-enterprise.min.js":{"sourcePath":false,"mediaType":"application/javascript","resourceType":"file"},"Demo":{"sourcePath":true,"resourceType":"folder"},"Demo\\CD-Store.bbj":{"sourcePath":true,"mediaType":"application/vnd.businessbasic.bbj","resourceType":"file"},"Demo\\ColumnSetupDemo.bbj":{"sourcePath":true,"mediaType":"application/vnd.businessbasic.bbj","resourceType":"file"},"Demo\\DatatypesDemo.bbj":{"sourcePath":true,"mediaType":"application/vnd.businessbasic.bbj","resourceType":"file"},"Demo\\Demo.bbj":{"sourcePath":true,"mediaType":"application/vnd.businessbasic.bbj","resourceType":"file"},"Demo\\EditingDemo.bbj":{"sourcePath":true,"mediaType":"application/vnd.businessbasic.bbj","resourceType":"file"},"Demo\\EnterpriseFeaturesDemo.bbj":{"sourcePath":true,"mediaType":"application/vnd.businessbasic.bbj","resourceType":"file"},"Demo\\GridColumnStateDemo.bbj":{"sourcePath":true,"mediaType":"application/vnd.businessbasic.bbj","resourceType":"file"},"Demo\\JLibDemo.bbj":{"sourcePath":true,"mediaType":"application/vnd.businessbasic.bbj","resourceType":"file"},"Demo\\SearchDemo.bbj":{"sourcePath":true,"mediaType":"application/vnd.businessbasic.bbj","resourceType":"file"},"Demo\\SelectionDemo.bbj":{"sourcePath":true,"mediaType":"application/vnd.businessbasic.bbj","resourceType":"file"},"Demo\\TreeDemo.bbj":{"sourcePath":true,"mediaType":"application/vnd.businessbasic.bbj","resourceType":"file"},"Demo\\TwoGridsDemo.bbj":{"sourcePath":true,"mediaType":"application/vnd.businessbasic.bbj","resourceType":"file"}}}}
18 changes: 18 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>BBjGridExWidget</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.dltk.core.scriptbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.basis.bdt.eclipse.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
172 changes: 153 additions & 19 deletions BBjGridExWidget.bbj
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ class public BBjGridWidgetRowEditingEvent
classend

class public BBjGridExWidgetColumnState

field public BBjString String$

classend

rem /**
Expand Down Expand Up @@ -164,14 +162,44 @@ class public BBjGridExWidget extends BBjWidget

field private HashMap SelectedRowsMap! = new HashMap()

field public static BBjString LicenseKey$

field private BBjNumber Editing! = 0

rem Enable/disable grid editing
field public BBjNumber Editable! = 0

rem Enable/disable grid single click editing
field public BBjNumber SingleClickEdit! = 0

rem Set the default column type
field public BBjString DefaultType$ = #GRID_TYPE_BASIC_STRING()

rem enable/disable group edit
field public BBjNumber GroupEdit! = 0

rem /**
rem * Define the edit type
rem *
rem * @see BBjGridExWidget.GRID_TYPE_BASIC_STRING
rem * @see BBjGridExWidget.GRID_TYPE_BASIC_TEXT
rem * @see BBjGridExWidget.GRID_TYPE_BASIC_NUMBER
rem * @see BBjGridExWidget.GRID_TYPE_BASIC_BOOLEAN
rem * @see BBjGridExWidget.GRID_TYPE_BASIC_DATE
rem * @see BBjGridExWidget.GRID_TYPE_BASIC_TIMESTAMP
rem * @see BBjGridExWidget.GRID_TYPE_BASIC_IMAGE
rem * @see BBjGridExWidget.GRID_TYPE_BASIC_IMAGE_FILTERABLE
rem */
field public BBjString EditType$ = ""

rem /**
rem * Enter Key Behavior
rem *
rem * @see BBjGridExWidget.GRID_ENTER_NEXT_CELL
rem * @see BBjGridExWidget.GRID_ENTER_STOP_EDITING
rem */
field public BBjString EnterKeyBehavior$ = ""
field public static BBjString LicenseKey$


rem --------------------- constructors -------------------------------------
rem /**
rem * disabled default constructor
Expand Down Expand Up @@ -521,7 +549,7 @@ class public BBjGridExWidget extends BBjWidget
#fireEvent(type!, event!)
methodend

method private void handleGridRowEditingEvent(BBjString detail$ , BBjNumber type!)
method private void handleGridROWEditingEvent(BBjString detail$ , BBjNumber type!)

parser! = new JsonParser()
array! = parser!.parse(detail$).getAsJsonObject().get("0")
Expand Down Expand Up @@ -651,13 +679,11 @@ class public BBjGridExWidget extends BBjWidget
node!.addProperty("width",num(width$))
fi

if (#Editable! >0) then
editable!= num(cd!.getFieldAttribute(f$,"EDITABLE",err=*next))
if editable! > 0 then
node!.addProperty("editable",1)
else
node!.addProperty("editable",0)
fi
editable!= num(cd!.getFieldAttribute(f$,"EDITABLE",err=*next))
if editable! > 0 then
node!.addProperty("editable",1)
else
node!.addProperty("editable",#Editable!)
fi

if first then
Expand Down Expand Up @@ -689,7 +715,7 @@ class public BBjGridExWidget extends BBjWidget
break

case default
node!.addProperty("type",#GRID_TYPE_BASIC_STRING())
node!.addProperty("type",#DefaultType$)
break
swend
fi
Expand Down Expand Up @@ -1101,17 +1127,54 @@ rem --------------------api methods--------------------------------
methodret state!

methodend

method public void setColumnState(BBjGridExWidgetColumnState state!)
method public void setColumnsState(BBjGridExWidgetColumnState state!)

json_state$ = state!.getString()
#HTMLView!.executeScript("gw_setState("+json_state$+")")

methodend

rem /**
rem * Start Cell Editing
rem *
rem * @param BBjNumber row!: The row number
rem * @param BBjString colId!: The column ID
rem */
method public void setStartCellEditing(BBjNumber row! , BBjString colId$)
#HTMLView!.executeScript("gw_startEditingCell("+STR(row!)+ ",'" + colId$ + "')")
methodend

rem /**
rem * Start Cell Editing
rem *
rem * @param BBjNumber row!: The row number
rem * @param BBjString colId$: The column ID
rem * @param BBjNumber char$: key chars to press on editors when editors support it
rem */
method public void setStartCellEditing(BBjNumber row! , BBjString colId$, BBjString char$)
#HTMLView!.executeScript("gw_startEditingCell("+STR(row!)+ ",'" + colId$ + "','','" + char$ +"')")
methodend


rem /**
rem * Start Cell Editing
rem *
rem * @param BBjNumber row!: The row number
rem * @param BBjString colId$: The column ID
rem * @param BBjNumber char$: key chars to press on editors when editors support it
rem * @param BBjNumber key!: key codes to press on editors when editors support it
rem */
method public void setStartCellEditing(BBjNumber row! , BBjString colId$,BBjNumber key!)
#HTMLView!.executeScript("gw_startEditingCell("+STR(row!)+ ",'" + colId$ + "','" + STR(key!)+ "')")
methodend

rem /**
rem * Start Next Cell Editing
rem */
method public void moveToNextCell()
#HTMLView!.executeScript("gw_editNextCell()")
methodend

method public void setStartCellEditing(BBjNumber row! , BBjString colId$)
#HTMLView!.executeScript("gw_startEditingCell("+STR(row!)+ ",'" + colId$ + "')")
Expand All @@ -1132,11 +1195,31 @@ rem --------------------api methods--------------------------------
method public void startPreviousCellEditing()
#HTMLView!.executeScript("gw_editPreviousCell()")
methodend


method public void stopEditing(BBjNumber cancel!)
#HTMLView!.executeScript("gw_stopEditing("+STR(cancel!)+ ")")
methodend

rem /**
rem * Move to previous cell
rem */
method public void moveToPreviousCell()
#HTMLView!.executeScript("gw_editPreviousCell()")
methodend


rem /**
rem * Stop editing and discard changes
rem */
method public void stopEditing()
#HTMLView!.executeScript("gw_stopEditing(0)")
methodend

rem /**
rem * Stop Editing
rem *
rem * @param BBjNumber cancel!: 1 = discard changes , 0 = accept changes
rem */
method public void stopEditing(BBjNumber cancel!)
#HTMLView!.executeScript("gw_stopEditing("+STR(cancel!)+ ")")
methodend
Expand Down Expand Up @@ -1264,18 +1347,30 @@ rem --------------------api methods--------------------------------
methodret BBjAPI.ON_GRID_DOUBLE_CLICK
methodend

rem /**
rem * @return constant value to define cell editing start event
rem */
method public static BBjNumber ON_GRID_CELL_EDITING_STARTED()
methodret 5000
methodend

rem /**
rem * @return constant value to define cell editing stop event
rem */
method public static BBjNumber ON_GRID_CELL_EDITING_STOPPED()
methodret 5002
methodend

rem /**
rem * @return constant value to define row editing start event
rem */
method public static BBjNumber ON_GRID_ROW_EDITING_STARTED()
methodret 5003
methodend


rem /**
rem * @return constant value to define row editing stop event
rem */
method public static BBjNumber ON_GRID_ROW_EDITING_STOPPED()
methodret 5005
methodend
Expand All @@ -1301,47 +1396,86 @@ rem --------------------api methods--------------------------------
methodret "bottom"
methodend

rem /**
rem * @return constant value to define editing mode "row"
rem */
method public static BBjString GRID_EDITTYPE_ROW()
methodret "fullRow"
methodend

rem /**
rem * @return constant value to define editing mode "cell"
rem */
method public static BBjString GRID_EDITTYPE_CELL()
methodret ""
methodend


rem /**
rem * @return constant value to define string column types
rem */
method public static BBjString GRID_TYPE_BASIC_STRING()
methodret "basic-string"
methodend

rem /**
rem * @return constant value to define text column types
rem */
method public static BBjString GRID_TYPE_BASIC_TEXT()
methodret "basic-text"
methodend

rem /**
rem * @return constant value to define number column types
rem */
method public static BBjString GRID_TYPE_BASIC_NUMBER()
methodret "basic-number"
methodend

rem /**
rem * @return constant value to define boolean column types
rem */
method public static BBjString GRID_TYPE_BASIC_BOOLEAN()
methodret "basic-boolean"
methodend

rem /**
rem * @return constant value to define date column types
rem */
method public static BBjString GRID_TYPE_BASIC_DATE()
methodret "basic-date"
methodend

rem /**
rem * @return constant value to define timestamp column types
rem */
method public static BBjString GRID_TYPE_BASIC_TIMESTAMP()
methodret "basic-timestamp"
methodend

rem /**
rem * @return constant value to define image column types
rem */
method public static BBjString GRID_TYPE_BASIC_IMAGE()
methodret "basic-image"
methodend

rem /**
rem * @return constant value to define filterable image column types
rem */
method public static BBjString GRID_TYPE_BASIC_IMAGE_FILTERABLE()
methodret "basic-image-filterable"
methodend

rem /**
rem * @return constant value to define enter key behavior (Move to next cell)
rem */
method public static BBjString GRID_ENTER_NEXT_CELL()
methodret "next"
methodend


rem /**
rem * @return constant value to define enter key behavior (Stop editing)
rem */
method public static BBjString GRID_ENTER_STOP_EDITING()
methodret "stop"
methodend
Expand Down
4 changes: 2 additions & 2 deletions Demo/ColumnSetupDemo.bbj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fillGrid:
grid!.addColumn("ARTIST","Artist Name")
grid!.addColumn("TITLE","Record Title")
grid!.addColumn("LABEL","Publisher")
grid!.addColumn("PLAYINGTIME","Playing Time (min)",Types.INTEGER)
grid!.addColumn("PLAYINGTIME","Playing Time (min)")

grid!.setColumnBackColor("CDNUMBER",BBjAPI().makeColor("LTGRAY"))
grid!.setColumnForeColor("CDNUMBER",BBjAPI().makeColor("BLUE"))
Expand All @@ -41,7 +41,7 @@ fillGrid:
grid!.setColumnAlignment("CDNUMBER",grid!.GRID_ALIGN_CENTER())

grid!.setSelectionMode(grid!.GRID_SELECT_ROW())
grid!.setMultipleSelection(1)
grid!.setMultipleSelection(0)

rs!.getItem(0).setFieldAttribute("LABEL","BGCOLOR","#FF0000")
rs!.getItem(1).setFieldAttribute("LABEL","FGCOLOR","#00FF00")
Expand Down

0 comments on commit 7f82064

Please sign in to comment.