コード例 #1
0
 private void drawObject() throws RemoteException {
   Text text = getText(this.defaultText);
   if (this._product != null) {
     text.setText(this._product.getProductName(this._productLocaleId));
   }
   add(text);
 }
コード例 #2
0
    public PresentationObject getObjectToAddToColumn(
        int colIndex, int rowIndex, Object item, IWContext iwc, boolean beforeEntities)
        throws Exception {
      if (item == null) {
        if (beforeEntities && (rowIndex == 1)) {
          Text text = new Text();
          text.setFontFace(Text.FONT_FACE_ARIAL);
          text.setFontColor("#FFFFFF");
          text.setFontSize(Text.FONT_SIZE_7_HTML_1);
          text.setBold();

          switch (colIndex) {
            case 1:
              text.setText("Choose");
              break;
            case 3:
              text.setText("Name");
              break;
            case 5:
              text.setText("Title");
              break;
            case 7:
              text.setText("Phone");
              break;
            case 9:
              text.setText("e-mail");
              break;
            default:
              return null;
          }
          return text;
        }
      } else {
        Text text = new Text("");

        StaffHolder staffHolder = (StaffHolder) item;

        switch (colIndex) {
          case 1:
            return getCheckBox(staffHolder.getGroupID());
            // break;
          case 3:
            /** @todo change accesscontrol */
            //              boolean staffHolderIsSuperAdmin =
            // iwc.getAccessController().getAdministratorUser().getID() == staffHolder.getUserID();
            //              if(iwc.isSuperAdmin() && !staffHolderIsSuperAdmin){  //tmp
            //                text = new Link(staffHolder.getName());
            //  //              ((Link)text).setWindowToOpen(StaffEditor.class);
            //  //
            // ((Link)text).addParameter(StaffBusiness.PARAMETER_USER_ID,staffHolder.getUserID());
            //                ((Link)text).setWindowToOpen(StaffPropertyWindow.class);
            //                ((Link)text).addParameter(StaffPropertyWindow.PARAMETERSTRING_USER_ID,
            // staffHolder.getUserID());
            //              } else {
            text.setText(staffHolder.getName());
            //              }
            break;
          case 5:
            if (staffHolder.getTitle() != null) {
              text.setText(staffHolder.getTitle());
            }
            break;
          case 7:
            if (staffHolder.getWorkPhone() != null) {
              text.setText(staffHolder.getWorkPhone());
            }
            break;
          case 9:
            if (staffHolder.getEmail() != null) {
              text.setText(staffHolder.getEmail());
            }
            break;
          default:
            return null;
        }
        text.setFontSize(Text.FONT_SIZE_7_HTML_1);
        text.setFontFace(Text.FONT_FACE_ARIAL);
        return text;
      }
      return null;
    }