?? titlepositioneditor.java
字號:
package com.horstmann.corejava;
import java.beans.*;
import java.util.*;
/**
* A custom editor for the titlePosition property of the ChartBean. The editor lets the user choose
* between Left, Center, and Right
* @version 1.20 2007-12-14
* @author Cay Horstmann
*/
public class TitlePositionEditor extends PropertyEditorSupport
{
public String[] getTags()
{
return tags;
}
public String getJavaInitializationString()
{
return ChartBean.Position.class.getName().replace('$', '.') + "." + getValue();
}
public String getAsText()
{
int index = ((ChartBean.Position) getValue()).ordinal();
return tags[index];
}
public void setAsText(String s)
{
int index = Arrays.asList(tags).indexOf(s);
if (index >= 0) setValue(ChartBean.Position.values()[index]);
}
private String[] tags = { "Left", "Center", "Right" };
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -