Browse Source

代码修改

feature/big-screen
kerry 4 years ago
parent
commit
0bb145cb41
  1. 12
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 3
      designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java

12
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -309,6 +309,13 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_INIT, this);
}
/**
* 模板激活之前之前
*/
protected void beforeActive() {
EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this);
}
/**
* 模板关闭时
*/
@ -1085,6 +1092,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* 激活指定的template
*/
public void activeJTemplate(int index, JTemplate jt) {
beforeActive();
DesignerContext.getDesignerFrame().activateJTemplate(this);
}
@ -1092,7 +1100,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* 激活已存在的模板
*/
public void activeOldJTemplate() {
EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this);
beforeActive();
DesignerContext.getDesignerFrame().activateJTemplate(this);
}
@ -1100,7 +1108,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* 激活新的模板
*/
public void activeNewJTemplate() {
EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this);
beforeActive();
DesignerContext.getDesignerFrame().addAndActivateJTemplate(this);
}

3
designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java

@ -208,6 +208,7 @@ public class JVirtualTemplate extends JTemplate {
@Override
public void activeJTemplate(int index, JTemplate jt) {
beforeActive();
List<JTemplate<?, ?>> historyList = HistoryTemplateListPane.getInstance().getHistoryList();
historyList.set(index, jt);
DesignerContext.getDesignerFrame().addAndActivateJTemplate(jt);
@ -217,11 +218,13 @@ public class JVirtualTemplate extends JTemplate {
@Override
public void activeOldJTemplate() {
beforeActive();
DesignerContext.getDesignerFrame().openTemplate(this.getEditingFILE());
}
@Override
public void activeNewJTemplate() {
beforeActive();
DesignerContext.getDesignerFrame().openTemplate(this.getEditingFILE());
}

Loading…
Cancel
Save