Source:
<code>public SingleDatastorePropertyWidget(ComponentBuilder componentBuilder, ConfiguredPropertyDescriptor propertyDescriptor, DatastoreCatalog datastoreCatalog, DCModule dcModule) { super(componentBuilder, propertyDescriptor); _datastoreCatalog = datastoreCatalog; _dcModule = dcModule; _datastoreClass = propertyDescriptor.getBaseType(); String[] datastoreNames = _datastoreCatalog.getDatastoreNames(); List<Datastore> list = new ArrayList<Datastore>(); if (!propertyDescriptor.isRequired()) { list.add(null); } for (int i = 0; i < datastoreNames.length; i++) { Datastore datastore = _datastoreCatalog.getDatastore(datastoreNames[i]); if (ReflectionUtils.is(datastore.getClass(), _datastoreClass)) { list.add(datastore); } } _comboBox = new DCComboBox<Datastore>(list); _comboBox.setRenderer(new SchemaStructureComboBoxListRenderer()); addComboListener(new Listener<Datastore>() { @Override public void onItemSelected(Datastore item) { openConnection(item); fireValueChanged(); } }); Datastore currentValue = (Datastore) componentBuilder.getConfiguredProperty(propertyDescriptor); setValue(currentValue); _createDatastoreButton = WidgetFactory.createSmallPopupButton("", IconUtils.ACTION_CREATE_TABLE); _createDatastoreButton.setToolTipText("Create datastore"); <START> JPopupMenu createDatastoreMenu = _createDatastoreButton.getMenu(); <END> populateCreateDatastoreMenu(createDatastoreMenu); _panelAroundButton = DCPanel.around(_createDatastoreButton); _panelAroundButton.setBorder(WidgetUtils.BORDER_EMPTY); _panelAroundButton.setVisible(true); final DCPanel panel = new DCPanel(); panel.setLayout(new BorderLayout()); panel.add(_comboBox, BorderLayout.CENTER); panel.add(_panelAroundButton, BorderLayout.EAST); add(panel); }</code><technical_language>final</technical_language>

Target:
public SingleDatastorePropertyWidget(ComponentBuilder componentBuilder, ConfiguredPropertyDescriptor propertyDescriptor, DatastoreCatalog datastoreCatalog, DCModule dcModule) { super(componentBuilder, propertyDescriptor); _datastoreCatalog = datastoreCatalog; _dcModule = dcModule; _datastoreClass = propertyDescriptor.getBaseType(); String[] datastoreNames = _datastoreCatalog.getDatastoreNames(); List<Datastore> list = new ArrayList<Datastore>(); if (!propertyDescriptor.isRequired()) { list.add(null); } for (int i = 0; i < datastoreNames.length; i++) { Datastore datastore = _datastoreCatalog.getDatastore(datastoreNames[i]); if (ReflectionUtils.is(datastore.getClass(), _datastoreClass)) { list.add(datastore); } } _comboBox = new DCComboBox<Datastore>(list); _comboBox.setRenderer(new SchemaStructureComboBoxListRenderer()); addComboListener(new Listener<Datastore>() { @Override public void onItemSelected(Datastore item) { openConnection(item); fireValueChanged(); } }); Datastore currentValue = (Datastore) componentBuilder.getConfiguredProperty(propertyDescriptor); setValue(currentValue); _createDatastoreButton = WidgetFactory.createSmallPopupButton("", IconUtils.ACTION_CREATE_TABLE); _createDatastoreButton.setToolTipText("Create datastore"); final JPopupMenu createDatastoreMenu = _createDatastoreButton.getMenu(); populateCreateDatastoreMenu(createDatastoreMenu); _panelAroundButton = DCPanel.around(_createDatastoreButton); _panelAroundButton.setBorder(WidgetUtils.BORDER_EMPTY); _panelAroundButton.setVisible(true); final DCPanel panel = new DCPanel(); panel.setLayout(new BorderLayout()); panel.add(_comboBox, BorderLayout.CENTER); panel.add(_panelAroundButton, BorderLayout.EAST); add(panel); }