private IView<JComponent> createListView(IListViewDescriptor viewDescriptor, @SuppressWarnings("unused") IActionHandler actionHandler, @SuppressWarnings("unused") Locale locale) { ICollectionDescriptorProvider<?> modelDescriptor = ((ICollectionDescriptorProvider<?>) viewDescriptor .getModelDescriptor()); ICompositeValueConnector rowConnectorPrototype = connectorFactory .createCompositeValueConnector(modelDescriptor.getName() + "Element", viewDescriptor.getRenderedProperty()); ICollectionConnector connector = connectorFactory .createCollectionConnector(modelDescriptor.getName(), mvcBinder, rowConnectorPrototype); JList viewComponent = createJList(); JScrollPane scrollPane = createJScrollPane(); scrollPane.setViewportView(viewComponent); IView<JComponent> view = constructView(scrollPane, viewDescriptor, connector); if (viewDescriptor.getRenderedProperty() != null) { IValueConnector cellConnector = createColumnConnector(viewDescriptor .getRenderedProperty(), modelDescriptor.getCollectionDescriptor() .getElementDescriptor()); rowConnectorPrototype.addChildConnector(cellConnector); } viewComponent.setCellRenderer(new EvenOddListCellRenderer()); viewComponent.setModel(new CollectionConnectorListModel(connector)); listSelectionModelBinder.bindSelectionModel(connector, viewComponent .getSelectionModel(), null); return view; }
viewDescriptor.getRootSubtreeDescriptor(), getDescriptorPathFromConnectorTreePath(path)) .getNodeGroupDescriptor().getIconImageURL(), IIconFactory.SMALL_ICON_SIZE); .getModel().getRoot(), (IValueConnector) value))) .getNodeGroupDescriptor(); String labelKey = nodeGroupDescriptor.getName(); if (labelKey == null) { labelKey = nodeGroupDescriptor.getModelDescriptor().getName(); labelText = nodeGroupDescriptor.getI18nName(getTranslationProvider(), locale); if (nodeGroupDescriptor.getDescription() != null) { ToolTipManager.sharedInstance().registerComponent(tree); toolTipText = nodeGroupDescriptor.getI18nDescription( getTranslationProvider(), locale) + TOOLTIP_ELLIPSIS;
IView<JComponent> view = constructView(scrollPane, viewDescriptor, connector); viewComponent.setCellRenderer(new EvenOddListCellRenderer(getIconFactory(), viewDescriptor.getRenderedProperty(), viewDescriptor.isDisplayIcon())); viewComponent.setModel(new CollectionConnectorListModel(connector)); viewComponent.setSelectionMode(getSelectionMode(viewDescriptor)); listSelectionModelBinder.bindSelectionModel(viewComponent, connector, viewComponent.getSelectionModel(), null); if (viewDescriptor.getRowAction() != null) { final Action rowAction = getActionFactory().createAction(viewDescriptor.getRowAction(), actionHandler, view, locale); viewComponent.addMouseListener(new MouseAdapter() {
private SecurityContextBuilder append(ITreeLevelDescriptor treeLevelDescriptor) { if (treeLevelDescriptor != null) { String permId = treeLevelDescriptor.getPermId(); if (permId == null) { permId = treeLevelDescriptor.getNodeGroupDescriptor().getPermId(); } append(treeLevelDescriptor.getNodeGroupDescriptor().getModelDescriptor()); appendToViewChain(permId); } return this; }
/** * {@inheritDoc} */ @Override protected IView<RComponent> createListView(IListViewDescriptor viewDescriptor, IActionHandler actionHandler, Locale locale) { ICollectionConnector connector = createListViewConnector(viewDescriptor); RList viewComponent = createRList(viewDescriptor); viewComponent.setDisplayIcon(viewDescriptor.isDisplayIcon()); IView<RComponent> view = constructView(viewComponent, viewDescriptor, connector); viewComponent.setSelectionMode(viewDescriptor.getSelectionMode().name()); if (viewDescriptor.getRowAction() != null) { viewComponent.setRowAction( getActionFactory().createAction(viewDescriptor.getRowAction(), actionHandler, view, locale)); } return view; }
@SuppressWarnings("unused") Locale locale) { ICollectionDescriptorProvider<?> modelDescriptor = ((ICollectionDescriptorProvider<?>) viewDescriptor .getModelDescriptor()); ICompositeValueConnector rowConnectorPrototype = getConnectorFactory() .createCompositeValueConnector(modelDescriptor.getName() + "Element", viewDescriptor.getRenderedProperty()); if (rowConnectorPrototype instanceof AbstractCompositeValueConnector) { ((AbstractCompositeValueConnector) rowConnectorPrototype) .setDisplayIconImageUrl(viewDescriptor.getIconImageURL()); ((AbstractCompositeValueConnector) rowConnectorPrototype) .setIconImageURLProvider(viewDescriptor.getIconImageURLProvider()); connector); if (viewDescriptor.getRenderedProperty() != null) { IValueConnector cellConnector = createListConnector( viewDescriptor.getRenderedProperty(), modelDescriptor .getCollectionDescriptor().getElementDescriptor()); rowConnectorPrototype.addChildConnector(cellConnector);
ModelRefPropertyConnector.THIS_PROPERTY, ((ICompositeTreeLevelDescriptor) rootDescriptor) .getNodeGroupDescriptor().getRenderedProperty()); List<ICollectionConnectorProvider> subtreeConnectors = new ArrayList<ICollectionConnectorProvider>(); if (((ICompositeTreeLevelDescriptor) rootDescriptor) ModelRefPropertyConnector.THIS_PROPERTY, ((ISimpleTreeLevelDescriptor) rootDescriptor) .getNodeGroupDescriptor().getRenderedProperty()); if (((ISimpleTreeLevelDescriptor) rootDescriptor).getChildDescriptor() != null) { ICollectionConnectorProvider subtreeConnector = createNodeGroupConnector(
/** * Sets the childrenDescriptors. * * @param childrenDescriptors * the childrenDescriptors to set. */ public void setChildrenDescriptors( List<ITreeLevelDescriptor> childrenDescriptors) { this.childrenDescriptors = new LinkedHashMap<String, ITreeLevelDescriptor>(); for (ITreeLevelDescriptor descriptor : childrenDescriptors) { // String nodeGroupDescriptorName = descriptor.getNodeGroupDescriptor() // .getName(); // if (nodeGroupDescriptorName == null) { String nodeGroupDescriptorName = descriptor.getNodeGroupDescriptor() .getModelDescriptor().getName(); // } this.childrenDescriptors.put(nodeGroupDescriptorName, descriptor); } } }
/** * {@inheritDoc} */ @Override public String getIconImageURL() { String iconImageURL = super.getIconImageURL(); if (iconImageURL == null) { iconImageURL = rootSubtreeDescriptor.getNodeGroupDescriptor() .getIconImageURL(); setIconImageURL(iconImageURL); } return iconImageURL; }
ModelRefPropertyConnector.THIS_PROPERTY, ((ICompositeTreeLevelDescriptor) rootDescriptor) .getNodeGroupDescriptor().getRenderedProperty()); List<ICollectionConnectorProvider> subtreeConnectors = new ArrayList<ICollectionConnectorProvider>(); if (((ICompositeTreeLevelDescriptor) rootDescriptor) ModelRefPropertyConnector.THIS_PROPERTY, ((ISimpleTreeLevelDescriptor) rootDescriptor) .getNodeGroupDescriptor().getRenderedProperty()); if (((ISimpleTreeLevelDescriptor) rootDescriptor).getChildDescriptor() != null) { ICollectionConnectorProvider subtreeConnector = createNodeGroupConnector(
viewDescriptor.getRootSubtreeDescriptor(), getDescriptorPathFromConnectorTreePath(path)) .getNodeGroupDescriptor().getIconImageURL(), IIconFactory.SMALL_ICON_SIZE);
private ICollectionConnectorProvider createCompositeNodeGroupConnector( ITreeViewDescriptor viewDescriptor, ICompositeTreeLevelDescriptor subtreeViewDescriptor, int depth) { ICollectionDescriptorProvider<?> nodeGroupModelDescriptor = ((ICollectionDescriptorProvider<?>) subtreeViewDescriptor .getNodeGroupDescriptor().getModelDescriptor()); IConfigurableCollectionConnectorListProvider nodeGroupPrototypeConnector = connectorFactory .createConfigurableCollectionConnectorListProvider( nodeGroupModelDescriptor.getName() + "Element", subtreeViewDescriptor.getNodeGroupDescriptor() .getRenderedProperty()); List<ICollectionConnectorProvider> subtreeConnectors = new ArrayList<ICollectionConnectorProvider>(); if (subtreeViewDescriptor.getChildrenDescriptors() != null && depth < viewDescriptor.getMaxDepth()) { for (ITreeLevelDescriptor childDescriptor : subtreeViewDescriptor .getChildrenDescriptors()) { ICollectionConnectorProvider childConnector = createNodeGroupConnector( viewDescriptor, childDescriptor, depth + 1); nodeGroupPrototypeConnector.addChildConnector(childConnector); subtreeConnectors.add(childConnector); } } nodeGroupPrototypeConnector .setCollectionConnectorProviders(subtreeConnectors); ICollectionConnector nodeGroupCollectionConnector = connectorFactory .createCollectionConnector(nodeGroupModelDescriptor.getName(), mvcBinder, nodeGroupPrototypeConnector); return nodeGroupCollectionConnector; }
viewDescriptor.getRootSubtreeDescriptor(), getDescriptorPathFromConnectorTreePath(path)) .getNodeGroupDescriptor().getIconImageURL(), IIconFactory.SMALL_ICON_SIZE); .getModel().getRoot(), (IValueConnector) value))) .getNodeGroupDescriptor(); String labelKey = nodeGroupDescriptor.getName(); if (labelKey == null) { labelKey = nodeGroupDescriptor.getModelDescriptor().getName(); labelText = nodeGroupDescriptor.getI18nName(getTranslationProvider(), locale); if (nodeGroupDescriptor.getDescription() != null) { toolTipText = nodeGroupDescriptor.getI18nDescription( getTranslationProvider(), locale) + TOOLTIP_ELLIPSIS;
ModelRefPropertyConnector.THIS_PROPERTY, ((ICompositeTreeLevelDescriptor) rootDescriptor) .getNodeGroupDescriptor().getRenderedProperty()); List<ICollectionConnectorProvider> subtreeConnectors = new ArrayList<ICollectionConnectorProvider>(); if (((ICompositeTreeLevelDescriptor) rootDescriptor) ModelRefPropertyConnector.THIS_PROPERTY, ((ISimpleTreeLevelDescriptor) rootDescriptor) .getNodeGroupDescriptor().getRenderedProperty()); if (((ISimpleTreeLevelDescriptor) rootDescriptor).getChildDescriptor() != null) { ICollectionConnectorProvider subtreeConnector = createNodeGroupConnector(
private ICollectionConnectorProvider createCompositeNodeGroupConnector( ITreeViewDescriptor viewDescriptor, ICompositeTreeLevelDescriptor subtreeViewDescriptor, int depth) { ICollectionDescriptorProvider<?> nodeGroupModelDescriptor = ((ICollectionDescriptorProvider<?>) subtreeViewDescriptor .getNodeGroupDescriptor().getModelDescriptor()); IConfigurableCollectionConnectorListProvider nodeGroupPrototypeConnector = connectorFactory .createConfigurableCollectionConnectorListProvider( nodeGroupModelDescriptor.getName() + "Element", subtreeViewDescriptor.getNodeGroupDescriptor() .getRenderedProperty()); List<ICollectionConnectorProvider> subtreeConnectors = new ArrayList<ICollectionConnectorProvider>(); if (subtreeViewDescriptor.getChildrenDescriptors() != null && depth < viewDescriptor.getMaxDepth()) { for (ITreeLevelDescriptor childDescriptor : subtreeViewDescriptor .getChildrenDescriptors()) { ICollectionConnectorProvider childConnector = createNodeGroupConnector( viewDescriptor, childDescriptor, depth + 1); nodeGroupPrototypeConnector.addChildConnector(childConnector); subtreeConnectors.add(childConnector); } } nodeGroupPrototypeConnector .setCollectionConnectorProviders(subtreeConnectors); ICollectionConnector nodeGroupCollectionConnector = connectorFactory .createCollectionConnector(nodeGroupModelDescriptor.getName(), mvcBinder, nodeGroupPrototypeConnector); return nodeGroupCollectionConnector; }
private ICollectionConnectorProvider createCompositeNodeGroupConnector( ITreeViewDescriptor viewDescriptor, ICompositeTreeLevelDescriptor subtreeViewDescriptor, int depth) { ICollectionDescriptorProvider<?> nodeGroupModelDescriptor = ((ICollectionDescriptorProvider<?>) subtreeViewDescriptor .getNodeGroupDescriptor().getModelDescriptor()); IConfigurableCollectionConnectorListProvider nodeGroupPrototypeConnector = connectorFactory .createConfigurableCollectionConnectorListProvider( nodeGroupModelDescriptor.getName() + "Element", subtreeViewDescriptor.getNodeGroupDescriptor() .getRenderedProperty()); List<ICollectionConnectorProvider> subtreeConnectors = new ArrayList<ICollectionConnectorProvider>(); if (subtreeViewDescriptor.getChildrenDescriptors() != null && depth < viewDescriptor.getMaxDepth()) { for (ITreeLevelDescriptor childDescriptor : subtreeViewDescriptor .getChildrenDescriptors()) { ICollectionConnectorProvider childConnector = createNodeGroupConnector( viewDescriptor, childDescriptor, depth + 1); nodeGroupPrototypeConnector.addChildConnector(childConnector); subtreeConnectors.add(childConnector); } } nodeGroupPrototypeConnector .setCollectionConnectorProviders(subtreeConnectors); ICollectionConnector nodeGroupCollectionConnector = connectorFactory .createCollectionConnector(nodeGroupModelDescriptor.getName(), mvcBinder, nodeGroupPrototypeConnector); return nodeGroupCollectionConnector; }
private IView<SComponent> createListView(IListViewDescriptor viewDescriptor, @SuppressWarnings("unused") IActionHandler actionHandler, @SuppressWarnings("unused") Locale locale) { ICollectionDescriptorProvider<?> modelDescriptor = ((ICollectionDescriptorProvider<?>) viewDescriptor .getModelDescriptor()); ICompositeValueConnector rowConnectorPrototype = connectorFactory .createCompositeValueConnector(modelDescriptor.getName() + "Element", viewDescriptor.getRenderedProperty()); ICollectionConnector connector = connectorFactory .createCollectionConnector(modelDescriptor.getName(), mvcBinder, rowConnectorPrototype); SList viewComponent = createSList(); SScrollPane scrollPane = createSScrollPane(); scrollPane.setViewportView(viewComponent); IView<SComponent> view = constructView(scrollPane, viewDescriptor, connector); if (viewDescriptor.getRenderedProperty() != null) { IValueConnector cellConnector = createColumnConnector(viewDescriptor .getRenderedProperty(), modelDescriptor.getCollectionDescriptor() .getElementDescriptor()); rowConnectorPrototype.addChildConnector(cellConnector); } viewComponent.setCellRenderer(new EvenOddListCellRenderer()); viewComponent.setModel(new CollectionConnectorListModel(connector)); listSelectionModelBinder.bindSelectionModel(connector, viewComponent .getSelectionModel(), null); return view; }
Locale locale) { ICollectionDescriptorProvider<?> modelDescriptor = (ICollectionDescriptorProvider<?>) viewDescriptor .getModelDescriptor(); ICompositeValueConnector rowConnectorPrototype = connectorFactory .createCompositeValueConnector(modelDescriptor.getName() + "Element", viewDescriptor.getRenderedProperty()); ICollectionConnector connector = connectorFactory .createCollectionConnector(modelDescriptor.getName(), mvcBinder, connector); if (viewDescriptor.getRenderedProperty() != null) { IValueConnector cellConnector = createColumnConnector(viewDescriptor .getRenderedProperty(), modelDescriptor.getCollectionDescriptor() .getElementDescriptor()); rowConnectorPrototype.addChildConnector(cellConnector);
private ICollectionConnectorProvider createSimpleNodeGroupConnector( ITreeViewDescriptor viewDescriptor, ISimpleTreeLevelDescriptor subtreeViewDescriptor, int depth) { ICollectionPropertyDescriptor<?> nodeGroupModelDescriptor = (ICollectionPropertyDescriptor<?>) subtreeViewDescriptor .getNodeGroupDescriptor().getModelDescriptor(); IConfigurableCollectionConnectorProvider nodeGroupPrototypeConnector = connectorFactory .createConfigurableCollectionConnectorProvider(nodeGroupModelDescriptor .getName() + "Element", subtreeViewDescriptor.getNodeGroupDescriptor() .getRenderedProperty()); if (subtreeViewDescriptor.getChildDescriptor() != null && depth < viewDescriptor.getMaxDepth()) { ICollectionConnectorProvider childConnector = createNodeGroupConnector( viewDescriptor, subtreeViewDescriptor.getChildDescriptor(), depth + 1); nodeGroupPrototypeConnector.addChildConnector(childConnector); nodeGroupPrototypeConnector .setCollectionConnectorProvider(childConnector); } ICollectionConnector nodeGroupCollectionConnector = connectorFactory .createCollectionConnector(nodeGroupModelDescriptor.getName(), mvcBinder, nodeGroupPrototypeConnector); return nodeGroupCollectionConnector; }
private ICollectionConnectorProvider createSimpleNodeGroupConnector( ITreeViewDescriptor viewDescriptor, ISimpleTreeLevelDescriptor subtreeViewDescriptor, int depth) { ICollectionPropertyDescriptor<?> nodeGroupModelDescriptor = (ICollectionPropertyDescriptor<?>) subtreeViewDescriptor .getNodeGroupDescriptor().getModelDescriptor(); IConfigurableCollectionConnectorProvider nodeGroupPrototypeConnector = connectorFactory .createConfigurableCollectionConnectorProvider(nodeGroupModelDescriptor .getName() + "Element", subtreeViewDescriptor.getNodeGroupDescriptor() .getRenderedProperty()); if (subtreeViewDescriptor.getChildDescriptor() != null && depth < viewDescriptor.getMaxDepth()) { ICollectionConnectorProvider childConnector = createNodeGroupConnector( viewDescriptor, subtreeViewDescriptor.getChildDescriptor(), depth + 1); nodeGroupPrototypeConnector.addChildConnector(childConnector); nodeGroupPrototypeConnector .setCollectionConnectorProvider(childConnector); } ICollectionConnector nodeGroupCollectionConnector = connectorFactory .createCollectionConnector(nodeGroupModelDescriptor.getName(), mvcBinder, nodeGroupPrototypeConnector); return nodeGroupCollectionConnector; }