Search in sources :

Example 1 with EventObject

use of de.alpharogroup.design.pattern.observer.event.EventObject in project bundle-app-ui by astrapi69.

the class ImportBundleApplicationStartPanel method updateWizardButtons.

protected void updateWizardButtons() {
    final ImportWizardModel modelObject = getModelObject().getModelObject();
    final String bundleAppName = modelObject.getBundleAppName();
    if (bundleAppName != null) {
        bundleAppName.trim();
    }
    final Locale defaultLocale = modelObject.getDefaultLocale();
    final File rootDir = modelObject.getRootDir();
    if (StringUtils.isNotEmpty(bundleAppName) && defaultLocale != null && rootDir != null) {
        modelObject.setAllValid();
        final EventSource<EventObject<NavigationEventState>> eventSource = MainApplication.getImportNavigationState();
        eventSource.fireEvent(new EventObject<>(NavigationEventState.UPDATE));
    } else {
        modelObject.reset();
    }
}
Also used : Locale(java.util.Locale) File(java.io.File) EventObject(de.alpharogroup.design.pattern.observer.event.EventObject)

Example 2 with EventObject

use of de.alpharogroup.design.pattern.observer.event.EventObject in project bundle-app-ui by astrapi69.

the class ImportWizardPanel method startResolving.

private void startResolving() throws IOException {
    final File rootDir = getModelObject().getRootDir();
    final Locale defaultLocale = getModelObject().getDefaultLocale();
    final PropertiesListResolver resolver1 = new PropertiesListResolver(rootDir, defaultLocale);
    resolver1.resolve();
    final List<KeyValuePair<File, Locale>> propertiesList = resolver1.getPropertiesList();
    getModelObject().setFoundProperties(ConvertExtensions.convertAndSort(propertiesList));
    getModelObject().setDbImport(true);
    final EventSource<EventObject<ImportWizardModel>> eventSource = MainApplication.getImportWizardModel();
    eventSource.fireEvent(new EventObject<>(getModelObject()));
    // set buttons state...
    getModelObject().setValidPrevious(true);
    getModelObject().setValidFinish(true);
    final EventSource<EventObject<NavigationEventState>> navigationEventState = MainApplication.getImportNavigationState();
    navigationEventState.fireEvent(new EventObject<>(NavigationEventState.UPDATE));
}
Also used : Locale(java.util.Locale) KeyValuePair(de.alpharogroup.collections.pairs.KeyValuePair) PropertiesListResolver(de.alpharogroup.resourcebundle.inspector.search.PropertiesListResolver) File(java.io.File) EventObject(de.alpharogroup.design.pattern.observer.event.EventObject)

Aggregations

EventObject (de.alpharogroup.design.pattern.observer.event.EventObject)2 File (java.io.File)2 Locale (java.util.Locale)2 KeyValuePair (de.alpharogroup.collections.pairs.KeyValuePair)1 PropertiesListResolver (de.alpharogroup.resourcebundle.inspector.search.PropertiesListResolver)1