對於Visual Studio的宏
支持環境
使用JBuilder編譯時需要在 Project
Manifest
OpenTools
不需要什麼詳細的講解
/*===============================================
文件一
===============================================*/
/**
*
Title: JBuilder IDE Toolbox
*
Description: ?user_name=ghost
*
Copyright: Copyright (c)
*
Company: Ghost Studio
* @author 阿鬼 []
* @version
*/
import com
import com
import com
import javax
public class IDEActions
{
private static final String STRING_ActionGroupName =
public static final EditorContextActionProvider CONTEXTMENU_ActionProvider = new EditorContextActionProvider()
{
public Action getContextAction(EditorPane target)
{
ActionGroup actionGroup = new ActionGroup();
ActionGroup actionSubGroup = new ActionGroup(STRING_ActionGroupName);
actionSubGroup
// 此處可以增加更多的功能
//
actionGroup
return actionGroup;
}
public int getPriority()
{
return
}
};
public IDEActions()
{
}
static class ction
implements EditorContextActionProvider
{
public Action getContextAction(EditorPane target)
{
ActionGroup actionGroup = new ActionGroup();
ActionGroup actionSubGroup = new ActionGroup(STRING_ActionGroupName);
actionSubGroup
actionGroup
return actionGroup;
}
public int getPriority()
{
return
}
ction()
{
}
}
}
/*===============================================
文件二
===============================================*/
/**
*
Title: JBuilder IDE Toolbox
*
Description: ?user_name=ghost
*
Copyright: Copyright (c)
*
Company: Ghost Studio
* @author 阿鬼 []
* @version
*/
import com
import com
import com
import com
import com
import com
import com
import com
import java
import java
import java
import java
import java
import javax
import javax
import javax
public class JavaCommentSwitch extends EditorAction
implements PropertyChangeListener
{
private static final String versionString =
public static EditorAction ACTION_CreateJavaCommentSwitch = new JavaCommentSwitch(
protected static String STR_LONG_DESCRIPTION =
protected static String STR_SHORT_DESCRIPTION =
public static EditorAction ACTION_GenerateJavaCommentSwitch = new JavaCommentSwitch(
protected static String MENU_STR_LONG_DESCRIPTION =
protected static String MENU_STR_SHORT_DESCRIPTION =
static Browser browser = null;
private EditorPane target;
private String errorMessageText;
private boolean isMenuAction;
public JavaCommentSwitch(String name)
{
super(name);
target = null;
errorMessageText =
isMenuAction = false;
}
public JavaCommentSwitch(String name
{
super(name);
target = null;
errorMessageText =
this
}
public static void initOpenTool(byte majorVersion
{
if(majorVersion <
return;
EditorManager
ACTION_GenerateJavaCommentSwitch
ACTION_GenerateJavaCommentSwitch
EditorActions
ACTION_CreateJavaCommentSwitch
ACTION_CreateJavaCommentSwitch
Keymap keymap = EditorManager
if(keymap != null)
{
KeyStroke stroke[] = keymap
if(stroke == null)
keymap
java
}
EditorManager
}
public void actionPerformed(ActionEvent evt)
{
target = getEditorTarget(evt);
Node theNode = getNode();
if(theNode == null)
return;
JBProject proj = (JBProject)theNode
JotClass theClass = getClass(theNode);
if(isMenuAction)
if(theClass != null)
runJavaCommentSwitch();
else
JOptionPane
}
/**
* @description
*
* @param
* @return
* @exception
*/
private boolean runJavaCommentSwitch()
{
String selection = target
String newSelection =
// 去掉注釋
if(selection
{
StringBuffer sb = new StringBuffer(selection);
newSelection = sb
}
// 添加注釋
else
{
newSelection = String
}
target
return true;
}
public void propertyChange(PropertyChangeEvent evt)
{
String propertyName = evt
if(propertyName
{
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19468.html