void init() { contexts = cadsrModule.getAllContexts(); int contentCount = contextComboBox.getItemCount(); int i = 0; while (i <= contentCount && contentCount != 0) { contextComboBox.removeItemAt(i); contentCount = contextComboBox.getItemCount(); } for (Context _con : contexts) { contextComboBox.addItem(_con.getName()); } contextComboBox.setSelectedItem(PropertyAccessor.getProperty("gme.generate.default.context")); }
public void apply() { if (!modified) return; // uncomment to enable feature // if(inheritedAttributes.isInherited(de)) { // if(!userPrefs.getBoolean("de.over.vd.mapping.warning")) { // DontWarnMeAgainDialog dontWarnDialog = new // DontWarnMeAgainDialog("de.over.vd.mapping.warning"); // } // } modified = false; de.setLongName(tempDE.getLongName()); de.setPublicId(tempDE.getPublicId()); de.setVersion(tempDE.getVersion()); de.setContext(tempDE.getContext()); de.setValueDomain(tempDE.getValueDomain()); fireElementChangeEvent(new ElementChangeEvent(node)); if (tempDE.getDataElementConcept() != null) { if (de.getDataElementConcept().getObjectClass().getPublicId() == null || de.getDataElementConcept().getObjectClass().getPublicId().length() == 0) { JOptionPane.showMessageDialog( null, PropertyAccessor.getProperty("oc.mapping.warning"), "Please note", JOptionPane.INFORMATION_MESSAGE); } de.getDataElementConcept() .getObjectClass() .setPublicId(tempDE.getDataElementConcept().getObjectClass().getPublicId()); de.getDataElementConcept() .getObjectClass() .setVersion(tempDE.getDataElementConcept().getObjectClass().getVersion()); de.getDataElementConcept() .getObjectClass() .setLongName(tempDE.getDataElementConcept().getObjectClass().getLongName()); de.getDataElementConcept() .getProperty() .setPublicId(tempDE.getDataElementConcept().getProperty().getPublicId()); de.getDataElementConcept() .getProperty() .setVersion(tempDE.getDataElementConcept().getProperty().getVersion()); } else { boolean found = false; List<DataElement> des = ElementsLists.getInstance().getElements(DomainObjectFactory.newDataElement()); for (DataElement curDe : des) { if (curDe.getDataElementConcept().getObjectClass() == de.getDataElementConcept().getObjectClass()) if (!StringUtil.isEmpty(curDe.getPublicId())) { found = true; } } if (!found) { de.getDataElementConcept().getObjectClass().setPublicId(null); de.getDataElementConcept().getObjectClass().setVersion(null); } } if (tempDE.getDataElementConcept() != null) { firePropertyChangeEvent(new PropertyChangeEvent(this, ButtonPanel.SWITCH, null, false)); firePropertyChangeEvent(new PropertyChangeEvent(this, ApplyButtonPanel.REVIEW, null, true)); } else { firePropertyChangeEvent(new PropertyChangeEvent(this, ButtonPanel.SWITCH, null, true)); firePropertyChangeEvent(new PropertyChangeEvent(this, ApplyButtonPanel.REVIEW, null, false)); } firePropertyChangeEvent(new PropertyChangeEvent(this, ApplyButtonPanel.SAVE, null, false)); }