Search in sources :

Example 11 with DefaultGalleryGroupRenderer

use of org.netxms.nebula.widgets.gallery.DefaultGalleryGroupRenderer in project netxms by netxms.

the class ImageSelectionDialog method createDialogArea.

/* (non-Javadoc)
	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
	 */
@Override
protected Control createDialogArea(Composite parent) {
    Composite dialogArea = (Composite) super.createDialogArea(parent);
    final FillLayout layout = new FillLayout();
    dialogArea.setLayout(layout);
    gallery = new Gallery(dialogArea, SWT.V_SCROLL);
    DefaultGalleryGroupRenderer galleryGroupRenderer = new DefaultGalleryGroupRenderer();
    galleryGroupRenderer.setMinMargin(2);
    galleryGroupRenderer.setItemHeight(48);
    galleryGroupRenderer.setItemWidth(48);
    galleryGroupRenderer.setAutoMargin(true);
    galleryGroupRenderer.setAlwaysExpanded(true);
    gallery.setGroupRenderer(galleryGroupRenderer);
    DefaultGalleryItemRenderer itemRenderer = new DefaultGalleryItemRenderer();
    gallery.setItemRenderer(itemRenderer);
    gallery.addSelectionListener(this);
    gallery.addMouseListener(this);
    ImageProvider.getInstance(getShell().getDisplay()).addUpdateListener(this);
    refreshImages();
    return dialogArea;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) Gallery(org.netxms.nebula.widgets.gallery.Gallery) DefaultGalleryGroupRenderer(org.netxms.nebula.widgets.gallery.DefaultGalleryGroupRenderer) FillLayout(org.eclipse.swt.layout.FillLayout) DefaultGalleryItemRenderer(org.netxms.nebula.widgets.gallery.DefaultGalleryItemRenderer)

Aggregations

DefaultGalleryGroupRenderer (org.netxms.nebula.widgets.gallery.DefaultGalleryGroupRenderer)11 DefaultGalleryItemRenderer (org.netxms.nebula.widgets.gallery.DefaultGalleryItemRenderer)10 Gallery (org.netxms.nebula.widgets.gallery.Gallery)10 GalleryItem (org.netxms.nebula.widgets.gallery.GalleryItem)5 IOException (java.io.IOException)2 SWTException (org.eclipse.swt.SWTException)2 FillLayout (org.eclipse.swt.layout.FillLayout)2 NXCException (org.netxms.client.NXCException)2 Action (org.eclipse.jface.action.Action)1 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)1 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)1 MenuDetectEvent (org.eclipse.swt.events.MenuDetectEvent)1 MenuDetectListener (org.eclipse.swt.events.MenuDetectListener)1 Composite (org.eclipse.swt.widgets.Composite)1 LibraryImage (org.netxms.client.LibraryImage)1 RefreshAction (org.netxms.ui.eclipse.actions.RefreshAction)1 ImagePropertiesDialog (org.netxms.ui.eclipse.imagelibrary.dialogs.ImagePropertiesDialog)1