⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 popupaction.java

📁 java 调用windows的api
💻 JAVA
字号:
package org.jawin.browser.popup;

import org.jawin.browser.data.BaseData;
import java.util.HashMap;
import javax.swing.ImageIcon;
import org.jawin.browser.image.ImageManager;

/**
 * A base class used for supporting XML configured menu items
 * for each BaseData implementation in the tree view.
 *
 * <p>Title: Jawin Code Generation GUI</p>
 * <p>Description: GUI for exploring type libraries and generating Java code</p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: Open Source Incentive</p>
 *
 * @author Josh Passenger
 * @version 1.0
 */

public abstract class PopupAction
{
	protected HashMap params = new HashMap();
	protected String display = null;

	/**
	 * Adds a new parameter to the params map
	 *
	 * @param key the key to use
	 * @param value the value to store
	 */
	public void addParam(String key, String value)
	{
		params.put(key, value);
	}

	/**
	 * Sets the value to display in the menu
	 *
	 * @param newDisplay the new vaue to display in the menu
	 */
	public void setDisplay(String newDisplay)
	{
		display = newDisplay;
	}

	/**
	 * Returns the value to display in the menu
	 * @return the current text to display in the menu
	 */
	public String getDisplay()
	{
		return display;
	}

	/**
	 * Return the value for the requested configuration parameter
	 * or null if it is not found
	 *
	 * @param key the key to find
	 * @return the value for this key
	 */
	public String getParam(String key)
	{
		return (String) params.get(key);
	}

	/**
	 * Checks to see if the requested key exists in the params map
	 *
	 * @param key the key to check
	 * @return true if the key exists, false if it does not
	 */
	public boolean paramExists(String key)
	{
		return params.containsKey(key);
	}

	/**
	 * Implementing classes must provide a meaningful implementation
	 * of this method.  This is fired when the action is selected in the
	 * tree, the node is right clicked on and this menu item is clicked on.
	 *
	 * @param target the currently selected base data object in the tree
	 */
	public abstract void performAction(BaseData target);

	/**
	 * Should this option be available for this base data node
	 * @param target the target node to check to see if this action should be available
	 * @return tryue if it should be available, false if not
	 */
	public abstract boolean shouldDisplay(BaseData target);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -