Class ControlUtils

java.lang.Object
de.edgesoft.edgeutils.javafx.ControlUtils

public class ControlUtils
extends java.lang.Object
Utilities for Controls.

See comment for MenuItemUtils and TabUtils.

When trying Kotlin, all static methods are candidates for extending the button class.

Legal stuff

Copyright 2010-2020 Ekkart Kleinod ekleinod@edgesoft.de

This file is part of edgeutils.

edgeutils is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

edgeutils is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with edgeutils. If not, see http://www.gnu.org/licenses/.

Since:
0.13.0
Author:
Ekkart Kleinod
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.util.Map<java.lang.Class<? extends javafx.scene.control.Control>,​java.lang.String> PREFIXES
    Variable name prefixes.
  • Constructor Summary

    Constructors 
    Constructor Description
    ControlUtils()  
  • Method Summary

    Modifier and Type Method Description
    static void fillViewControl​(javafx.scene.control.Control theControl, java.lang.Object theController, int theSize, ResourceType... theResourceTypes)
    Fills control with graphic (given size), text, and tooltip.
    static void fillViewControl​(javafx.scene.control.Control theControl, java.lang.Object theController, ResourceType... theResourceTypes)
    Fills control with graphic (default size), text, and tooltip.
    static void fillViewControl​(javafx.scene.control.Control theControl, java.lang.String theAdditionalId, java.lang.Object theController, int theSize, ResourceType... theResourceTypes)
    Fills control with graphic (given size), text, and tooltip.
    static void fillViewControl​(javafx.scene.control.Control theControl, java.lang.String theAdditionalId, java.lang.Object theController, ResourceType... theResourceTypes)
    Fills control with graphic (default size), text, and tooltip.
    static void fillViewControls​(ResourceType theResourceType, java.lang.Object theController, javafx.scene.control.Control... theControls)
    Fills controls with specific resource type.
    static java.lang.String getIdWithoutPrefix​(javafx.scene.control.Control theControl)
    Returns id without prefix from control with ID.
    static java.lang.String getIdWithoutPrefix​(javafx.scene.control.Control theControl, java.lang.String theAdditionalId)
    Returns id without prefix from control with ID.
    static java.lang.String removePrefix​(java.lang.String theID, java.lang.String thePrefix)
    Removes prefix from ID.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PREFIXES

      public static final java.util.Map<java.lang.Class<? extends javafx.scene.control.Control>,​java.lang.String> PREFIXES
      Variable name prefixes.
  • Constructor Details

  • Method Details

    • fillViewControl

      public static void fillViewControl​(javafx.scene.control.Control theControl, java.lang.Object theController, ResourceType... theResourceTypes)
      Fills control with graphic (default size), text, and tooltip. One could use Labeled instead of Control but my hope is, that MenuItems someday will be at least Controls and thus can be filled within this class.
      Parameters:
      theControl - control to fill
      theController - view controller
      theResourceTypes - resource types
    • fillViewControl

      public static void fillViewControl​(javafx.scene.control.Control theControl, java.lang.String theAdditionalId, java.lang.Object theController, ResourceType... theResourceTypes)
      Fills control with graphic (default size), text, and tooltip. One could use Labeled instead of Control but my hope is, that MenuItems someday will be at least Controls and thus can be filled within this class.
      Parameters:
      theControl - control to fill
      theAdditionalId - additional id (null for none)
      theController - view controller
      theResourceTypes - resource types
    • fillViewControl

      public static void fillViewControl​(javafx.scene.control.Control theControl, java.lang.Object theController, int theSize, ResourceType... theResourceTypes)
      Fills control with graphic (given size), text, and tooltip.
      Parameters:
      theControl - control to fill
      theController - view controller
      theSize - size of the icon
      theResourceTypes - resource types
    • fillViewControl

      public static void fillViewControl​(javafx.scene.control.Control theControl, java.lang.String theAdditionalId, java.lang.Object theController, int theSize, ResourceType... theResourceTypes)
      Fills control with graphic (given size), text, and tooltip. One could use Labeled instead of Control but my hope is, that MenuItems someday will be at least Controls and thus can be filled within this class.
      Parameters:
      theControl - control to fill
      theAdditionalId - additional id (null for none)
      theController - view controller
      theSize - size of the icon
      theResourceTypes - resource types (optional)
    • getIdWithoutPrefix

      public static java.lang.String getIdWithoutPrefix​(javafx.scene.control.Control theControl)
      Returns id without prefix from control with ID.
      Parameters:
      theControl - control with id
      Returns:
      id without prefix
    • getIdWithoutPrefix

      public static java.lang.String getIdWithoutPrefix​(javafx.scene.control.Control theControl, java.lang.String theAdditionalId)
      Returns id without prefix from control with ID.
      Parameters:
      theControl - control with id
      theAdditionalId - additional id (null for none)
      Returns:
      id without prefix
    • fillViewControls

      public static void fillViewControls​(ResourceType theResourceType, java.lang.Object theController, javafx.scene.control.Control... theControls)
      Fills controls with specific resource type.
      Parameters:
      theResourceType - resource type
      theController - view controller
      theControls - control to fill
    • removePrefix

      public static java.lang.String removePrefix​(java.lang.String theID, java.lang.String thePrefix)
      Removes prefix from ID.
      Parameters:
      theID - id with prefix
      thePrefix - prefix
      Returns:
      id without prefix