/** * Gets the icon of a component based on it's {@link ComponentDescriptor}. * * @param descriptor * @param newWidth * @return */ public static ImageIcon getDescriptorIcon(final ComponentDescriptor<?> descriptor, final int newWidth) { return getDescriptorIcon(descriptor, newWidth, false); }
public static String getImagePathForClass(final Class<?> cls) { return getImagePathForClass(cls, cls.getClassLoader()); }
@Override public Icon getIcon() { return IconUtils.getComponentCategoryIcon(_componentCategory, IconUtils.ICON_SIZE_MENU_ITEM); }
public static Icon getDescriptorIcon(final ComponentDescriptor<?> descriptor, final boolean configured, final int iconWidth) { if (descriptor instanceof HasIcon) { final ImageIcon imageIcon = getIconFromData(descriptor, iconWidth); if (imageIcon != null) { return imageIcon; } } final ImageIcon descriptorIcon = getDescriptorIcon(descriptor, iconWidth); if (configured) { return descriptorIcon; } return addErrorOverlay(descriptorIcon); }
.getTreeCellRendererComponent(tree, ((Datastore) value).getName(), selected, expanded, leaf, row, hasFocus); icon = IconUtils.getDatastoreIcon((Datastore) value, IconUtils.ICON_SIZE_MENU_ITEM); } else if (value instanceof Schema) { final Schema schema = ((Schema) value); component = _rendererDelegate .getTreeCellRendererComponent(tree, columnLabel, selected, expanded, leaf, row, hasFocus); icon = IconUtils.getColumnIcon(column, IconUtils.ICON_SIZE_MENU_ITEM); } else if (value instanceof ComponentSuperCategory) { final ComponentSuperCategory superCategory = (ComponentSuperCategory) value; .getTreeCellRendererComponent(tree, superCategory.getName(), selected, expanded, leaf, row, hasFocus); icon = IconUtils.getComponentSuperCategoryIcon(superCategory, IconUtils.ICON_SIZE_MENU_ITEM); } else if (value instanceof ComponentCategory) { final ComponentCategory category = (ComponentCategory) value; component = _rendererDelegate .getTreeCellRendererComponent(tree, category.getName(), selected, expanded, leaf, row, hasFocus); icon = IconUtils.getComponentCategoryIcon(category, IconUtils.ICON_SIZE_MENU_ITEM); } else if (value instanceof ComponentDescriptor<?>) { final ComponentDescriptor<?> descriptor = (ComponentDescriptor<?>) value; .getTreeCellRendererComponent(tree, descriptor.getDisplayName(), selected, expanded, leaf, row, hasFocus); icon = IconUtils.getDescriptorIcon(descriptor, IconUtils.ICON_SIZE_MENU_ITEM, false); } else if (value instanceof String) { if (LIBRARY_STRING.equals(value)) {
protected JComponent createComponentForColumn(final InputColumn<?> column) { if (column instanceof MutableInputColumn<?>) { final MutableInputColumn<?> mutableInputColumn = (MutableInputColumn<?>) column; return new MutableInputColumnListPanel(_analysisJobBuilder, mutableInputColumn, _columnTable); } final Icon icon = IconUtils.getColumnIcon(column, IconUtils.ICON_SIZE_MEDIUM); return new JLabel(column.getName(), icon, JLabel.LEFT); }
public static ImageIcon getComponentSuperCategoryIcon(final ComponentSuperCategory superCategory) { return getComponentSuperCategoryIcon(superCategory, ICON_SIZE_LARGE); }
private PopupButton createExistingDatastoresButton() { final PopupButton existingDatastoresButton = WidgetFactory.createDefaultPopupButton("Existing datastores", IconUtils.FILE_FOLDER); final JPopupMenu menu = existingDatastoresButton.getMenu(); final String[] datastoreNames = _datastoreCatalog.getDatastoreNames(); for (final String datastoreName : datastoreNames) { final Datastore datastore = _datastoreCatalog.getDatastore(datastoreName); final JMenuItem menuItem = WidgetFactory.createMenuItem(datastoreName, IconUtils.getDatastoreIcon(datastore, IconUtils.ICON_SIZE_MENU_ITEM)); menuItem.addActionListener(e -> _datastoreSelectedListener.datastoreSelected(datastore)); menu.add(menuItem); } return existingDatastoresButton; }
public static ImageIcon getComponentSuperCategoryIcon(final ComponentSuperCategory superCategory, final int newWidth) { final Class<? extends ComponentSuperCategory> superCategoryClass = superCategory.getClass(); return getCategoryIcon(superCategoryClass, false, newWidth); }
public static ImageIcon getTransparentIcon(final int width) { if (width == ICON_SIZE_SMALL) { return ICON_TRANSPARENT_SMALL; } if (width == ICON_SIZE_MEDIUM) { return ICON_TRANSPARENT_MEDIUM; } if (width == ICON_SIZE_LARGE) { return ICON_TRANSPARENT_LARGE; } return createTransparentIcon(width); }
private DCPanel createInputColumnPanel(final InputColumn<?> item) { final DCPanel panel = new DCPanel(); panel.setLayout(new BorderLayout()); panel.add(new JLabel(item.getName(), IconUtils.getColumnIcon(item, IconUtils.ICON_SIZE_SMALL), JLabel.LEFT), BorderLayout.CENTER); final JButton removeButton = WidgetFactory.createSmallButton(IconUtils.ACTION_REMOVE_DARK); removeButton.addActionListener(e -> removeInputColumn(item)); panel.add(removeButton, BorderLayout.EAST); _inputColumnPanels.put(item, panel); return panel; }
menu.setIcon(IconUtils.getComponentSuperCategoryIcon(superCategory, IconUtils.ICON_SIZE_MENU_ITEM)); menuBuilder.addItemsToMenu(menu); popup.add(menu);
icon = IconUtils.getDatastoreIcon(datastore, IconUtils.ICON_SIZE_SMALL); result.setText(datastore.getName()); } else if (value instanceof InputColumn<?>) {
public static ImageIcon getComponentCategoryIcon(final ComponentCategory category, final int newWidth) { final Class<? extends ComponentCategory> categoryClass = category.getClass(); return getCategoryIcon(categoryClass, true, newWidth); }
public static ImageIcon getDescriptorIcon(final ComponentDescriptor<?> descriptor) { return getDescriptorIcon(descriptor, ICON_SIZE_LARGE); }
@Override protected List<ConfiguredPropertyTaskPane> createPropertyTaskPanes() { final ConfiguredPropertyTaskPane taskPane1 = new ConfiguredPropertyTaskPane("Table to delete from", IconUtils.getImagePathForClass(UpdateTableAnalyzer.class), Arrays.asList(_datastoreProperty, _schemaNameProperty, _tableNameProperty, _bufferSizeProperty)); final ConfiguredPropertyTaskPane taskPane2 = new ConfiguredPropertyTaskPane("Delete condition", "images/model/column.png", Arrays.asList(_conditionInputColumnsProperty)); final ConfiguredPropertyTaskPane errorHandlingPane = new ConfiguredPropertyTaskPane("Error handling", IconUtils.STATUS_WARNING, Arrays.asList(_errorHandlingProperty, _errorFileLocationProperty, _additionalErrorLogValuesProperty), false); final List<ConfiguredPropertyTaskPane> propertyTaskPanes = new ArrayList<>(); propertyTaskPanes.add(taskPane1); propertyTaskPanes.add(taskPane2); propertyTaskPanes.add(errorHandlingPane); return propertyTaskPanes; }
public static Icon getColumnIcon(final InputColumn<?> column, final int iconSize) { if (column.isPhysicalColumn()) { return getColumnIcon(column.getPhysicalColumn(), iconSize); } return _imageManager.getImageIcon(MODEL_COLUMN, IconUtils.ICON_SIZE_SMALL); }
public static ImageIcon getComponentCategoryIcon(final ComponentCategory category) { return getComponentCategoryIcon(category, ICON_SIZE_LARGE); }
} else { _openJobButton.setEnabled(true); datastoreLabel.setIcon(IconUtils.getDatastoreIcon(datastore, IconUtils.ICON_SIZE_SMALL)); datastoreLabel.setToolTipText(null);
@Override public Icon getIcon() { return IconUtils.getDescriptorIcon(_descriptor, IconUtils.ICON_SIZE_MENU_ITEM, false); }