|
|
@ -10,8 +10,11 @@ import com.fr.design.mainframe.DesignerFrame; |
|
|
|
import com.fr.design.menu.MenuKeySet; |
|
|
|
import com.fr.design.menu.MenuKeySet; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.transaction.CallBackAdaptor; |
|
|
|
import com.fr.transaction.Configurations; |
|
|
|
import com.fr.transaction.Configurations; |
|
|
|
import com.fr.transaction.Worker; |
|
|
|
import com.fr.transaction.Worker; |
|
|
|
|
|
|
|
import com.fr.transaction.WorkerCallBack; |
|
|
|
|
|
|
|
import com.fr.transaction.WorkerFacade; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.*; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
@ -21,16 +24,17 @@ import java.awt.event.ActionEvent; |
|
|
|
* StyleList Action |
|
|
|
* StyleList Action |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class StyleListAction extends UpdateAction { |
|
|
|
public class StyleListAction extends UpdateAction { |
|
|
|
public StyleListAction() { |
|
|
|
public StyleListAction() { |
|
|
|
this.setMenuKeySet(PREDEFINED_STYLES); |
|
|
|
this.setMenuKeySet(PREDEFINED_STYLES); |
|
|
|
this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); |
|
|
|
this.setName(getMenuKeySet().getMenuKeySetName() + "..."); |
|
|
|
this.setMnemonic(getMenuKeySet().getMnemonic()); |
|
|
|
this.setMnemonic(getMenuKeySet().getMnemonic()); |
|
|
|
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/style.png")); |
|
|
|
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/style.png")); |
|
|
|
this.generateAndSetSearchText(StyleManagerPane.class.getName()); |
|
|
|
this.generateAndSetSearchText(StyleManagerPane.class.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 动作 |
|
|
|
* 动作 |
|
|
|
|
|
|
|
* |
|
|
|
* @param evt 事件 |
|
|
|
* @param evt 事件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
@ -40,45 +44,44 @@ public class StyleListAction extends UpdateAction { |
|
|
|
styleListDialog.addDialogActionListener(new DialogActionAdapter() { |
|
|
|
styleListDialog.addDialogActionListener(new DialogActionAdapter() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void doOk() { |
|
|
|
public void doOk() { |
|
|
|
Configurations.update(new Worker() { |
|
|
|
Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
styleListPane.update(ServerPreferenceConfig.getInstance()); |
|
|
|
styleListPane.update(ServerPreferenceConfig.getInstance()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}.addCallBack(new CallBackAdaptor(){ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void afterCommit() { |
|
|
|
|
|
|
|
DesignerContext.getDesignerBean("predefinedStyle").refreshBeanElement(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
} |
|
|
|
public Class<? extends Configuration>[] targets() { |
|
|
|
|
|
|
|
return new Class[]{ServerPreferenceConfig.class}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
ServerPreferenceConfig mirror = ServerPreferenceConfig.getInstance().mirror(); |
|
|
|
ServerPreferenceConfig mirror = ServerPreferenceConfig.getInstance().mirror(); |
|
|
|
styleListPane.populate(mirror); |
|
|
|
styleListPane.populate(mirror); |
|
|
|
styleListDialog.setVisible(true); |
|
|
|
styleListDialog.setVisible(true); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void update() { |
|
|
|
public void update() { |
|
|
|
this.setEnabled(true); |
|
|
|
this.setEnabled(true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static final MenuKeySet PREDEFINED_STYLES = new MenuKeySet() { |
|
|
|
public static final MenuKeySet PREDEFINED_STYLES = new MenuKeySet() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public char getMnemonic() { |
|
|
|
public char getMnemonic() { |
|
|
|
return 'K'; |
|
|
|
return 'K'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String getMenuName() { |
|
|
|
public String getMenuName() { |
|
|
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ServerM_Predefined_Styles"); |
|
|
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ServerM_Predefined_Styles"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public KeyStroke getKeyStroke() { |
|
|
|
public KeyStroke getKeyStroke() { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|