Class ModuleFolder


  • public class ModuleFolder
    extends java.lang.Object
    The module folder is a separate directory in the module project that stores property containers in files with a predefined file extension, and that only has directories with names that end with the same file extension (in order not to have name collision with properties, i.e. you cannot have the file a.iiziPanel and a directory with the same name in a single directory).
    Author:
    Christopher Mindus
    • Field Summary

      Fields 
      Modifier and TypeFieldDescription
      intcategory
      The Common Navigator category of the module folder.
      java.lang.Stringdescription
      The description of the folder, displayed in the status bar in Eclipse when the folder is selected.
      java.lang.Stringextension
      The file extension used, including the '.'.
      org.eclipse.jface.resource.ImageDescriptorfolderImageDescriptor
      The image for the folder.
      booleanisAssets
      Flag indicating it's the Assets folder.
      org.eclipse.jface.resource.ImageDescriptoritemImageDescriptor
      The image for the items.
      java.lang.StringitemTitle
      The item title (e.g.
      java.lang.Stringname
      The name of the folder, used for directory and property name.
      java.lang.Stringtitle
      The title for the folder, displayed in the iizi Explorer.
    • Field Detail

      • name

        public final java.lang.String name
        The name of the folder, used for directory and property name.
      • title

        public final java.lang.String title
        The title for the folder, displayed in the iizi Explorer.
      • description

        public final java.lang.String description
        The description of the folder, displayed in the status bar in Eclipse when the folder is selected.
      • folderImageDescriptor

        public final org.eclipse.jface.resource.ImageDescriptor folderImageDescriptor
        The image for the folder.
      • itemTitle

        public final java.lang.String itemTitle
        The item title (e.g. "Panel").
      • itemImageDescriptor

        public final org.eclipse.jface.resource.ImageDescriptor itemImageDescriptor
        The image for the items.
      • extension

        public final java.lang.String extension
        The file extension used, including the '.'.
      • isAssets

        public final boolean isAssets
        Flag indicating it's the Assets folder.
      • category

        public final int category
        The Common Navigator category of the module folder.
    • Method Detail

      • getModuleFolder

        public static ModuleFolder getModuleFolder​(java.util.ArrayList<DesignerProp> list)
        Gets the Module Folder used for the selected properties. This method returns null when properties of different modules are selected, or if the root or module folder are selected.
        Parameters:
        list - The selected properties.
        Returns:
        The ModuleFolder for the properties, or null if no such can be set.
      • getFolderSettingsSetup

        public PropertyEditorSetup getFolderSettingsSetup()
        Gets the folder settings setup.
        Returns:
        The setup for folder settings, null for none.
      • addAcceptedBaseProperty

        public void addAcceptedBaseProperty​(java.lang.Class<? extends PropCnr> propertyClass)
        Adds an accepted class for base properties as files in this folder.
        Parameters:
        propertyClass - The property class.
      • isPropertyClassAccepted

        public boolean isPropertyClassAccepted​(IGProp<?> property)
        Checks if a property class instance is accepted.
      • getModuleModel

        public ModuleModel getModuleModel()
        Gets the Module Model.
        Returns:
        The module model.
      • getProject

        public org.eclipse.core.resources.IProject getProject()
        Gets the project.
        Returns:
        The project.
      • getDirectory

        public org.eclipse.core.resources.IFolder getDirectory()
        Gets the IFolder for the folder root directory.
      • getDirectoryPath

        public java.lang.String getDirectoryPath()
        Gets the directory path relative the project, ending with '/'.
      • getFolderImage

        public org.eclipse.swt.graphics.Image getFolderImage()
        Gets the folder image.
      • getItemImage

        public org.eclipse.swt.graphics.Image getItemImage()
        Gets the item image.
      • isFolderPath

        public boolean isFolderPath​(java.lang.String path)
        Checks if a project-relative path is in this folder.
      • getPropertyFromResource

        public ResourceDesignerProp getPropertyFromResource​(org.eclipse.core.resources.IResource resource)
        Gets a property from a resource located or was located under this folder.
        Parameters:
        resource - The resource.
        Returns:
        null if not found.
      • getCNChildren

        public java.lang.Object[] getCNChildren()
        Gets the children for the content provider tree viewer for this folder. It's just one: the container.
      • createFilter

        public org.eclipse.jface.viewers.ViewerFilter createFilter()
        Creates a viewer filter only displaying items of this folder.