📄 lblstyleeditor.java
字号:
package chapter8;
import java.beans.*;
public class LblStyleEditor
extends PropertyEditorSupport
{
static String[] resourceStrings ={"英文标签","中文标签","数学标签",};
static int[] intValues ={0,1,2,};
static String[] sourceCodeStrings ={"RangeBean.EN_LABLE_STYLE",
"RangeBean.CN_LABLE_STYLE",
"RangeBean.MATH_LABLE_STYLE",};
public LblStyleEditor()
{
}
public String[] getTags()
{
return resourceStrings;
}
public String getJavaInitializationString()
{
Object value = getValue();
for (int i = 0; i < intValues.length; i++)
{
if (value.equals(new Integer(intValues[i])))
{
return sourceCodeStrings[i];
}
}
return null;
}
public String getAsText()
{
Object value = getValue();
for (int i = 0; i < intValues.length; i++)
{
if (value.equals(new Integer(intValues[i])))
{
return resourceStrings[i];
}
}
return null;
}
public void setAsText(String text)
throws IllegalArgumentException
{
for (int i = 0; i < resourceStrings.length; i++)
{
if (text.equals(resourceStrings[i]))
{
setValue(new Integer(intValues[i]));
return;
}
}
throw new IllegalArgumentException();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -