GSelectionDialog

Description

In BBj 11.0 and higher, the GSelectionDialog class is one of the BBj CustomObjects that comprises the GApps utility. This class can used in a BBj application to enable end-user access via dialogs to Google documents and folders.

Creation

The GSelectionDialog class is found in <bbj install>/utils/gapps/gapps.bbj.

A GSelectionDialog object cannot be created directly.

Parameters

None.

Methods of GSelectionDialog

Return Value

Method

void

addFilter(string filterName, BBjVector filter)

int

doModal()

string

getDefaultDocument()

string

getDefaultFolder()

string

getDefaultType()

GDocsService

getGDocsService()

boolean

getMultipleSelection()

GDoc

getSelectedDoc()

BBjVector

getSelectedDocs()

string

getTitle()

void

removeAllFilters()

void

removeFilter(string filterName)

void

selectFilter(string filterName)

void

setDefaultDocument(string document)

void

setDefaultFolder(string folder)

void

setDefaultType(string type)

void

setMultipleSelection(boolean multipleSelection)

void

setTitle(string title)

Remarks

Requires a GUI client.

Constants

Name

Value

CANCELED

0

SELECTED

1

ALL_DOCUMENTS_FILTER_NAME

ALL_DOCUMENTS

TEXT_DOCUMENTS_FILTER_NAME

TEXT_DOCUMENTS

SPREADSHEETS_FILTER_NAME

SPREADSHEETS

PRESENTATIONS_FILTER_NAME

PRESENTATIONS

DRAWINGS_FILTER_NAME

DRAWINGS

PDF_FILES_FILTER_NAME

PDF_FILES

Example

rem Use statements
use ::gapps.bbj::GDocFolderSelectionDialog
use ::gapps.bbj::GDocSaveDialog
use ::gapps.bbj::GDocOpenDialog
use ::gapps.bbj::GDoc

rem Run a demo  

rem mode$="folder"
rem mode$="save"

rem Create a folder selection dialog
declare GDocFolderSelectionDialog folderSelectionDialog!
folderSelectionDialog! = new GDocFolderSelectionDialog()
rc = folderSelectionDialog!.doModal()

if (rc = GDocFolderSelectionDialog.getSELECTED())
  documentFolder$ = folderSelectionDialog!.getDocumentFolder()
  x=MsgBox(documentFolder$,0,"Selected folder")
endif

rem Create a save dialog
declare GDocSaveDialog saveDialog!
saveDialog! = new GDocSaveDialog()
saveDialog!.setDefaultType(GDoc.getSPREADSHEET_TYPE())
rc = saveDialog!.doModal()

if (rc = GDocSaveDialog.getSELECTED())
  title$ = saveDialog!.getDocumentTitle()
  type$ = saveDialog!.getDocumentType()
  folder$ = saveDialog!.getDocumentFolder()
  x=MsgBox(folder$ +"/" + title$,0,"Selected document")
endif

rem Create a open dialog
declare GDocOpenDialog openDialog!
openDialog! = new GDocOpenDialog()
openDialog!.setTitle("Google Documents")
openDialog!.setMultipleSelection(1)

rc = openDialog!.doModal()

if (rc = GDocOpenDialog.getSELECTED())
  declare BBjVector selectedDocs!    

  selectedDocs! = openDialog!.getSelectedDocs()
  numSelectedDocs = selectedDocs!.size()

  if (numSelectedDocs > 0)
      for i = 0 to numSelectedDocs-1
          declare GDoc selectedDoc!
          selectedDoc! = cast(GDoc,selectedDocs!.getItem(i))
          selectedDoc!.openInBrowser()
      next i
  endif
endif

release

See Also

BBj Object Syntax

GApps

GDocFolderSelectionDialog

GDocOpenDialog

GDocSaveDialog