
com.katalon.platform.api.extension.ToolItemWithMenuDescription Maven / Gradle / Ivy
package com.katalon.platform.api.extension;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
/**
* ToolItemWithMenuDescription is the interface of com.katalon.platform.api.extension.newToolItem
* extension point that allows client plugins can put a dropdown tool item on KS main toolbar.
*
* Register in the plugin.xml
like this:
*
*
* {@code
*
*
*
* }
*
*
* The implementationClass is the full qualified name of the class that implements ToolItemWithMenuDescription.
*
* @since 1.0.4
*
*/
public interface ToolItemWithMenuDescription {
/**
* Id of the extension point
*/
String NEW_TOOLITEM_WITH_MENU_EXTENSION_POINT_ID = "com.katalon.platform.api.extension.newDropdownToolItem";
/**
* @return Id of the extension tool item
*/
String toolItemId();
String name();
/**
* The platform URI point to the icon with this format:
* {@code platform:///}.
*
* For example: {@code platform://com.example.my-plugin-id/icons/sample_32x24.png} then:
*
com.example.my-plugin-id is the plugin id
*
icons/sample_32x24.png is the path to icon under src/main/resources/icons folder
*
* The icon is recommend size of 32x24. If the exact size isn't provided, this scaling can cause the icon to lose
* detail or look fuzzy.
* Optional: We also recommend to put 2x, 3x, and large scale images with suffix {@literal @2x, @3x, @4x} likes:
* {@literal [email protected], [email protected], [email protected]} to display better on high resolution
* display.
*
* Icons are recommended to be put in {@code src/main/resources/icons/} folder
*
* @return the platform URI point to the icon
* @since 1.0.4
*/
String iconUrl();
/**
* Returns a menu that will be shows when use click on arrow of the tool item.
*
* @param parent parent control of the menu
* @return a menu
*/
Menu getMenu(Control parent);
/**
* Handle the selection event on the item
*
* @since 1.0.4
*/
default void defaultEventHandler() {
}
/**
*
* @return true if icon is enabled. Otherwise, false
* @since 1.0.4
*/
default boolean isItemEnabled() {
return true;
}
}