Differences
This shows you the differences between two versions of the page.
|
polymorphic [2012/04/09 18:31] dragan.milicev |
polymorphic [2012/07/09 10:52] (current) srdjan.lukovic [GUI Code] |
||
|---|---|---|---|
| Line 25: | Line 25: | ||
| import rs.sol.soloist.helpers.init.Initializer; | import rs.sol.soloist.helpers.init.Initializer; | ||
| import rs.sol.soloist.helpers.init.InitializerFailedException; | import rs.sol.soloist.helpers.init.InitializerFailedException; | ||
| - | import rs.sol.soloist.server.builtindomains.builtindatatypes.Text; | ||
| import rs.sol.soloist.server.guiconfiguration.components.GUIApplicationComponent; | import rs.sol.soloist.server.guiconfiguration.components.GUIApplicationComponent; | ||
| import rs.sol.soloist.server.guiconfiguration.components.GUIDeckComponent; | import rs.sol.soloist.server.guiconfiguration.components.GUIDeckComponent; | ||
| Line 31: | Line 30: | ||
| import rs.sol.soloist.server.guiconfiguration.components.GUIPanelComponent; | import rs.sol.soloist.server.guiconfiguration.components.GUIPanelComponent; | ||
| import rs.sol.soloist.server.guiconfiguration.construction.GUIComponentBinding; | import rs.sol.soloist.server.guiconfiguration.construction.GUIComponentBinding; | ||
| - | import rs.sol.soloist.server.guiconfiguration.elementcomponents.GUICollectionInput; | + | import rs.sol.soloist.server.guiconfiguration.elementcomponents.GUIEdit; |
| - | import rs.sol.soloist.server.guiconfiguration.elementcomponents.GUIComboWidget; | + | |
| import rs.sol.soloist.server.guiconfiguration.elementcomponents.GUIElementComponent; | import rs.sol.soloist.server.guiconfiguration.elementcomponents.GUIElementComponent; | ||
| - | import rs.sol.soloist.server.guiconfiguration.elementcomponents.GUISlotEditorKind; | + | import rs.sol.soloist.server.guiconfiguration.elementcomponents.GUIInput; |
| import rs.sol.soloist.server.guiconfiguration.nonvisualcompoments.GUIConformsToFilter; | import rs.sol.soloist.server.guiconfiguration.nonvisualcompoments.GUIConformsToFilter; | ||
| import rs.sol.soloist.server.guiconfiguration.nonvisualcompoments.GUIFindAllInstancesSAPComponent; | import rs.sol.soloist.server.guiconfiguration.nonvisualcompoments.GUIFindAllInstancesSAPComponent; | ||
| Line 47: | Line 45: | ||
| { | { | ||
| GUIApplicationComponent page = new GUIApplicationComponent(); | GUIApplicationComponent page = new GUIApplicationComponent(); | ||
| - | page.name.set(Text.fromString("Polymorphic")); | + | page.setName("Polymorphic"); |
| SoloistServiceServlet.registerApplication(page); | SoloistServiceServlet.registerApplication(page); | ||
| - | page.context.set(DefaultContextInit.getRoot()); | + | page.setContext(DefaultContextInit.getRoot()); |
| GUIPanelComponent root = GUIPanelComponent.createFlow(page); | GUIPanelComponent root = GUIPanelComponent.createFlow(page); | ||
| GUILabelComponent title = GUILabelComponent.create(root, "Polymorphic"); | GUILabelComponent title = GUILabelComponent.create(root, "Polymorphic"); | ||
| - | title.styleName.set(Text.fromString("titleStyle")); | + | title.setStyle("titleStyle"); |
| GUIPanelComponent topPanel = GUIPanelComponent.createFlow(root); | GUIPanelComponent topPanel = GUIPanelComponent.createFlow(root); | ||
| - | topPanel.styleName.set(Text.fromString("topPanel")); | + | topPanel.setStyle("topPanel"); |
| GUIPanelComponent wrap = GUIPanelComponent.createFlow(topPanel); | GUIPanelComponent wrap = GUIPanelComponent.createFlow(topPanel); | ||
| Line 63: | Line 61: | ||
| GUILabelComponent.create(wrap, "Choose person:"); | GUILabelComponent.create(wrap, "Choose person:"); | ||
| - | GUIFindAllInstancesSAPComponent allPersons = GUIFindAllInstancesSAPComponent.create(wrap, Person.FQ_TYPE_NAME); | + | GUIFindAllInstancesSAPComponent allPersons = GUIFindAllInstancesSAPComponent.create(wrap, Person.CLASSIFIER); |
| - | GUIElementComponent comboBox = GUIElementComponent.createInput(wrap, new GUIComboWidget(), new GUICollectionInput()); | + | GUIInput comboBox = GUIInput.createCombo(wrap); |
| - | GUIComponentBinding.create(allPersons.value, GUICollectionInput.get(comboBox).collection); | + | GUIComponentBinding.create(allPersons.opValue(), comboBox.ipCollection()); |
| GUIDeckComponent deck = GUIDeckComponent.create(wrap); | GUIDeckComponent deck = GUIDeckComponent.create(wrap); | ||
| Line 75: | Line 73: | ||
| int row = createPersonsDetails(comboBox, bankAdviserDetailsTable); | int row = createPersonsDetails(comboBox, bankAdviserDetailsTable); | ||
| GUILabelComponent.create(bankAdviserDetailsTable, "Bank Name: ", row, 0); | GUILabelComponent.create(bankAdviserDetailsTable, "Bank Name: ", row, 0); | ||
| - | GUIElementComponent nameEditor = GUIElementComponent.createSlotEditor(bankAdviserDetailsTable, BankAdviser.PROPERTIES.bank, row++, 1); | + | GUIEdit nameEditor = GUIEdit.createField(bankAdviserDetailsTable, BankAdviser.PROPERTIES.bank, row++, 1); |
| - | GUIComponentBinding.create(comboBox.value, GUISlotEditorKind.get(nameEditor).element); | + | GUIComponentBinding.create(comboBox.opValue(), nameEditor.ipElement()); |
| - | GUIConformsToFilter isItBankAdviser = GUIConformsToFilter.create(deck, comboBox.value, BankAdviser.CLASSIFIER); // Is the selected object an instance of the BankAdviser class? | + | // Is the selected object an instance of the BankAdviser class? |
| - | GUIComponentBinding.create(isItBankAdviser.yes, bankAdviserDetailsTable.show); | + | GUIConformsToFilter isItBankAdviser = GUIConformsToFilter.create(deck, BankAdviser.CLASSIFIER); |
| - | GUIComponentBinding.create(isItBankAdviser.no, personDetailsTable.show); | + | GUIComponentBinding.create(comboBox.opValue(), isItBankAdviser.ipInput()); |
| + | GUIComponentBinding.create(isItBankAdviser.opYes(), bankAdviserDetailsTable.ipShow()); | ||
| + | GUIComponentBinding.create(isItBankAdviser.opNo(), personDetailsTable.ipShow()); | ||
| } | } | ||
| Line 86: | Line 86: | ||
| int row = 0; | int row = 0; | ||
| GUILabelComponent.create(detailsTable, "Name: ", row, 0); | GUILabelComponent.create(detailsTable, "Name: ", row, 0); | ||
| - | GUIElementComponent nameEditor = GUIElementComponent.createSlotEditor(detailsTable, Person.PROPERTIES.name, row++, 1); | + | GUIEdit nameEditor = GUIEdit.createField(detailsTable, Person.PROPERTIES.name, row++, 1); |
| GUILabelComponent.create(detailsTable, "Gender: ", row, 0); | GUILabelComponent.create(detailsTable, "Gender: ", row, 0); | ||
| - | GUIElementComponent genderEditor = GUIElementComponent.createSlotEditor(detailsTable, Person.PROPERTIES.gender, row++, 1); | + | GUIEdit genderEditor = GUIEdit.createField(detailsTable, Person.PROPERTIES.gender, row++, 1); |
| GUILabelComponent.create(detailsTable, "Age: ", row, 0); | GUILabelComponent.create(detailsTable, "Age: ", row, 0); | ||
| - | GUIElementComponent ageEditor = GUIElementComponent.createSlotEditor(detailsTable, Person.PROPERTIES.age, row++, 1); | + | GUIEdit ageEditor = GUIEdit.createField(detailsTable, Person.PROPERTIES.age, row++, 1); |
| GUILabelComponent.create(detailsTable, "Date of birth: ", row, 0); | GUILabelComponent.create(detailsTable, "Date of birth: ", row, 0); | ||
| - | GUIElementComponent dateOfBirthEditor = GUIElementComponent.createSlotEditor(detailsTable, Person.PROPERTIES.dateOfBirth, row++, 1); | + | GUIEdit dateOfBirthEditor = GUIEdit.createField(detailsTable, Person.PROPERTIES.dateOfBirth, row++, 1); |
| GUILabelComponent.create(detailsTable, "Height [m]: ", row, 0); | GUILabelComponent.create(detailsTable, "Height [m]: ", row, 0); | ||
| - | GUIElementComponent heightEditor = GUIElementComponent.createSlotEditor(detailsTable, Person.PROPERTIES.height, row++, 1); | + | GUIEdit heightEditor = GUIEdit.createField(detailsTable, Person.PROPERTIES.height, row++, 1); |
| GUILabelComponent.create(detailsTable, "Is married: ", row, 0); | GUILabelComponent.create(detailsTable, "Is married: ", row, 0); | ||
| - | GUIElementComponent isMarriedEditor = GUIElementComponent.createSlotEditor(detailsTable, Person.PROPERTIES.isMarried, row++, 1); | + | GUIEdit isMarriedEditor = GUIEdit.createField(detailsTable, Person.PROPERTIES.isMarried, row++, 1); |
| - | GUIComponentBinding.create(comboBox.value, GUISlotEditorKind.get(nameEditor).element); | + | GUIComponentBinding.create(comboBox.opValue(), nameEditor.ipElement()); |
| - | GUIComponentBinding.create(comboBox.value, GUISlotEditorKind.get(genderEditor).element); | + | GUIComponentBinding.create(comboBox.opValue(), genderEditor.ipElement()); |
| - | GUIComponentBinding.create(comboBox.value, GUISlotEditorKind.get(ageEditor).element); | + | GUIComponentBinding.create(comboBox.opValue(), ageEditor.ipElement()); |
| - | GUIComponentBinding.create(comboBox.value, GUISlotEditorKind.get(dateOfBirthEditor).element); | + | GUIComponentBinding.create(comboBox.opValue(), dateOfBirthEditor.ipElement()); |
| - | GUIComponentBinding.create(comboBox.value, GUISlotEditorKind.get(heightEditor).element); | + | GUIComponentBinding.create(comboBox.opValue(), heightEditor.ipElement()); |
| - | GUIComponentBinding.create(comboBox.value, GUISlotEditorKind.get(isMarriedEditor).element); | + | GUIComponentBinding.create(comboBox.opValue(), isMarriedEditor.ipElement()); |
| return row; | return row; | ||
| } | } | ||
| } | } | ||
| </code> | </code> | ||