Exemplo n.º 1
0
 public boolean performFinish() {
   Set ids = new HashSet();
   CompositeMapUtil.collectAttribueValues(ids, "id", currentNode.getRoot());
   WizardPage nextPage = (WizardPage) getPage(nextPageName);
   if (LoopupCodePage.PAGE_NAME.equals(nextPageName)) {
     LoopupCodePage loopupCodePage = (LoopupCodePage) nextPage;
     CompositeMap child = CompositeMapUtil.addElement(currentNode, childQN);
     String loopupCode = loopupCodePage.getLookUpCode();
     child.put("loopupCode", loopupCodePage.getLookUpCode());
     child.put("id", getId(ids, loopupCode));
     return true;
   }
   if (ManualDataSetPage.PAGE_NAME.equals(nextPageName)) {
     ManualDataSetPage manualDataSetPage = (ManualDataSetPage) nextPage;
     CompositeMap child = CompositeMapUtil.addElement(currentNode, childQN);
     child.put("id", manualDataSetPage.getId());
     return true;
   }
   if (BMSelectionPage.PAGE_NAME.equals(nextPageName)) {
     BMSelectionPage bmSelectionPage = (BMSelectionPage) nextPage;
     String[] names = bmSelectionPage.getSelection().split(",");
     for (int i = 0; i < names.length; i++) {
       CompositeMap child = CompositeMapUtil.addElement(currentNode, childQN);
       configCompositeMap(
           child,
           names[i],
           bmSelectionPage.getJustForInput(),
           bmSelectionPage.getFromServer(),
           bmSelectionPage.getCanSave(),
           ids);
     }
   }
   return true;
 }
Exemplo n.º 2
0
 public DataSetWizard(CompositeMap currentNode) {
   super();
   childQN = new QualifiedName(AuroraConstant.ApplicationUri, "dataSet");
   this.currentNode = currentNode;
   String prefix = CompositeMapUtil.getContextPrefix(currentNode, childQN);
   childQN.setPrefix(prefix);
 }
Exemplo n.º 3
0
 protected CellEditor[] getCellEditors() throws ApplicationException {
   if (cellEditors != null) return cellEditors;
   if ((gridStyle & IGridViewer.fullEditable) == 0) {
     String[] columnNames = getColumnNames();
     cellEditors = new CellEditor[columnNames.length];
     for (int i = 0; i < columnNames.length; i++) {
       TextCellEditor tce = new TextCellEditor(tableViewer.getTable());
       Text text = (Text) tce.getControl();
       text.setEditable(false);
       cellEditors[i] = tce;
     }
   } else {
     List attrib_list = CompositeMapUtil.getArrayAttrs(data);
     cellEditors = new CellEditor[attrib_list.size()];
     int id = 0;
     for (Iterator it = attrib_list.iterator(); it.hasNext(); ) {
       Attribute attrib = (Attribute) it.next();
       ICellEditor cellEditor =
           CellEditorFactory.getInstance().createCellEditor(this, attrib, null, null);
       if (cellEditor != null) {
         cellEditors[id++] = cellEditor.getCellEditor();
         addEditor(attrib.getLocalName(), cellEditor);
       } else {
         cellEditors[id++] = new TextCellEditor(tableViewer.getTable());
       }
     }
   }
   return cellEditors;
 }
Exemplo n.º 4
0
  protected void createDefaultActions() {
    toolBarManager.removeAll();
    if ((gridStyle & IGridViewer.NoToolBar) == 0) {
      if ((gridStyle & IGridViewer.fullEditable) != 0) {
        Element element = null;
        try {
          // element =
          // LoadSchemaManager.getSchemaManager().getElement(
          // data);
          element = CompositeMapUtil.getElement(data);
        } catch (Exception e) {
          // do nothing
        }
        if (element != null && element.isArray()) {
          final QualifiedName qName = element.getElementType().getQName();
          Action addAction = new AddElementAction(this, data, qName, ActionListener.NONE);
          addAction.setText("");
          addAction.setHoverImageDescriptor(
              AuroraPlugin.getImageDescriptor(LocaleMessage.getString("add.icon")));

          Action removeAction = new RemoveElementAction(this, ActionListener.DefaultImage);
          Action refreshAction = new RefreshAction(this, ActionListener.DefaultImage);
          toolBarManager.add(createActionContributionItem(addAction));
          toolBarManager.add(createActionContributionItem(refreshAction));
          toolBarManager.add(createActionContributionItem(removeAction));
          toolBarManager.update(true);
          tableViewer
              .getTable()
              .addKeyListener(
                  new KeyListener() {
                    public void keyPressed(KeyEvent e) {
                      if (e.keyCode == SWT.DEL) {
                        removeElement();
                      }
                    }

                    public void keyReleased(KeyEvent e) {}
                  });
        }
      }
    }
    if ((gridStyle & IGridViewer.isMulti) != 0) {

      Action allCheckAction =
          new Action(
              LocaleMessage.getString("all.checed"),
              AuroraPlugin.getImageDescriptor(LocaleMessage.getString("checked.icon"))) {
            public void run() {
              setAllChecked(tableViewer.getTable(), true);
            }
          };
      Action unAllCheckAction =
          new Action(
              LocaleMessage.getString("non.checed"),
              AuroraPlugin.getImageDescriptor(LocaleMessage.getString("unchecked.icon"))) {
            public void run() {
              setAllChecked(tableViewer.getTable(), false);
            }
          };
      toolBarManager.add(createActionContributionItem(allCheckAction));
      toolBarManager.add(createActionContributionItem(unAllCheckAction));
      toolBarManager.update(true);
    }
  }
Exemplo n.º 5
0
 public String[] getColumnNames() throws ApplicationException {
   if (columnNames == null) columnNames = CompositeMapUtil.getArrayAttrNames(data);
   return columnNames;
 }