1 | |
package org.jtheque.core.managers.view.impl.frame; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
import org.jtheque.core.managers.Managers; |
20 | |
import org.jtheque.core.managers.view.able.ILicenceView; |
21 | |
import org.jtheque.core.managers.view.able.components.IModel; |
22 | |
import org.jtheque.core.managers.view.impl.actions.about.PrintLicenseAction; |
23 | |
import org.jtheque.core.managers.view.impl.frame.abstraction.SwingBuildedDialogView; |
24 | |
import org.jtheque.core.utils.ui.PanelBuilder; |
25 | |
import org.jtheque.utils.io.FileUtils; |
26 | |
import org.jtheque.utils.ui.GridBagUtils; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
public final class LicenceView extends SwingBuildedDialogView<IModel> implements ILicenceView { |
34 | |
private static final int DEFAULT_WIDTH = 800; |
35 | |
private static final int DEFAULT_HEIGHT = 600; |
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
public LicenceView(){ |
41 | 0 | super(); |
42 | |
|
43 | 0 | build(); |
44 | 0 | } |
45 | |
|
46 | |
@Override |
47 | |
protected void initView(){ |
48 | 0 | setTitleKey("licence.view.title", Managers.getCore().getApplication().getName()); |
49 | 0 | } |
50 | |
|
51 | |
@Override |
52 | |
protected void buildView(PanelBuilder builder){ |
53 | 0 | builder.addScrolledTextArea(FileUtils.getTextOf(Managers.getCore().getApplication().getLicenceFilePath()), |
54 | |
builder.gbcSet(0, 0, GridBagUtils.BOTH, GridBagUtils.BELOW_BASELINE_LEADING, 1.0, 1.0)); |
55 | |
|
56 | 0 | builder.addButtonBar(builder.gbcSet(0, 1, GridBagUtils.HORIZONTAL), |
57 | |
new PrintLicenseAction(), getCloseAction("licence.actions.close")); |
58 | |
|
59 | 0 | getManager().configureView(this, "licence", DEFAULT_WIDTH, DEFAULT_HEIGHT); |
60 | 0 | } |
61 | |
} |