57 |
57 |
private static final String IS_GRID_VISIBLE = "IS_GRID_VISIBLE";
|
58 |
58 |
private static final String IS_RULER_VISIBLE = "IS_RULER_VISIBLE";
|
59 |
59 |
private static final String ISEDITABLE_FIELD = "isEditable";
|
|
60 |
/**
|
|
61 |
* True when the document window has been opened at least once, false otherwise. This is required
|
|
62 |
* to decide whether the page setting dialog has to be shown to the user, otherwise it would be
|
|
63 |
* shown every time the document is opened from project persistence
|
|
64 |
*/
|
|
65 |
private static final String HAS_WINDOW_BEEN_EVER_OPEN_FIELD = "hasDocBeenOpened";
|
60 |
66 |
|
61 |
67 |
private static final String NUMBEHIND_FIELD = "numBehind";
|
62 |
68 |
private static final String NUMBEFORE_FIELD = "numBefore";
|
... | ... | |
73 |
79 |
private int numBehind = 0;
|
74 |
80 |
private boolean isEditable = true;
|
75 |
81 |
private Boolean adjustToGrid = null;
|
|
82 |
private boolean hasDocBeenOpened = false;
|
76 |
83 |
|
77 |
84 |
private Boolean m_showRuler;
|
78 |
85 |
private Boolean isGridVisible = null;
|
... | ... | |
185 |
192 |
}
|
186 |
193 |
|
187 |
194 |
public void addFFrame(IFFrame frame, boolean clearSelection, boolean select) {
|
|
195 |
frame.setLayoutContext(this);
|
188 |
196 |
IFFrame[] fframes = getFFrames();
|
189 |
197 |
if (clearSelection) {
|
190 |
198 |
for (int i = fframes.length - 1; i >= 0; i--) {
|
... | ... | |
358 |
366 |
definition.addDynFieldBoolean(ISEDITABLE_FIELD).setMandatory(true);
|
359 |
367 |
definition.addDynFieldBoolean(IS_GRID_VISIBLE).setMandatory(false);
|
360 |
368 |
definition.addDynFieldBoolean(IS_RULER_VISIBLE).setMandatory(false);
|
|
369 |
definition.addDynFieldBoolean(HAS_WINDOW_BEEN_EVER_OPEN_FIELD).setMandatory(false);
|
361 |
370 |
}
|
362 |
371 |
|
363 |
372 |
FFrame.registerPersistent();
|
... | ... | |
375 |
384 |
if (state.hasValue(IS_RULER_VISIBLE)) {
|
376 |
385 |
m_showRuler = state.getBoolean(IS_RULER_VISIBLE);
|
377 |
386 |
}
|
|
387 |
if (state.hasValue(HAS_WINDOW_BEEN_EVER_OPEN_FIELD)) {
|
|
388 |
setHasDocBeenOpened(state.getBoolean(HAS_WINDOW_BEEN_EVER_OPEN_FIELD));
|
|
389 |
}
|
|
390 |
else {
|
|
391 |
// if not present, assume it was opened (as we are loading from persistence)
|
|
392 |
setHasDocBeenOpened(true);
|
|
393 |
}
|
378 |
394 |
|
379 |
395 |
numBehind = state.getInt(NUMBEHIND_FIELD);
|
380 |
396 |
numBefore = state.getInt(NUMBEFORE_FIELD);
|
... | ... | |
393 |
409 |
state.set(NUMBEFORE_FIELD, numBefore);
|
394 |
410 |
state.set(ATTRIBUTES_FIELD, m_attributes);
|
395 |
411 |
state.set(FFRAMES_FIELD, fframes);
|
396 |
|
|
|
412 |
state.set(HAS_WINDOW_BEEN_EVER_OPEN_FIELD, new Boolean(hasDocBeenOpened()));
|
397 |
413 |
state.set(IS_RULER_VISIBLE, this.getRuler());
|
398 |
414 |
state.set(IS_GRID_VISIBLE, this.isGridVisible());
|
399 |
415 |
}
|
... | ... | |
453 |
469 |
public void removeTocObservers() {
|
454 |
470 |
this.tocObservers.deleteObservers();
|
455 |
471 |
}
|
|
472 |
|
|
473 |
/**
|
|
474 |
* True when the document window has been opened at least once, false otherwise. This is required
|
|
475 |
* to decide whether the page setting dialog has to be shown to the user, otherwise it would be
|
|
476 |
* shown every time the document is opened from project persistence
|
|
477 |
*/
|
|
478 |
public boolean hasDocBeenOpened() {
|
|
479 |
return hasDocBeenOpened;
|
|
480 |
}
|
|
481 |
|
|
482 |
/**
|
|
483 |
* True when the document window has been opened at least once, false otherwise. This is required
|
|
484 |
* to decide whether the page setting dialog has to be shown to the user, otherwise it would be
|
|
485 |
* shown every time the document is opened from project persistence
|
|
486 |
*/
|
|
487 |
public void setHasDocBeenOpened(boolean hasBeenOpened) {
|
|
488 |
this.hasDocBeenOpened = hasBeenOpened;
|
|
489 |
}
|
456 |
490 |
}
|