Skip to content

Commit

Permalink
feat: add supported themes as constants
Browse files Browse the repository at this point in the history
  • Loading branch information
hyyan committed Mar 5, 2020
1 parent 2dfd5ce commit 717c87d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
39 changes: 35 additions & 4 deletions BBjGridExWidget.bbj
Expand Up @@ -429,6 +429,30 @@ class public BBjGridExWidget extends BBjWidget implements BBjGridExWidgetColumns
methodret "chartDownload"
methodend
rem /**
rem * Constant value which defines that balham theme
rem *
rem * @return BBjString
rem */
method public static BBjString GRID_THEME_BALHAM()
methodret "balham"
methodend
rem /**
rem * Constant value which defines that balham dark theme
rem *
rem * @return BBjString
rem */
method public static BBjString GRID_THEME_BALHAM_DARK()
methodret "balham-dark"
methodend
rem /**
rem * Constant value which defines tha tmaterial theme
rem *
rem * @return BBjString
rem */
method public static BBjString GRID_THEME_MATERIAL()
methodret "material"
methodend
rem /**
rem * Make Hex Color
rem *
rem * Convert the given BBjColor to a hex color string
Expand Down Expand Up @@ -1762,7 +1786,7 @@ class public BBjGridExWidget extends BBjWidget implements BBjGridExWidgetColumns
rem */
method public void setColumnState(BBjGridExWidgetState state!)
#executeScript("gw_setState('" + #GRIDID$ + "'," + state!.toString() +")")
methodend
methodend
rem /**
rem * Get the grid's columns , sorting and filtering state
rem *
Expand Down Expand Up @@ -1871,6 +1895,9 @@ class public BBjGridExWidget extends BBjWidget implements BBjGridExWidgetColumns
rem * @param BBjString theme$
rem *
rem * @see getThemes()
rem * @see GRID_THEME_BALHAM()
rem * @see GRID_THEME_BALHAM_DARK()
rem * @see GRID_THEME_MATERIAL()
rem */
method public void setTheme(BBjString theme$)
#getOptions().setTheme(theme$)
Expand All @@ -1894,12 +1921,16 @@ class public BBjGridExWidget extends BBjWidget implements BBjGridExWidgetColumns
rem * <br><b><small>#API</small></b>
rem *
rem * @return BBjVector array of theme names
rem *
rem * @see GRID_THEME_BALHAM()
rem * @see GRID_THEME_BALHAM_DARK()
rem * @see GRID_THEME_MATERIAL()
rem */
method public BBjVector getThemes()
v! = new BBjVector()
v!.addItem("balham")
v!.addItem("balham-dark")
v!.addItem("material")
v!.addItem(#GRID_THEME_BALHAM())
v!.addItem(#GRID_THEME_BALHAM_DARK())
v!.addItem(#GRID_THEME_MATERIAL())
methodret v!
methodend
rem /**
Expand Down
2 changes: 1 addition & 1 deletion demo/Enhanced/TreeDataDemo.bbj
Expand Up @@ -62,7 +62,7 @@ autoGroupDef!.setWidth(500)
autoGroupDef!.getCellRenderer().setInnerRenderer(new BBjGridExWidgetRendererCustomHTML(template!))

grid!.getSidebar().setHiddenByDefault(1)
grid!.setTheme("balham-dark")
grid!.setTheme(grid!.GRID_THEME_BALHAM_DARK())

grid!.setCallback(grid!.ON_GRID_CELL_DOUBLE_CLICK(),"onSelectionEvent")

Expand Down

0 comments on commit 717c87d

Please sign in to comment.