Package org.locationtech.udig.omsbox.core

Examples of org.locationtech.udig.omsbox.core.ModuleDescription


            public Image getImage( Object element ) {
                if (element instanceof ViewerFolder) {
                    return ImageCache.getInstance().getImage(ImageCache.CATEGORY);
                }
                if (element instanceof ViewerModule) {
                    ModuleDescription md = ((ViewerModule) element).getModuleDescription();
                    Status status = md.getStatus();
                    if (status == Status.experimental) {
                        return ImageCache.getInstance().getImage(ImageCache.MODULEEXP);
                    } else {
                        return ImageCache.getInstance().getImage(ImageCache.MODULE);
                    }
                }
                return null;
            }

            public String getText( Object element ) {
                if (element instanceof ViewerFolder) {
                    ViewerFolder categoryFolder = (ViewerFolder) element;
                    return categoryFolder.getName();
                }
                if (element instanceof ViewerModule) {
                    ModuleDescription module = ((ViewerModule) element).getModuleDescription();
                    return module.getName().replaceAll("\\_\\_", ".");
                }
                return ""; //$NON-NLS-1$
            }
        });

        modulesViewer.addSelectionChangedListener(new ISelectionChangedListener(){

            public void selectionChanged( SelectionChangedEvent event ) {
                if (!(event.getSelection() instanceof IStructuredSelection)) {
                    return;
                }
                IStructuredSelection sel = (IStructuredSelection) event.getSelection();

                Object selectedItem = sel.getFirstElement();
                if (selectedItem == null) {
                    // unselected, show empty panel
                    putUnselected();
                    return;
                }

                if (selectedItem instanceof ViewerModule) {
                    ModuleDescription currentSelectedModule = ((ViewerModule) selectedItem).getModuleDescription();
                    currentSelectedModuleGui = new ModuleGui(currentSelectedModule);

                    Control control = currentSelectedModuleGui.makeGui(modulesGuiComposite, false);

                    // Label dummyLabel = new Label(modulesGuiComposite, SWT.NONE);
View Full Code Here


        public boolean select( Viewer arg0, Object arg1, Object arg2 ) {
            if (arg2 instanceof ViewerFolder) {
                return true;
            }
            if (arg2 instanceof ViewerModule) {
                ModuleDescription md = ((ViewerModule) arg2).getModuleDescription();
                if (md.getStatus() == ModuleDescription.Status.experimental) {
                    return false;
                }
                return true;
            }
            return false;
View Full Code Here

TOP

Related Classes of org.locationtech.udig.omsbox.core.ModuleDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.