Browse Source
* commit '4d8a43ba7fa639f65fc9575cc18a5bd38b86941f': (21 commits) 1 冲突 冲突 代码规范 修改一些规范问题 他装了插件后, 可以设置显示或者不显示 装了插件后, 可以设置显示或者不显示 装了插件后, 可以设置显示或者不显示 去掉qq帮助,并在关于软件中显示qq号码,冻结时给提示 执行 表单交互统一测试bug修改 1.从toolbarbtn上拖下tab布局后当前的选中对象并非顶层布局 2.tab布局顶层布局的名字修改为tablayout 3.支持tab布局的嵌套后正确显示编辑层 有自定义按钮后, web属性工具栏设置保存不上. sonar配置 bug 圖標 modified: ../columnrow/ColumnRowPane.java modified: ../columnrow/ColumnRowPane.java new file: FillBugSpinner.java update 超链顺序 ...master
superman
8 years ago
26 changed files with 692 additions and 79 deletions
@ -0,0 +1,20 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.designer.creator.CRPropertyDescriptor; |
||||
import com.fr.stable.fun.mark.Immutable; |
||||
|
||||
/** |
||||
* Created by zpc on 16/7/21. |
||||
*/ |
||||
public interface ParameterWindowEditorProcessor extends Immutable { |
||||
|
||||
String MARK_STRING = "ParameterWindowEditorProcessor"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 生成属性表 |
||||
*/ |
||||
CRPropertyDescriptor[] createPropertyDescriptor(Class<?> temp); |
||||
} |
||||
|
@ -0,0 +1,31 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.designer.creator.CRPropertyDescriptor; |
||||
import com.fr.design.fun.ParameterWindowEditorProcessor; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
|
||||
/** |
||||
* Created by zpc on 2016/7/21. |
||||
*/ |
||||
@API(level = ParameterWindowEditorProcessor.CURRENT_LEVEL) |
||||
public abstract class AbstractParameterWindowEditorProcessor implements ParameterWindowEditorProcessor { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
public int layerIndex() { |
||||
return DEFAULT_LAYER_INDEX; |
||||
} |
||||
|
||||
|
||||
|
||||
/** |
||||
* 生成属性表 |
||||
*/ |
||||
@Override |
||||
public CRPropertyDescriptor[] createPropertyDescriptor(Class<?> temp) { |
||||
return new CRPropertyDescriptor[0]; |
||||
} |
||||
} |
@ -0,0 +1,123 @@
|
||||
package com.fr.design.gui.ispinner; |
||||
|
||||
import java.text.ParseException; |
||||
import java.util.List; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.JFormattedTextField; |
||||
import javax.swing.JSpinner; |
||||
import javax.swing.SpinnerDateModel; |
||||
import javax.swing.SpinnerListModel; |
||||
import javax.swing.SpinnerModel; |
||||
import javax.swing.SpinnerNumberModel; |
||||
import javax.swing.text.AttributeSet; |
||||
import javax.swing.text.BadLocationException; |
||||
import javax.swing.text.DefaultFormatterFactory; |
||||
import javax.swing.text.DocumentFilter; |
||||
|
||||
import com.fr.stable.StableUtils; |
||||
//_kerry: 用来修复Spinner输入数字自动填充的bug
|
||||
public class ColumnRowSpinner extends UIBasicSpinner { |
||||
public ColumnRowSpinner(SpinnerModel model) { |
||||
super(model); |
||||
} |
||||
|
||||
protected JComponent createEditor(SpinnerModel model) { |
||||
if (model instanceof SpinnerDateModel) { |
||||
return new DateEditor(this); |
||||
} else if (model instanceof SpinnerListModel) { |
||||
return new FillBugEditor(this); |
||||
} else if (model instanceof SpinnerNumberModel) { |
||||
return new NumberEditor(this); |
||||
} else { |
||||
return new DefaultEditor(this); |
||||
} |
||||
} |
||||
|
||||
private class FillBugEditor extends DefaultEditor { |
||||
public FillBugEditor(JSpinner spinner) { |
||||
super(spinner); |
||||
if (!(spinner.getModel() instanceof SpinnerListModel)) { |
||||
throw new IllegalArgumentException( |
||||
"model not a SpinnerListModel"); |
||||
} |
||||
getTextField().setEditable(true); |
||||
getTextField().setFormatterFactory( |
||||
new DefaultFormatterFactory(new ListFormatter())); |
||||
} |
||||
|
||||
public SpinnerListModel getModel() { |
||||
return (SpinnerListModel) (getSpinner().getModel()); |
||||
} |
||||
|
||||
private class ListFormatter extends |
||||
JFormattedTextField.AbstractFormatter { |
||||
private DocumentFilter filter; |
||||
|
||||
public String valueToString(Object value) throws ParseException { |
||||
if (value == null) { |
||||
return ""; |
||||
} |
||||
return value.toString(); |
||||
} |
||||
|
||||
public Object stringToValue(String string) |
||||
throws ParseException { |
||||
//add将行数转换成ABC
|
||||
return string; |
||||
} |
||||
|
||||
protected DocumentFilter getDocumentFilter() { |
||||
if (filter == null) { |
||||
filter = new Filter(); |
||||
} |
||||
return filter; |
||||
} |
||||
|
||||
private class Filter extends DocumentFilter { |
||||
public void replace(FilterBypass fb, int offset, |
||||
int length, String string, AttributeSet attrs) |
||||
throws BadLocationException { |
||||
if (string != null |
||||
&& (offset + length) == fb.getDocument() |
||||
.getLength()) { |
||||
List list = getModel().getList(); |
||||
Object next = null; |
||||
for (int counter = 0; counter < list.size(); counter++) { |
||||
Object value = list.get(counter); |
||||
String str = value.toString(); |
||||
|
||||
if (str != null |
||||
&& str.startsWith(fb.getDocument() |
||||
.getText(0, offset) |
||||
+ string)) { |
||||
next = value; |
||||
break; |
||||
} |
||||
} |
||||
|
||||
String value = (next != null) ? next.toString() |
||||
: null; |
||||
|
||||
if (value != null) { |
||||
fb.remove(0, offset + length); |
||||
fb.insertString(0, value, null); |
||||
getFormattedTextField().select( |
||||
offset + string.length(), |
||||
value.length()); |
||||
return; |
||||
} |
||||
} |
||||
super.replace(fb, offset, length, string, attrs); |
||||
} |
||||
|
||||
public void insertString(FilterBypass fb, int offset, |
||||
String string, AttributeSet attr) |
||||
throws BadLocationException { |
||||
replace(fb, offset, 0, string, attr); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue