📄 codecompletionconfig.java
字号:
package org.jawin.browser.codecompletion;
import org.jawin.browser.xml.Encoder;
/**
* <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 class CodeCompletionConfig
{
private String name = null;
private String code = null;
private String cleanCode = null;
public CodeCompletionConfig(String newName, String newCode)
{
setName(newName);
setCode(newCode);
}
/**
* Sets the value of name
* @param newName the new value of name
*/
public void setName(String newName)
{
name = newName;
}
/**
* Returns the value of name
* @return the value of name
*/
public String getName()
{
return name;
}
/**
* Sets the value of code
* @param newCode the new code value for this code completion
*/
public void setCode(String newCode)
{
if (newCode == null)
{
code = "";
}
else
{
code = newCode;
}
setCleanCode();
}
private void setCleanCode()
{
int index = code.indexOf("|");
if (index == -1)
{
cleanCode = code;
}
else
{
cleanCode = code.substring(0, index) + code.substring(index + 1, code.length());
}
}
/**
* Returns the code to use for this completion event
* @return the value of code
*/
public String getCode()
{
return code;
}
public String toString()
{
return name;
}
public int getOffset()
{
int offset = code.indexOf("|");
if (offset == -1)
{
return 0;
}
else
{
return offset;
}
}
/**
* Get the code minus the first | if one exists, used for
* actually putting into the document
*/
public String getCleanCode()
{
return cleanCode;
}
public void toXML(StringBuffer buffer)
{
buffer.append("\t<item name=\"");
Encoder.encode(name, buffer);
buffer.append("\">");
Encoder.encode(code, buffer);
buffer.append("</item>\n");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -