Search in sources :

Example 96 with DBPPreferenceStore

use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.

the class HexPreferencesPage method getDefaultWidth.

public static String getDefaultWidth() {
    DBPPreferenceStore store = DBWorkbench.getPlatform().getPreferenceStore();
    String defWidth = store.getString(HexEditorPreferences.HEX_DEF_WIDTH);
    return CommonUtils.isEmpty(defWidth) ? "8" : defWidth;
}
Also used : DBPPreferenceStore(org.jkiss.dbeaver.model.preferences.DBPPreferenceStore)

Example 97 with DBPPreferenceStore

use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.

the class HexPreferencesPage method performOk.

/**
 * @see HexPreferencesPage#performOk()
 */
@Override
public boolean performOk() {
    DBPPreferenceStore store = DBWorkbench.getPlatform().getPreferenceStore();
    FontData fontData = preferences.getFontData();
    store.setValue(HexEditorPreferences.HEX_FONT_NAME, fontData.getName());
    store.setValue(HexEditorPreferences.HEX_FONT_STYLE, fontData.getStyle());
    store.setValue(HexEditorPreferences.HEX_FONT_SIZE, fontData.getHeight());
    store.firePropertyChangeEvent(PROP_FONT_DATA, null, fontData);
    store.setValue(HexEditorPreferences.HEX_DEF_WIDTH, preferences.getDefWidth());
    store.firePropertyChangeEvent(PROP_DEF_WIDTH, 0, preferences.getDefWidth());
    PrefUtils.savePreferenceStore(store);
    return true;
}
Also used : FontData(org.eclipse.swt.graphics.FontData) DBPPreferenceStore(org.jkiss.dbeaver.model.preferences.DBPPreferenceStore)

Example 98 with DBPPreferenceStore

use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.

the class QueryLogViewer method reloadEvents.

private void reloadEvents(@Nullable String searchString) {
    if (reloadInProgress) {
        // $NON-NLS-1$
        log.debug("Event reload is in progress. Skip");
        return;
    }
    reloadInProgress = true;
    DBPPreferenceStore store = DBWorkbench.getPlatform().getPreferenceStore();
    this.entriesPerPage = Math.max(MIN_ENTRIES_PER_PAGE, store.getInt(QMConstants.PROP_ENTRIES_PER_PAGE));
    this.defaultFilter = new DefaultEventFilter();
    clearLog();
    // Extract events
    EventHistoryReadService loadingService = new EventHistoryReadService(searchString);
    LoadingJob.createService(loadingService, new EvenHistoryReadVisualizer(loadingService)).schedule();
}
Also used : DefaultEventFilter(org.jkiss.dbeaver.runtime.qm.DefaultEventFilter) DBPPreferenceStore(org.jkiss.dbeaver.model.preferences.DBPPreferenceStore)

Example 99 with DBPPreferenceStore

use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.

the class SQLEditorBase method loadActivePreferenceSettings.

protected void loadActivePreferenceSettings() {
    DBPPreferenceStore preferenceStore = getActivePreferenceStore();
    boolean closeSingleQuotes = preferenceStore.getBoolean(SQLPreferenceConstants.SQLEDITOR_CLOSE_SINGLE_QUOTES);
    boolean closeDoubleQuotes = preferenceStore.getBoolean(SQLPreferenceConstants.SQLEDITOR_CLOSE_DOUBLE_QUOTES);
    boolean closeBrackets = preferenceStore.getBoolean(SQLPreferenceConstants.SQLEDITOR_CLOSE_BRACKETS);
    sqlSymbolInserter.setCloseSingleQuotesEnabled(closeSingleQuotes);
    sqlSymbolInserter.setCloseDoubleQuotesEnabled(closeDoubleQuotes);
    sqlSymbolInserter.setCloseBracketsEnabled(closeBrackets);
}
Also used : DBPPreferenceStore(org.jkiss.dbeaver.model.preferences.DBPPreferenceStore)

Example 100 with DBPPreferenceStore

use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.

the class SQLModelPreferencesInitializer method initializeDefaultPreferences.

@Override
public void initializeDefaultPreferences() {
    // Init default preferences
    DBPPreferenceStore store = ModelPreferences.getPreferences();
    // Common
    PrefUtils.setDefaultPreferenceValue(store, SQLModelPreferences.SQL_FORMAT_FORMATTER, SQLFormatterTokenized.FORMATTER_ID);
    PrefUtils.setDefaultPreferenceValue(store, SQLModelPreferences.SQL_PROPOSAL_INSERT_TABLE_ALIAS, true);
}
Also used : DBPPreferenceStore(org.jkiss.dbeaver.model.preferences.DBPPreferenceStore)

Aggregations

DBPPreferenceStore (org.jkiss.dbeaver.model.preferences.DBPPreferenceStore)201 DBPPreferenceListener (org.jkiss.dbeaver.model.preferences.DBPPreferenceListener)11 IOException (java.io.IOException)10 ArrayList (java.util.ArrayList)10 DBDAttributeBinding (org.jkiss.dbeaver.model.data.DBDAttributeBinding)10 ExecutionException (org.eclipse.core.commands.ExecutionException)8 GridData (org.eclipse.swt.layout.GridData)8 NotNull (org.jkiss.code.NotNull)8 BundlePreferenceStore (org.jkiss.dbeaver.model.impl.preferences.BundlePreferenceStore)8 Color (org.eclipse.swt.graphics.Color)6 FontData (org.eclipse.swt.graphics.FontData)6 DBException (org.jkiss.dbeaver.DBException)6 DBDDisplayFormat (org.jkiss.dbeaver.model.data.DBDDisplayFormat)6 QMObjectType (org.jkiss.dbeaver.model.qm.QMObjectType)6 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)4 IDialogSettings (org.eclipse.jface.dialogs.IDialogSettings)4 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)4 SelectionEvent (org.eclipse.swt.events.SelectionEvent)4 AbstractJob (org.jkiss.dbeaver.model.runtime.AbstractJob)4 DBRProgressMonitor (org.jkiss.dbeaver.model.runtime.DBRProgressMonitor)4