|
|
|
@ -26,12 +26,13 @@ import com.fr.general.ComparatorUtils;
|
|
|
|
|
public class WidgetPropertyTable extends AbstractPropertyTable { |
|
|
|
|
|
|
|
|
|
private FormDesigner designer; |
|
|
|
|
private static final int LEFT_COLUMN_WIDTH = 97; // "属性名"列的宽度
|
|
|
|
|
|
|
|
|
|
public WidgetPropertyTable(FormDesigner designer) { |
|
|
|
|
super(); |
|
|
|
|
setDesigner(designer); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static ArrayList<PropertyGroup> getCreatorPropertyGroup(FormDesigner designer, XCreator source) { |
|
|
|
|
ArrayList<PropertyGroup> groups = new ArrayList<PropertyGroup>(); |
|
|
|
|
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, source); |
|
|
|
@ -84,12 +85,21 @@ public class WidgetPropertyTable extends AbstractPropertyTable {
|
|
|
|
|
} |
|
|
|
|
TableModel model = new BeanTableModel(); |
|
|
|
|
setModel(model); |
|
|
|
|
this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); |
|
|
|
|
this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); |
|
|
|
|
TableColumn tc = this.getColumn(this.getColumnName(0)); |
|
|
|
|
tc.setPreferredWidth(30); |
|
|
|
|
tc.setMinWidth(LEFT_COLUMN_WIDTH); |
|
|
|
|
tc.setMaxWidth(LEFT_COLUMN_WIDTH); |
|
|
|
|
|
|
|
|
|
this.repaint(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void setRightColumnWidth(boolean automode) { |
|
|
|
|
int rightColumnWidth = this.getWidth() - LEFT_COLUMN_WIDTH; |
|
|
|
|
TableColumn tcRight = this.getColumn(this.getColumnName(1)); |
|
|
|
|
tcRight.setMinWidth(automode ? 0 : rightColumnWidth); |
|
|
|
|
tcRight.setMaxWidth(automode ? this.getWidth() : rightColumnWidth); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setDesigner(FormDesigner designer) { |
|
|
|
|
this.designer = designer; |
|
|
|
|
} |
|
|
|
@ -97,8 +107,8 @@ public class WidgetPropertyTable extends AbstractPropertyTable {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 单元格tooltip |
|
|
|
|
* 属性名悬浮提示 |
|
|
|
|
* |
|
|
|
|
* 属性名悬浮提示 |
|
|
|
|
* |
|
|
|
|
* @param 鼠标点击事件 |
|
|
|
|
* @return 单元格tooltip |
|
|
|
|
*/ |
|
|
|
@ -110,11 +120,18 @@ public class WidgetPropertyTable extends AbstractPropertyTable {
|
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void columnMarginChanged(javax.swing.event.ChangeEvent e) { |
|
|
|
|
setRightColumnWidth(false); |
|
|
|
|
super.columnMarginChanged(e); |
|
|
|
|
setRightColumnWidth(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 待说明 |
|
|
|
|
*/ |
|
|
|
|
public void firePropertyEdit() { |
|
|
|
|
designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|