|
|
@ -6,6 +6,7 @@ import com.fr.config.predefined.PredefinedCellStyle; |
|
|
|
import com.fr.config.predefined.PredefinedCellStyleConfig; |
|
|
|
import com.fr.config.predefined.PredefinedCellStyleConfig; |
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.gui.NameInspector; |
|
|
|
import com.fr.design.gui.NameInspector; |
|
|
|
import com.fr.design.gui.controlpane.JListControlPane; |
|
|
|
import com.fr.design.gui.controlpane.JListControlPane; |
|
|
@ -15,6 +16,8 @@ import com.fr.design.gui.controlpane.ShortCut4JControlPane; |
|
|
|
import com.fr.design.gui.controlpane.UnrepeatedNameHelper; |
|
|
|
import com.fr.design.gui.controlpane.UnrepeatedNameHelper; |
|
|
|
import com.fr.design.gui.ilist.ListModelElement; |
|
|
|
import com.fr.design.gui.ilist.ListModelElement; |
|
|
|
import com.fr.design.gui.ilist.ModNameActionListener; |
|
|
|
import com.fr.design.gui.ilist.ModNameActionListener; |
|
|
|
|
|
|
|
import com.fr.design.gui.style.AlignmentPane; |
|
|
|
|
|
|
|
import com.fr.design.gui.style.FormatPane; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.mainframe.predefined.ui.detail.cell.CustomPredefinedStylePane; |
|
|
|
import com.fr.design.mainframe.predefined.ui.detail.cell.CustomPredefinedStylePane; |
|
|
@ -83,7 +86,15 @@ public class CellStyleListControlPane extends JListControlPane { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public NameableCreator[] createNameableCreators() { |
|
|
|
public NameableCreator[] createNameableCreators() { |
|
|
|
return new NameableCreator[]{new CellStyleNameObjectCreator(Toolkit.i18nText("Fine-Design_Predefined_Cell_New_Style"), |
|
|
|
return new NameableCreator[]{ |
|
|
|
|
|
|
|
new CellStyleNameObjectCreator(Toolkit.i18nText("Fine-Design_Predefined_Cell_New_Style"), |
|
|
|
|
|
|
|
PredefinedCellStyle.class, CustomPredefinedStylePaneNoBorder.class) { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean acceptDefaultNameObject(Object ob) { |
|
|
|
|
|
|
|
return ((PredefinedCellStyle) ob).isDefaultStyle(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
new CellStyleNameObjectCreator(Toolkit.i18nText("Fine-Design_Predefined_Cell_New_Style"), |
|
|
|
PredefinedCellStyle.class, CustomPredefinedStylePane.class)}; |
|
|
|
PredefinedCellStyle.class, CustomPredefinedStylePane.class)}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -113,13 +124,45 @@ public class CellStyleListControlPane extends JListControlPane { |
|
|
|
|
|
|
|
|
|
|
|
protected ShortCut4JControlPane[] createShortcuts() { |
|
|
|
protected ShortCut4JControlPane[] createShortcuts() { |
|
|
|
return new ShortCut4JControlPane[]{ |
|
|
|
return new ShortCut4JControlPane[]{ |
|
|
|
shortCutFactory.addItemShortCut(), |
|
|
|
createAddItemShortCut4JControlPane(), |
|
|
|
new RemoveItemShortCut4JControlPane(new RemoveItemAction()) |
|
|
|
new RemoveItemShortCut4JControlPane(new RemoveItemAction()) |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class RemoveItemShortCut4JControlPane extends ShortCut4JControlPane { |
|
|
|
private static class CustomPredefinedStylePaneNoBorder extends CustomPredefinedStylePane { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
protected List<BasicPane> initPaneList() { |
|
|
|
|
|
|
|
paneList = new ArrayList<BasicPane>(); |
|
|
|
|
|
|
|
paneList.add(new FormatPane()); |
|
|
|
|
|
|
|
paneList.add(new AlignmentPane()); |
|
|
|
|
|
|
|
return paneList; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ShortCut4JControlPane createAddItemShortCut4JControlPane (){ |
|
|
|
|
|
|
|
ShortCut shortCut = shortCutFactory.createAddItemUpdateAction(new NameableCreator[]{ |
|
|
|
|
|
|
|
new CellStyleNameObjectCreator(Toolkit.i18nText("Fine-Design_Predefined_Cell_New_Style"), |
|
|
|
|
|
|
|
PredefinedCellStyle.class, CustomPredefinedStylePane.class)}); |
|
|
|
|
|
|
|
return new AddItemShortCut4JControlPane(shortCut); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private class AddItemShortCut4JControlPane extends ShortCut4JControlPane{ |
|
|
|
|
|
|
|
AddItemShortCut4JControlPane(ShortCut shortCut) { |
|
|
|
|
|
|
|
this.shortCut = shortCut; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void checkEnable() { |
|
|
|
|
|
|
|
this.shortCut.setEnabled(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private class RemoveItemShortCut4JControlPane extends ShortCut4JControlPane { |
|
|
|
RemoveItemShortCut4JControlPane(ShortCut shortCut) { |
|
|
|
RemoveItemShortCut4JControlPane(ShortCut shortCut) { |
|
|
|
this.shortCut = shortCut; |
|
|
|
this.shortCut = shortCut; |
|
|
|
} |
|
|
|
} |
|
|
@ -180,6 +223,25 @@ public class CellStyleListControlPane extends JListControlPane { |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param ob |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public Object acceptObject2Populate(Object ob) { |
|
|
|
|
|
|
|
if (ob instanceof NameObject) { |
|
|
|
|
|
|
|
ob = ((NameObject) ob).getObject(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (clazzOfObject != null && clazzOfObject.isInstance(ob) && acceptDefaultNameObject(ob)) { |
|
|
|
|
|
|
|
doSthChanged4Icon(ob); |
|
|
|
|
|
|
|
return ob; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean acceptDefaultNameObject(Object ob) { |
|
|
|
|
|
|
|
return !((PredefinedCellStyle) ob).isDefaultStyle(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|