Destiny.Lin
1 month ago
17 changed files with 353 additions and 117 deletions
@ -1 +1,84 @@ |
|||||||
package com.fr.design.editor.editor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.ColumnRowGroup;
import java.awt.*;
/**
* Author : Shockway
* Date: 14-1-10
* Time: 下午1:46
*/
public class ColumnRowGroupEditor extends Editor<ColumnRowGroup> {
private UITextField crEditor;
public ColumnRowGroupEditor() {
this("");
}
public ColumnRowGroupEditor(String name) {
this(null, name);
}
public ColumnRowGroupEditor(ColumnRowGroup value) {
this(value, "");
}
public ColumnRowGroupEditor(ColumnRowGroup value, String name) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
crEditor = new UITextField();
this.add(crEditor, BorderLayout.CENTER);
this.setValue(value);
this.setName(name);
}
@Override
public ColumnRowGroup getValue() {
return new ColumnRowGroup(this.crEditor.getText());
}
@Override
public void setValue(ColumnRowGroup value) {
if (value == null) {
this.crEditor.setText("");
} else {
this.crEditor.setText(value.toString());
}
}
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
this.crEditor.setEnabled(enabled);
}
/**
* 获取焦点
*/
public void requestFocus() {
this.crEditor.requestFocus();
}
public String getIconName() {
return "cell_group";
}
/**
* 是否接收/支持这个对象
* @param object 检测对象
* @return 是否支持
*/
public boolean accept(Object object) {
return object instanceof ColumnRowGroup;
}
} |
package com.fr.design.editor.editor; |
||||||
|
|
||||||
|
import com.fr.design.gui.itextfield.UITextField; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.stable.ColumnRowGroup; |
||||||
|
|
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* 单元格组编辑 |
||||||
|
* |
||||||
|
* @author Shockway |
||||||
|
* @since 2014-01-10 |
||||||
|
* Created on 2024-01-10 |
||||||
|
*/ |
||||||
|
public class ColumnRowGroupEditor extends Editor<ColumnRowGroup> { |
||||||
|
|
||||||
|
private UITextField crEditor; |
||||||
|
|
||||||
|
public ColumnRowGroupEditor() { |
||||||
|
this(""); |
||||||
|
} |
||||||
|
|
||||||
|
public ColumnRowGroupEditor(String name) { |
||||||
|
this(null, name); |
||||||
|
} |
||||||
|
|
||||||
|
public ColumnRowGroupEditor(ColumnRowGroup value) { |
||||||
|
this(value, ""); |
||||||
|
} |
||||||
|
|
||||||
|
public ColumnRowGroupEditor(ColumnRowGroup value, String name) { |
||||||
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
|
crEditor = new UITextField(); |
||||||
|
this.add(crEditor, BorderLayout.CENTER); |
||||||
|
this.setValue(value); |
||||||
|
this.setName(name); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public ColumnRowGroup getValue() { |
||||||
|
return new ColumnRowGroup(this.crEditor.getText()); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void setValue(ColumnRowGroup value) { |
||||||
|
if (value == null) { |
||||||
|
this.crEditor.setText(""); |
||||||
|
} else { |
||||||
|
this.crEditor.setText(value.toString()); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void setEnabled(boolean enabled) { |
||||||
|
super.setEnabled(enabled); |
||||||
|
|
||||||
|
this.crEditor.setEnabled(enabled); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取焦点 |
||||||
|
*/ |
||||||
|
public void requestFocus() { |
||||||
|
this.crEditor.requestFocus(); |
||||||
|
} |
||||||
|
|
||||||
|
public String getIconName() { |
||||||
|
return "cell_group"; |
||||||
|
} |
||||||
|
|
||||||
|
public String getIconId() { |
||||||
|
return "cell_group_popup"; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否接收/支持这个对象 |
||||||
|
* @param object 检测对象 |
||||||
|
* @return 是否支持 |
||||||
|
*/ |
||||||
|
public boolean accept(Object object) { |
||||||
|
return object instanceof ColumnRowGroup; |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 985 B |
After Width: | Height: | Size: 1.0 KiB |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue