コード例 #1
0
 private String newItem(Set<String> suggestions) {
   XDialog xDialog = getDialog(getDialogLibraryName() + ".NewDialog");
   if (xDialog != null) {
     String[] sItems = Misc.sortStringSet(suggestions);
     DialogAccess ndlg = new DialogAccess(xDialog);
     ndlg.setListBoxStringItemList("Name", sItems);
     String sResult = null;
     if (xDialog.execute() == ExecutableDialogResults.OK) {
       DialogAccess dlg = new DialogAccess(xDialog);
       sResult = dlg.getTextFieldText("Name");
     }
     xDialog.endExecute();
     return sResult;
   }
   return null;
 }
コード例 #2
0
    private void styleFamilyChange(DialogAccess dlg) {
      short nNewFamily = dlg.getListBoxSelectedItem("StyleFamily");
      if (nNewFamily > -1 && nNewFamily != nCurrentFamily) {
        // The user has changed the family; load and display the corresponding style names
        updateStyleMaps(dlg);
        nCurrentFamily = nNewFamily;
        sCurrentStyleName = null;

        String[] sStyleNames = Misc.sortStringSet(styleMap[nNewFamily].keySet());
        dlg.setListBoxStringItemList("StyleName", sStyleNames);
        if (sStyleNames.length > 0) {
          dlg.setListBoxSelectedItem("StyleName", (short) 0);
        } else {
          dlg.setListBoxSelectedItem("StyleName", (short) -1);
        }

        updateStyleControls(dlg);
        styleNameChange(dlg);
      }
    }