Skip to content

Commit adfbc27

Browse files
committed
Adapt to PatternFX changes (remove HistoryPolicy)
1 parent 698eccf commit adfbc27

29 files changed

Lines changed: 47 additions & 107 deletions

File tree

shellfx-core/src/main/java/com/techsenger/shellfx/core/DefaultShellParams.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.techsenger.shellfx.core;
1818

19-
import com.techsenger.patternfx.core.HistoryPolicy;
2019
import com.techsenger.shellfx.core.window.WindowParams;
2120
import com.techsenger.shellfx.core.window.WindowType;
2221
import java.util.Objects;
@@ -32,7 +31,6 @@ public class DefaultShellParams extends WindowParams {
3231
public DefaultShellParams(ShellContext context) {
3332
super(WindowType.TOP_LEVEL, false, context.getSettings().getAppearance());
3433
this.context = context;
35-
setHistoryPolicy(HistoryPolicy.APPEARANCE);
3634
setHistoryProvider(() -> context.getHistoryManager().getOrCreateHistory(ShellHistory.class, ShellHistory::new));
3735
}
3836

shellfx-core/src/main/java/com/techsenger/shellfx/core/DefaultShellPresenter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ protected ComponentDescriptor createDescriptor() {
7171
}
7272

7373
@Override
74-
protected void applyAppearance() {
75-
super.applyAppearance();
74+
protected void applyPersistentState() {
75+
super.applyPersistentState();
7676
setWidth(1200);
7777
setHeight(800);
7878
}

shellfx-core/src/main/java/com/techsenger/shellfx/core/dialog/AbstractDialogPresenter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ protected DialogHistory getHistory() {
151151
}
152152

153153
@Override
154-
protected void restoreAppearance() {
155-
super.restoreAppearance();
154+
protected void restorePersistentState() {
155+
super.restorePersistentState();
156156
var h = getHistory();
157157
setWidth(h.getWidth());
158158
setHeight(h.getHeight());
@@ -165,8 +165,8 @@ protected void onResult(ResultButtonName name) {
165165
}
166166

167167
@Override
168-
protected void saveAppearance() {
169-
super.saveAppearance();
168+
protected void savePersistentState() {
169+
super.savePersistentState();
170170
var h = getHistory();
171171
h.setWidth(getWidth());
172172
h.setHeight(getHeight());

shellfx-core/src/main/java/com/techsenger/shellfx/core/window/AbstractWindowPresenter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,17 +465,17 @@ protected WindowHistory getHistory() {
465465
}
466466

467467
@Override
468-
protected void restoreAppearance() {
469-
super.restoreAppearance();
468+
protected void restorePersistentState() {
469+
super.restorePersistentState();
470470
var h = getHistory();
471471
setMaximized(h.isMaximized());
472472
setHeight(h.getHeight());
473473
setWidth(h.getWidth());
474474
}
475475

476476
@Override
477-
protected void saveAppearance() {
478-
super.saveAppearance();
477+
protected void savePersistentState() {
478+
super.savePersistentState();
479479
var h = getHistory();
480480
h.setWidth(getWidth());
481481
h.setHeight(getHeight());

shellfx-demo/src/main/java/com/techsenger/shellfx/demo/HostFactory.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.techsenger.shellfx.demo;
1818

19-
import com.techsenger.patternfx.core.HistoryPolicy;
2019
import com.techsenger.patternfx.core.HistoryProvider;
2120
import com.techsenger.shellfx.core.ShellFxView;
2221
import com.techsenger.shellfx.core.area.AreaParams;
@@ -41,7 +40,6 @@ public final class HostFactory {
4140
public static TabHostFxView<?> createTabHost() {
4241
var view = new TabHostFxView<>(true);
4342
var params = new AreaParams();
44-
params.setHistoryPolicy(HistoryPolicy.NONE);
4543
var presenter = new TabHostPresenter<>(view, params);
4644
presenter.initialize();
4745
return view;
@@ -67,7 +65,6 @@ protected DockHostFxView.Composer createComposer() {
6765
}
6866
};
6967
var params = new DockHostParams(historyProvider);
70-
params.setHistoryPolicy(HistoryPolicy.NONE);
7168
var presenter = new DockHostPresenter<>(view, params);
7269
presenter.initialize();
7370
view.getComposer().setBottomBarPolicy(SideBarPolicy.EXISTS_ALWAYS);

shellfx-demo/src/main/java/com/techsenger/shellfx/demo/browser/BrowserMainTabParams.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.techsenger.shellfx.demo.browser;
1818

19-
import com.techsenger.patternfx.core.HistoryPolicy;
2019
import com.techsenger.shellfx.core.history.HistoryManager;
2120
import com.techsenger.shellfx.core.tab.HostTabParams;
2221
import java.util.Objects;
@@ -31,7 +30,6 @@ public class BrowserMainTabParams extends HostTabParams {
3130

3231
public BrowserMainTabParams(HistoryManager historyManager) {
3332
this.historyManager = historyManager;
34-
setHistoryPolicy(HistoryPolicy.ALL);
3533
setHistoryProvider(() -> historyManager
3634
.getOrCreateHistory(BrowserMainTabHistory.class, BrowserMainTabHistory::new));
3735
}

shellfx-demo/src/main/java/com/techsenger/shellfx/demo/dialogs/DemoDialogPresenter.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,4 @@ protected void postInitialize() {
5656
setTitle("Demo Dialog");
5757
setRightButtons(DemoResultButtons.CANCEL, DemoResultButtons.OK);
5858
}
59-
60-
@Override
61-
protected void applyAppearance() {
62-
super.applyAppearance();
63-
//setWidth(500);
64-
}
65-
66-
6759
}

shellfx-demo/src/main/java/com/techsenger/shellfx/demo/dialogs/DialogsDialogPresenter.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,6 @@ protected void postInitialize() {
131131
closeSafely();
132132
});
133133
setRightButtons(DialogsDialogButtons.CLOSE);
134-
// setMinWidth(400);
135-
// setMinHeight(200);
136-
}
137-
138-
@Override
139-
protected void applyAppearance() {
140-
super.applyAppearance();
141-
// setWidth(600);
142-
// setHeight(300);
143134
}
144135

145136
protected void onDialogClick(DialogType type) {

shellfx-demo/src/main/java/com/techsenger/shellfx/demo/page/PageTabParams.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.techsenger.shellfx.demo.page;
1818

19-
import com.techsenger.patternfx.core.HistoryPolicy;
2019
import com.techsenger.patternfx.core.HistoryProvider;
2120
import com.techsenger.shellfx.core.tab.TabParams;
2221
import java.util.Objects;
@@ -32,7 +31,6 @@ public class PageTabParams extends TabParams {
3231
public PageTabParams(HistoryProvider<PageTabHistory> historyProvider, PageMenuType menuType) {
3332
this.menuType = menuType;
3433
setHistoryProvider(historyProvider);
35-
setHistoryPolicy(HistoryPolicy.ALL);
3634
}
3735

3836
public PageMenuType getMenuType() {

shellfx-demo/src/main/java/com/techsenger/shellfx/demo/styles/StylesTabFxView.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import atlantafx.base.theme.Styles;
2020
import com.techsenger.patternfx.core.ComponentName;
21-
import com.techsenger.patternfx.core.HistoryPolicy;
2221
import com.techsenger.patternfx.mvp.ComponentDescriptor;
2322
import com.techsenger.shellfx.core.ShellFxView;
2423
import com.techsenger.shellfx.core.page.DefaultPageDescriptor;
@@ -101,7 +100,6 @@ public void compose() {
101100
}
102101
};
103102
var params = new PageHostParams(null);
104-
params.setHistoryPolicy(HistoryPolicy.NONE);
105103
var hostPresenter = new PageHostPresenter<>(pageHost, params);
106104
hostPresenter.initialize();
107105
hostPresenter.setDividerPosition(0.275);

0 commit comments

Comments
 (0)