示例#1
0
 @Override
 public void run() {
   WizardDialog wd = new WizardDialog(designer.getSite().getShell(), new BMFromDBWizard_2());
   if (Window.OK == wd.open() && selection != null) {
     addFields();
   }
 }
示例#2
0
 private void addFields() {
   String pkName = null;
   if (primaryKeys != null && primaryKeys.getChildsNotNull().size() == 1) {
     pkName = ((CompositeMap) primaryKeys.getChilds().get(0)).getString("name");
   }
   if (pkName != null) {
     model.getPkRecord().setName(pkName);
   }
   @SuppressWarnings("unchecked")
   List<CompositeMap> list = selection.getChildsNotNull();
   for (CompositeMap m : list) {
     String column_name = m.getString("name");
     if (pkName != null && pkName.equalsIgnoreCase(column_name)) continue;
     Record r = model.getRecordByName(column_name);
     if (r == null) {
       r = DesignerUtil.createRecord(m);
       model.add(r);
     }
   }
   ((BMDesignPage) designer.getActivePageInstance()).refreshRecordViewer();
 }
示例#3
0
 private IProject getAuroraProject() throws ResourceNotFoundException {
   IFile file = designer.getInputFile();
   IProject proj = file.getProject();
   AuroraMetaProject amp = new AuroraMetaProject(proj);
   return amp.getAuroraProject();
 }