use of org.apache.cayenne.modeler.pref.ProjectStatePreferences in project cayenne by apache.
the class ProjectStateUtil method saveLastState.
public void saveLastState(ProjectController controller) {
EventObject displayEvent = controller.getLastDisplayEvent();
ConfigurationNode[] multiplyObjects = controller.getCurrentPaths();
if (displayEvent == null && multiplyObjects == null) {
return;
}
ProjectStatePreferences preferences = controller.getProjectStatePreferences();
if (preferences.getCurrentPreference() == null) {
return;
}
try {
preferences.getCurrentPreference().clear();
} catch (BackingStoreException e) {
// ignore exception
}
if (displayEvent != null) {
DisplayEventTypes.valueOf(displayEvent.getClass().getSimpleName()).createDisplayEventType(controller).saveLastDisplayEvent();
} else if (multiplyObjects.length != 0) {
new MultipleObjectsDisplayEventType(controller).saveLastDisplayEvent();
}
}
use of org.apache.cayenne.modeler.pref.ProjectStatePreferences in project cayenne by apache.
the class ProjectStateUtil method fireLastState.
public void fireLastState(ProjectController controller) {
ProjectStatePreferences preferences = controller.getProjectStatePreferences();
String displayEventName = preferences.getEvent();
if (!displayEventName.isEmpty()) {
DisplayEventTypes.valueOf(displayEventName).createDisplayEventType(controller).fireLastDisplayEvent();
}
}
Aggregations