Package org.locationtech.udig.project.internal

Examples of org.locationtech.udig.project.internal.Folder


        if (parent != null) {
           
            if (parent instanceof Map) {
                getMap().getLegend().remove(folder);
            } else if (parent instanceof Folder) {
                final Folder parentFolder = (Folder) parent;
                parentFolder.getItems().remove(folder);
            }
        }
        // TODO - Save currently selected item
        // TODO - If currently selected item is folder, select next item
    }
View Full Code Here


        }
        return newFolderAction;
    }
   
    private void doNewFolderAction() {
        final Folder folder = ProjectFactory.eINSTANCE.createFolder();
        folder.setName(Messages.LegendView_new_folder_default_lbl);
        currentMap.sendCommandSync(new AddFolderItemCommand(folder));
        viewer.refresh();
    }
View Full Code Here

        // Gets the grid layers from the LegendItems list
        final List<Layer> layers = new ArrayList<Layer>();
        for (ILegendItem item : legendItems) {
            if (item instanceof Folder) {
                final Folder folder = (Folder) item;
                for (ILegendItem folderItem : folder.getItems()) {
                    if (folderItem instanceof LayerLegendItem) {
                        final LayerLegendItem layerItem = (LayerLegendItem) folderItem;
                        final Layer layer = layerItem.getLayer();
                        if (isGridLayer(layer)) {
                            layers.add(layer);
View Full Code Here

   
   
    @Override
    public Object[] getChildren( Object parentElement ) {
        if (parentElement instanceof Folder || parentElement instanceof IFolder) {
            final Folder folder = (Folder) parentElement;
            return folder.getItems().toArray();
        }
        return null;
    }
View Full Code Here

    }

    @Override
    public boolean hasChildren( Object element ) {
        if (element instanceof Folder || element instanceof IFolder) {
            final Folder folder = (Folder) element;
            if (folder.getItems().size() > 0) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

     */
    private void processRenameFolder() {

        final Runnable runnable = new Runnable() {
            public void run() {
                final Folder folder = (Folder) selection.getFirstElement();
                final InputDialog dialog = new InputDialog(Display.getDefault().getActiveShell(),
                        Messages.RenameFolderAction_dialogTitle,
                        Messages.RenameFolderAction_dialogMsg, folder.getName(), null);
                final int folderNameDialogResult = dialog.open();
                if (folderNameDialogResult == Dialog.OK) {
                    folder.setName(dialog.getValue());
                }
                viewer.refresh();
            }
        };

View Full Code Here

     * @param folder
     * @param layer
     * @return true if removed, otherwise false
     */
    private boolean removeLayerLegendItem(Folder folder, Layer layer) {
        Folder flaggedFolder = null;
        LayerLegendItem flaggedLayerItem = null;
        for (ILegendItem item : folder.getItems()) {
            if (item instanceof Folder) {
                final boolean isRemoved = removeLayerLegendItem((Folder) item, layer);
                if (isRemoved) {
                    return true;
                }
            } else if (item instanceof LayerLegendItem) {
                final LayerLegendItem layerItem = (LayerLegendItem) item;
                if (layer == layerItem.getLayer()) {
                    flaggedFolder = folder;
                    flaggedLayerItem = layerItem;
                    break;
                }
            }
        }
        if (flaggedLayerItem != null) {
            flaggedFolder.getItems().remove(flaggedLayerItem);
            return true;
        }
        return false;
    }
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case ProjectPackage.FOLDER: {
            Folder folder = (Folder) theEObject;
            T result = caseFolder(folder);
            if (result == null)
                result = caseIFolder(folder);
            if (result == null)
                result = caseLegendItem(folder);
View Full Code Here

        }
    }
   
    private static void updateCheckbox(final CheckboxTreeViewer viewer, final ILegendItem item) {
        if (item instanceof Folder) {
            final Folder folder = (Folder) item;
            updateCheckbox(viewer, folder);
        } else if (item instanceof LayerLegendItem) {
            final LayerLegendItem layerItem = (LayerLegendItem) item;
            updateCheckbox(viewer, layerItem);
        }
View Full Code Here

         *
         * @param msg
         */
        private void addListeners(Notification msg) {
            if (msg.getNewValue() instanceof Folder) {
                final Folder folder = (Folder) msg.getNewValue();
                folder.eAdapters().add(mapDeepListener);
            }
        }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.internal.Folder

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.