Java 类org.eclipse.jface.preference.IPreferenceStore 实例源码

项目:n4js    文件:N4JSBuilderPreferenceAccess.java   
private void intializeBuilderPreferences(IPreferenceStore store) {
    for (CompilerDescriptor compilerDescriptor : compositeGenerator.getCompilerDescriptors()) {
        for (CompilerProperties prop : CompilerProperties.values()) {
            if (prop.getType() == Boolean.class) {
                store.setDefault(
                        prop.getKey(compilerDescriptor.getIdentifier()),
                        (Boolean) prop.getValueInCompilerDescriptor(compilerDescriptor,
                                compilerDescriptor.getIdentifier()));
            } else {
                store.setDefault(
                        prop.getKey(compilerDescriptor.getIdentifier()),
                        (String) prop.getValueInCompilerDescriptor(compilerDescriptor,
                                compilerDescriptor.getIdentifier()));
            }
        }
    }
}
项目:eclipse-batch-editor    文件:BatchSourceViewerConfiguration.java   
/**
 * Creates configuration by given adaptable
 * 
 * @param adaptable
 *            must provide {@link ColorManager} and {@link IFile}
 */
public BatchSourceViewerConfiguration(IAdaptable adaptable) {
    IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore();
    this.fPreferenceStore = new ChainedPreferenceStore(
            new IPreferenceStore[] { getPreferences().getPreferenceStore(), generalTextStore });

    Assert.isNotNull(adaptable, "adaptable may not be null!");
    this.annotationHoover = new BatchEditorAnnotationHoover();

    this.contentAssistant = new ContentAssistant();
    contentAssistProcessor = new BatchEditorSimpleWordContentAssistProcessor();
    contentAssistant.enableColoredLabels(true);

    contentAssistant.setContentAssistProcessor(contentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE);
    for (BatchDocumentIdentifier identifier: BatchDocumentIdentifiers.values()){
        contentAssistant.setContentAssistProcessor(contentAssistProcessor, identifier.getId());
    }

    contentAssistant.addCompletionListener(contentAssistProcessor.getCompletionListener());

    this.colorManager = adaptable.getAdapter(ColorManager.class);
    Assert.isNotNull(colorManager, " adaptable must support color manager");
    this.defaultTextAttribute = new TextAttribute(
            colorManager.getColor(getPreferences().getColor(COLOR_NORMAL_TEXT)));
    this.adaptable=adaptable;
}
项目:ec4e    文件:PreferenceStoreHelper.java   
public static IPreferenceStore contributeToPreferenceStore(ITextEditor textEditor,
        IPreferenceStore preferenceStore) {
    try {
        // Get old store
        IPreferenceStore oldStore = getPreferenceStore(textEditor);
        // Create chained store with preference store to add
        IPreferenceStore newStore = new ChainedPreferenceStore(
                new IPreferenceStore[] { preferenceStore, oldStore });
        // Update the text editor with new preference store
        setPreferenceStoreOfTextEditor(textEditor, newStore);
        // Update the source viewer configuration with new preference store
        setPreferenceStoreOfSourceViewerConfiguration(textEditor, newStore);
        return newStore;

    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }

}
项目:ec4e    文件:NewEditorConfigWizard.java   
/**
 * Returns the content of the .editorconfig file to generate.
 *
 * @param container
 *
 * @return the content of the .editorconfig file to generate.
 */
private InputStream openContentStream(IContainer container) {
    IPreferenceStore store = EditorsUI.getPreferenceStore();
    boolean spacesForTabs = store.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS);
    int tabWidth = store.getInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH);
    String lineDelimiter = getLineDelimiter(container);
    String endOfLine = org.ec4j.core.model.PropertyType.EndOfLineValue.ofEndOfLineString(lineDelimiter).name();

    StringBuilder content = new StringBuilder("# EditorConfig is awesome: http://EditorConfig.org");
    content.append(lineDelimiter);
    content.append(lineDelimiter);
    content.append("[*]");
    content.append(lineDelimiter);
    content.append("indent_style = ");
    content.append(spacesForTabs ? "space" : "tab");
    content.append(lineDelimiter);
    content.append("indent_size = ");
    content.append(tabWidth);
    if (endOfLine != null) {
        content.append(lineDelimiter);
        content.append("end_of_line = ");
        content.append(endOfLine);
    }

    return new ByteArrayInputStream(content.toString().getBytes());
}
项目:scanning    文件:StatusQueueLaunchView.java   
private void createTextControl(String slabel, final String propName, Composite content) {

        final IPreferenceStore store = Activator.getDefault().getPreferenceStore();

        final Label label = new Label(content, SWT.NONE);
        label.setText(slabel);

        final Text text = new Text(content, SWT.BORDER);
        text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
        text.setText(store.getString(propName));
        text.addModifyListener(new ModifyListener() {
            @Override
            public void modifyText(ModifyEvent e) {
                store.setValue(propName, text.getText());
            }
        });
    }
项目:scanning    文件:StatusQueueLaunchView.java   
private void openQueueMonitor() throws UnsupportedEncodingException {

        final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
        String bundle = store.getString(BUNDLE);
        String bean   = store.getString(BEAN);
        String sqn    = store.getString(STATUS_QUEUE);
        String stn    = store.getString(STATUS_TOPIC);
        String submit = store.getString(SUBMIT_QUEUE);
        String part   = store.getString(PART_NAME);

        String queueViewId = QueueViews.createSecondaryId(bundle,bean, sqn, stn, submit);
        queueViewId = queueViewId+"partName="+part;
        try {
            Util.getPage().showView(StatusQueueView.ID, queueViewId, IWorkbenchPage.VIEW_VISIBLE);
        } catch (PartInitException e) {
            ErrorDialog.openError(Display.getDefault().getActiveShell(), "Cannot open view", "Cannot open view "+queueViewId,
                    new Status(Status.ERROR, "org.eclipse.scanning.event.ui", e.getMessage()));
            logger.error("Cannot open view", e);
        }
    }
项目:eclipse-bash-editor    文件:BashSourceViewerConfiguration.java   
/**
 * Creates configuration by given adaptable
 * 
 * @param adaptable
 *            must provide {@link ColorManager} and {@link IFile}
 */
public BashSourceViewerConfiguration(IAdaptable adaptable) {
    IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore();
    this.fPreferenceStore = new ChainedPreferenceStore(
            new IPreferenceStore[] { getPreferences().getPreferenceStore(), generalTextStore });

    Assert.isNotNull(adaptable, "adaptable may not be null!");
    this.annotationHoover = new BashEditorAnnotationHoover();

    this.contentAssistant = new ContentAssistant();
    contentAssistProcessor = new BashEditorSimpleWordContentAssistProcessor();
    contentAssistant.enableColoredLabels(true);

    contentAssistant.setContentAssistProcessor(contentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE);
    for (BashDocumentIdentifier identifier: BashDocumentIdentifiers.values()){
        contentAssistant.setContentAssistProcessor(contentAssistProcessor, identifier.getId());
    }

    contentAssistant.addCompletionListener(contentAssistProcessor.getCompletionListener());

    this.colorManager = adaptable.getAdapter(ColorManager.class);
    Assert.isNotNull(colorManager, " adaptable must support color manager");
    this.defaultTextAttribute = new TextAttribute(
            colorManager.getColor(getPreferences().getColor(COLOR_NORMAL_TEXT)));
    this.adaptable=adaptable;
}
项目:Equella    文件:JPFRepositoryPage.java   
/**
 * @see PreferencePage#performOk
 */
@Override
public boolean performOk()
{
    if( !modified )
    {
        return true;
    }
    StructuredSelection selection = (StructuredSelection) listViewer.getSelection();
    IProject project = (IProject) selection.getFirstElement();
    if( project != null )
    {
        IPreferenceStore prefs = getPreferenceStore();
        prefs.setValue(JPFClasspathPlugin.PREF_REGISTRY_NAME, project.getName());
        try
        {
            ((IPersistentPreferenceStore) prefs).save();
        }
        catch( IOException e )
        {
            JPFClasspathLog.logError(e);
        }
    }
    return true;
}
项目:pgcodekeeper    文件:DbStorePicker.java   
public static File chooseDbSource(Shell shell, IPreferenceStore prefStore, boolean dir) {
    String pathToDump = dir ? getDirPath(shell, prefStore) : getFilePath(shell, prefStore);
    if (pathToDump == null) {
        return null;
    }

    File dumpFile = new File(pathToDump);
    Deque<File> dumpHistory = stringToDumpFileHistory(prefStore.getString(PREF.DB_STORE_FILES));
    dumpHistory.addFirst(dumpFile);
    while (dumpHistory.size() > MAX_FILES_HISTORY) {
        dumpHistory.removeLast();
    }
    prefStore.setValue(PREF.DB_STORE_FILES, dumpFileHistoryToPreference(dumpHistory));
    prefStore.setValue(PREF.LAST_OPENED_LOCATION,
            dir ? dumpFile.getAbsolutePath() : dumpFile.getParent());
    return dumpFile;
}
项目:n4js    文件:N4JSBuilderPreferenceAccess.java   
@Override
public void setAutoBuildEnabled(Object context, boolean enabled) {
    IPreferenceStore preferenceStore = preferenceStoreAccess.getWritablePreferenceStore(context);
    String key = null;
    for (CompilerDescriptor compilerDescriptor : compositeGenerator.getCompilerDescriptors()) {
        key = CompilerProperties.IS_ACTIVE.getKey(compilerDescriptor.getIdentifier());
        preferenceStore.setValue(key, enabled);
    }
}
项目:n4js    文件:AbstractN4JSPreferencePage.java   
/**
 * The field have to use OUTPUT_PREFERENCE_TAG as name as the chain of field editor make up the full qualified name
 * of the field editors contained by this field editor
 */
private ComponentDetailsFieldEditor doCreateField(IPreferenceStore preferenceStore) {
    return new ComponentDetailsFieldEditor(
            CompilerProperties.OUTPUT_PREFERENCE_TAG,
            "Registered compilers", getFieldEditorParent(), preferenceStore, components) {

        @Override
        protected IComponentProperties<?>[] getComponentProperties() {
            return getComponentPropertiesValues();
        }

    };
}
项目:n4js    文件:AbstractN4JSPreferencePage.java   
@Override
protected void createFieldEditors() {
    refreshAttributes();
    IPreferenceStore preferenceStore = preferenceStoreAccessImpl.getWritablePreferenceStore(getProject());
    field = doCreateField(preferenceStore);
    addField(field);
}
项目:ec4e    文件:EditorConfigReconciler.java   
private static IReconcilingStrategy create(IPreferenceStore preferenceStore, IResource resource) {
    if (EditorConfigConstants.EDITORCONFIG.equals(resource.getName())) {
        // it's an .editorconfig file, add validation
        CompositeReconcilingStrategy strategy = new CompositeReconcilingStrategy();
        strategy.setReconcilingStrategies(new IReconcilingStrategy[] { new ValidateEditorConfigStrategy(resource),
                new ValidateAppliedOptionsStrategy(preferenceStore, resource), new EditorConfigFoldingStrategy() });
        return strategy;
    }
    return new ValidateAppliedOptionsStrategy(preferenceStore, resource);
}
项目:n4js    文件:AbstractN4JSPreferencePage.java   
private void setDescriptorValuesFromPreferences(IPreferenceStore preferenceStore, String outputName,
        DESCR_TYPE newCompilerDescriptor) {
    for (IComponentProperties<DESCR_TYPE> prop : getComponentPropertiesValues()) {
        if (preferenceStore.contains(prop.getKey(outputName))) {
            if (prop.getType() == Boolean.class) {
                prop.setValueInCompilerDescriptor(newCompilerDescriptor, outputName,
                        preferenceStore.getBoolean(prop.getKey(outputName)));
            } else { // String
                prop.setValueInCompilerDescriptor(newCompilerDescriptor, outputName,
                        preferenceStore.getString(prop.getKey(outputName)));
            }
        }
    }
}
项目:n4js    文件:ComponentPreferencesDetailsPart.java   
/**
 * @return the preference stores associated with the field editors (they store their values in separate preference
 *         stores)
 */
public List<IPreferenceStore> getPreferenceStores() {
    List<IPreferenceStore> stores = new ArrayList<>();
    for (FieldEditor field : fields) {
        stores.add(field.getPreferenceStore());
    }
    return stores;
}
项目:n4js    文件:AbstractN4JSPreferenceStoreAccessor.java   
/**
 * @param outputName
 *            the output name that identifies the output configuration but in our case also the registered compiler.
 * @param compilerDescriptor
 *            the compiler descriptor holding the values either stored last time this details page was used or the
 *            default values for the compiler
 */
public void populateCompilerConfiguration(String outputName, T compilerDescriptor) {
    // defaults
    preferenceInitializer.initialize(scopedAccessor);

    boolean initialLoad = false;

    ComponentDescriptor currentlyStoredCompilerDescriptor = compilerDescriptor
            .getCurrentlyStoredComponentDescriptor();
    if (currentlyStoredCompilerDescriptor == null) {
        currentlyStoredCompilerDescriptor = compilerDescriptor; // default configuration
        initialLoad = true;
    }

    Map<String, String> originalSettings = currentlyStoredCompilerDescriptor.fillMap(outputName);

    IPreferenceStore preferenceStore = getPreferenceStore();
    // populate
    // use a copy here has we don't want to change the default values provided by the registered compilers
    @SuppressWarnings("unchecked")
    T newCompilerDescriptor = (T) compilerDescriptor.copy();
    for (IComponentProperties<T> prop : getComponentPropertiesValues()) {
        if (prop.getType() == Boolean.class) {
            prop.setValueInCompilerDescriptor(newCompilerDescriptor, outputName,
                    preferenceStore.getBoolean(prop.getKey(outputName)));
        } else {
            prop.setValueInCompilerDescriptor(newCompilerDescriptor, outputName,
                    preferenceStore.getString(prop.getKey(outputName)));
        }
    }

    Map<String, String> currentSettings = newCompilerDescriptor.fillMap(outputName);

    Map<String, ValueDifference<String>> changes = getPreferenceChanges(originalSettings, currentSettings);

    if (!initialLoad) {
        compilerDescriptor.setChanges(changes);
    }
    compilerDescriptor.setCurrentlyStoredComponentDescriptor(newCompilerDescriptor);
}
项目:n4js    文件:ComponentDetailsFieldEditor.java   
/**
 * @return the preference stores associated with the contained field editors (they store their values in separate
 *         preference stores)
 */
public List<IPreferenceStore> getPreferenceStores() {
    if (detailsPart != null) {
        return detailsPart.getPreferenceStores();
    }
    return new ArrayList<>();
}
项目:eclipse-batch-editor    文件:BatchEditor.java   
/**
 * Installs an additional source viewer support which uses editor
 * preferences instead of standard text preferences. If standard source
 * viewer support would be set with editor preferences all standard
 * preferences would be lost or had to be reimplmented. To avoid this
 * another source viewer support is installed...
 */
private void installAdditionalSourceViewerSupport() {

    additionalSourceViewerSupport = new SourceViewerDecorationSupport(getSourceViewer(), getOverviewRuler(),
            getAnnotationAccess(), getSharedColors());
    additionalSourceViewerSupport.setCharacterPairMatcher(bracketMatcher);
    additionalSourceViewerSupport.setMatchingCharacterPainterPreferenceKeys(
            P_EDITOR_MATCHING_BRACKETS_ENABLED.getId(), P_EDITOR_MATCHING_BRACKETS_COLOR.getId(),
            P_EDITOR_HIGHLIGHT_BRACKET_AT_CARET_LOCATION.getId(), P_EDITOR_ENCLOSING_BRACKETS.getId());

    IPreferenceStore preferenceStoreForDecorationSupport = BatchEditorUtil.getPreferences().getPreferenceStore();
    additionalSourceViewerSupport.install(preferenceStoreForDecorationSupport);
}
项目:pmTrans    文件:Config.java   
@Override
protected void doStore() {
    if (!character.getText().equals("[space]")
            && character.getText().length() > 1) {
        MessageDialog
                .openError(
                        Display.getCurrent().getActiveShell(),
                        "Error",
                        "The key "
                                + character.getText()
                                + " is not supported as a shortcut. Please use another one.");
        doLoadDefault();
        return;
    }
    String c = character.getText().equals("[space]") ? " " : character
            .getText();

    IPreferenceStore ps = getPreferenceStore();
    updateAccelerators();
    accelerators = accelerators.replace(ps.getString(keyConst), "");
    if (accelerators.contains(c)) {
        MessageDialog
                .openError(
                        Display.getCurrent().getActiveShell(),
                        "Error",
                        "The key "
                                + c
                                + " is already used as a shortcut. Please use another one.");
        doLoad();
        updateAccelerators();
        return;
    }
    ps.setValue(keyConst, c);
}
项目:neoscada    文件:PreferenceInitializer.java   
@Override
public void initializeDefaultPreferences ()
{
    final IPreferenceStore store = Activator.getDefault ().getPreferenceStore ();
    store.setDefault ( PreferenceConstants.BELL_ACTIVATED_KEY, true );
    store.setDefault ( PreferenceConstants.NUMBER_OF_EVENTS_KEY, 0 );
    store.setDefault ( PreferenceConstants.CUT_LIST_ALL_SECONDS_KEY, 10 * 60 );
}
项目:bdf2    文件:DatabaseAction.java   
private int validateDb() {
    editor = (DbToolGefEditor) getWorkbenchPart().getAdapter(GraphicalEditor.class);
    schema = editor.getModel();
    dbDialect = DbDialectManager.getDbDialect(schema.getCurrentDbType());
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    String driverLocation = store.getString(schema.getCurrentDbType());
    if (driverLocation.trim().length() == 0) {
        return openDbDriverLocationDialog(schema.getCurrentDbType(), dbDialect.getJdbcDriverName(), driverLocation);
    } else {
        return attemptTestJdbcDriver(schema.getCurrentDbType(), dbDialect.getJdbcDriverName(), driverLocation);
    }
}
项目:scanning    文件:StatusQueueLaunchView.java   
public StatusQueueLaunchView() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    store.setDefault(BUNDLE, "org.dawnsci.commandserver.SOMETHING");
    store.setDefault(BEAN,   "org.dawnsci.commandserver.SOMETHING.YourStatusBean");
    store.setDefault(STATUS_QUEUE, "scisoft.SOMETHING.STATUS_QUEUE");
    store.setDefault(STATUS_TOPIC, "scisoft.SOMETHING.STATUS_TOPIC");
    store.setDefault(SUBMIT_QUEUE, "scisoft.SOMETHING.SUBMISSION_QUEUE");
    store.setDefault(PART_NAME,    "Queue Monitor");
}
项目:scanning    文件:Activator.java   
/**
    * Get the command value if it has been changed by the user.
    * @param key
    * @return
    */
   private static final String getNovelCommandPreference(String key) {
    final IPreferenceStore store = getDefault().getPreferenceStore();
String val = store.getString(key);
String def = store.getDefaultString(key);
if (!val.equals(def)) return val;
return null;
    }
项目:scanning    文件:ActiveMQPage.java   
public ActiveMQPage() {
    super();

    final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    setPreferenceStore(store);
    setDescription("Preferences for connecting auto-processing reruns to the command server.");
}
项目:eclipse-bash-editor    文件:BashEditor.java   
/**
 * Installs an additional source viewer support which uses editor
 * preferences instead of standard text preferences. If standard source
 * viewer support would be set with editor preferences all standard
 * preferences would be lost or had to be reimplmented. To avoid this
 * another source viewer support is installed...
 */
private void installAdditionalSourceViewerSupport() {

    additionalSourceViewerSupport = new SourceViewerDecorationSupport(getSourceViewer(), getOverviewRuler(),
            getAnnotationAccess(), getSharedColors());
    additionalSourceViewerSupport.setCharacterPairMatcher(bracketMatcher);
    additionalSourceViewerSupport.setMatchingCharacterPainterPreferenceKeys(
            P_EDITOR_MATCHING_BRACKETS_ENABLED.getId(), P_EDITOR_MATCHING_BRACKETS_COLOR.getId(),
            P_EDITOR_HIGHLIGHT_BRACKET_AT_CARET_LOCATION.getId(), P_EDITOR_ENCLOSING_BRACKETS.getId());

    IPreferenceStore preferenceStoreForDecorationSupport = BashEditorUtil.getPreferences().getPreferenceStore();
    additionalSourceViewerSupport.install(preferenceStoreForDecorationSupport);
}
项目:eclipse-uroborosql-formatter    文件:PyConfigBinder.java   
/**
 * Binding plugin settings to python.
 *
 * @param engine
 *            PyEngine
 */
public void bind(PyEngine engine) {
    IPreferenceStore store = UroborosqlFormatterPlugin.getDefault().getPreferenceStore();

    engine.eval("config = LocalConfig()");
    if (CaseType.LOWER.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.CASE))) {
        engine.eval("config.set_case('lower')");
    } else if (CaseType.UPPER.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.CASE))) {
        engine.eval("config.set_case('upper')");
    } else if (CaseType.CAPITALIZE.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.CASE))) {
        engine.eval("config.set_case('capitalize')");
    }
    if (CaseType.LOWER.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_CASE))) {
        engine.eval("config.set_reserved_case('lower')");
    } else if (CaseType.UPPER.name()
            .equals(store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_CASE))) {
        engine.eval("config.set_reserved_case('upper')");
    } else if (CaseType.CAPITALIZE.name()
            .equals(store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_CASE))) {
        engine.eval("config.set_reserved_case('capitalize')");
    }
    if (store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_WORDS) != null) {
        String inputReservedWords = store.getString(UroborosqlFormatterPreferenceInitializer.RESERVED_WORDS);
        String[] reservedWords = inputReservedWords.split(",", 0);
        List<String> reservedWordsList = new ArrayList<String>();
        for (int i = 0; i < reservedWords.length; i++) {
            reservedWordsList.add(reservedWords[i]);
        }
        engine.put("input_reserved_words", reservedWordsList);
        engine.eval("config.set_input_reserved_words(input_reserved_words)");
    }
    if (CommentSyntaxType.Doma2.name().equals(store.getString(UroborosqlFormatterPreferenceInitializer.COMMENT_SYNTAX_TYPE))) {
        engine.eval("config.set_commentsyntax(Doma2CommentSyntax())");
    }
    if (store.getBoolean(UroborosqlFormatterPreferenceInitializer.USE_BACKSLASH)) {
        engine.eval("uroborosqlfmt.config.glb.escape_sequence_u005c = True");
    }
}
项目:eclipse-uroborosql-formatter    文件:UroborosqlFormatterPreferenceInitializer.java   
@Override
public void initializeDefaultPreferences() {
    IPreferenceStore store = UroborosqlFormatterPlugin.getDefault().getPreferenceStore();
    store.setDefault(USE_UPPERCASE, true);
    store.setDefault(HAS_BACKWARD_COMPATIBILITY_DONE, false);
    store.setDefault(CASE, CaseType.UPPER.name());
    store.setDefault(RESERVED_CASE, CaseType.UPPER.name());
    store.setDefault(RESERVED_WORDS, "");
    store.setDefault(USE_BACKSLASH, false);
    store.setDefault(COMMENT_SYNTAX_TYPE, CommentSyntaxType.Uroborosql.name());
}
项目:bdf2    文件:DbToolPreferencePage.java   
private void initDbDriverMetaData() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    dbDriverMetaDataList = new ArrayList<DbDriverMetaData>();
    List<DbDialect> dialects = DbDialectManager.getDialects();
    DbDriverMetaData dbDriverMetaData = null;
    for (DbDialect dbDialect : dialects) {
        dbDriverMetaData = new DbDriverMetaData();
        dbDriverMetaData.setDbNmae(dbDialect.getDbType());
        dbDriverMetaData.setDriverClassName(dbDialect.getJdbcDriverName());
        dbDriverMetaData.setDriverLocation(store.getString(dbDialect.getDbType()));
        dbDriverMetaDataList.add(dbDriverMetaData);
    }
}
项目:Hydrograph    文件:ExecutionTrackPreference.java   
@Override
public void init(IWorkbench workbench) {
    IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
    preferenceStore.setDefault(ExecutionPreferenceConstants.EXECUTION_TRACKING, true);
    preferenceStore.setDefault(ExecutionPreferenceConstants.TRACKING_LOG_PATH,
            TrackingDisplayUtils.INSTANCE.getInstallationPath());

    setPreferenceStore(preferenceStore);
}
项目:pgcodekeeper    文件:DbSource.java   
static PgDiffArguments getPgDiffArgs(String charset, String timeZone,
        boolean forceUnixNewlines) throws IOException {
    PgDiffArguments args = new PgDiffArguments();
    IPreferenceStore mainPS = Activator.getDefault().getPreferenceStore();
    args.setInCharsetName(charset);
    args.setAddTransaction(mainPS.getBoolean(DB_UPDATE_PREF.SCRIPT_IN_TRANSACTION));
    args.setDisableCheckFunctionBodies(!mainPS.getBoolean(DB_UPDATE_PREF.CHECK_FUNCTION_BODIES));
    args.setUsingTypeCastOff(!mainPS.getBoolean(DB_UPDATE_PREF.USING_ON_OFF));
    args.setIgnorePrivileges(mainPS.getBoolean(PREF.NO_PRIVILEGES));
    args.setTimeZone(timeZone);
    args.setKeepNewlines(!forceUnixNewlines);
    return args;
}
项目:pgcodekeeper    文件:DbSource.java   
public static DbSource fromDbInfo(DbInfo dbinfo, IPreferenceStore prefs,
        boolean forceUnixNewlines, String charset, String timezone) {
    if (prefs.getBoolean(PREF.PGDUMP_SWITCH)) {
        return DbSource.fromDb(forceUnixNewlines,
                prefs.getString(PREF.PGDUMP_EXE_PATH),
                prefs.getString(PREF.PGDUMP_CUSTOM_PARAMS),
                dbinfo.getDbHost(), dbinfo.getDbPort(),
                dbinfo.getDbUser(), dbinfo.getDbPass(), dbinfo.getDbName(),
                charset, timezone);
    } else {
        return DbSource.fromJdbc(dbinfo.getDbHost(), dbinfo.getDbPort(),
                dbinfo.getDbUser(), dbinfo.getDbPass(), dbinfo.getDbName(),
                timezone, forceUnixNewlines);
    }
}
项目:pgcodekeeper    文件:Differ.java   
public Getter(PgDatabase db) {
    oldArgs = db.getArguments();
    consumer = (db::setArguments);
    PgDiffArguments newArgs = oldArgs.clone();
    IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
    newArgs.setConcurrentlyMode(prefs.getBoolean(DB_UPDATE_PREF.PRINT_INDEX_WITH_CONCURRENTLY));
    db.setArguments(newArgs);
}
项目:pgcodekeeper    文件:DbStorePicker.java   
private static String getFilePath(Shell shell, IPreferenceStore prefStore) {
    FileDialog dialog = new FileDialog(shell);
    dialog.setText(Messages.choose_dump_file_with_changes);
    dialog.setFilterExtensions(new String[] {"*.sql", "*"}); //$NON-NLS-1$ //$NON-NLS-2$
    dialog.setFilterNames(new String[] {
            Messages.DiffPresentationPane_sql_file_filter,
            Messages.DiffPresentationPane_any_file_filter});
    dialog.setFilterPath(prefStore.getString(PREF.LAST_OPENED_LOCATION));
    return dialog.open();
}
项目:pgcodekeeper    文件:NewProjWizard.java   
PageDb(String pageName, IPreferenceStore mainPrefs) {
    super(pageName, pageName, null);
    this.mainPrefs = mainPrefs;

    setTitle(Messages.NewProjWizard_proj_init);
    setDescription(Messages.NewProjWizard_proj_init_src);
}
项目:pgcodekeeper    文件:DiffWizard.java   
public DiffWizard(PgDbProject proj, IPreferenceStore mainPrefs) {
    this.proj = proj;
    this.mainPrefs = mainPrefs;

    setWindowTitle(Messages.diffWizard_Diff);
    setDefaultPageImageDescriptor(ImageDescriptor.createFromURL(
            Activator.getContext().getBundle().getResource(FILE.ICONAPPWIZ)));
    setNeedsProgressMonitor(true);
}
项目:pgcodekeeper    文件:DiffWizard.java   
public PageDiff(String pageName, IPreferenceStore mainPrefs, PgDbProject proj) {
    super(pageName, pageName, null);

    this.mainPrefs = mainPrefs;
    this.proj = proj;
    setDescription(Messages.diffwizard_diffpage_select);
}
项目:pgcodekeeper    文件:PreferenceInitializer.java   
@Override
public void initializeDefaultPreferences() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();

    store.setDefault(PREF.PGDUMP_EXE_PATH, "pg_dump"); //$NON-NLS-1$
    store.setDefault(PREF.DB_STORE, "default\t\t\t\t\t0"); //$NON-NLS-1$
    store.setDefault(PREF.PGDUMP_CUSTOM_PARAMS, ""); //$NON-NLS-1$
    store.setDefault(PREF.FORCE_SHOW_CONSOLE, true);

    store.setDefault(PG_EDIT_PREF.EDITOR_UPDATE_ACTION, PG_EDIT_PREF.NO_ACTION);

    store.setDefault(DB_UPDATE_PREF.ALTER_COLUMN_STATEMENT, true);
    store.setDefault(DB_UPDATE_PREF.DROP_COLUMN_STATEMENT, true);
    store.setDefault(DB_UPDATE_PREF.DROP_TABLE_STATEMENT, true);
    store.setDefault(DB_UPDATE_PREF.RESTART_WITH_STATEMENT, true);
    store.setDefault(DB_UPDATE_PREF.SHOW_SCRIPT_OUTPUT_SEPARATELY, true);
    store.setDefault(DB_UPDATE_PREF.USING_ON_OFF, true);
    store.setDefault(DB_UPDATE_PREF.DELETE_SCRIPT_AFTER_CLOSE, MessageDialogWithToggle.PROMPT);
    store.setDefault(DB_UPDATE_PREF.CREATE_SCRIPT_IN_PROJECT, MessageDialogWithToggle.ALWAYS);
    store.setDefault(DB_UPDATE_PREF.MIGRATION_COMMAND, UIConsts.DDL_DEFAULT_CMD);

    store.setDefault(PG_EDIT_PREF.PERSPECTIVE_CHANGING_STATUS, MessageDialogWithToggle.PROMPT);

    store.setDefault(COMMIT_PREF.CONSIDER_DEPCY_IN_COMMIT, true);

    store.setDefault(USAGE_REPORT_PREF.USAGEREPORT_ENABLED_ID, true);
    store.setDefault(USAGE_REPORT_PREF.ASK_USER_USAGEREPORT_ID, true);

    setSQLSyntaxColorDefaults(store);
}
项目:bdf2    文件:PreferenceInitializer.java   
public void initializeDefaultPreferences() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    store.setDefault(PreferenceConstants.BDF_VERSION, "1");
    store.setDefault(PreferenceConstants.URL_LIST,
            "http://localhost:8080/bdf-test/bdf.popertiesLoderController.downXmlPropdesc.c");
    store.setDefault(PreferenceConstants.HOST, "localhost");
    store.setDefault(PreferenceConstants.PORT, "8080");
}
项目:ec4e    文件:PreferenceStoreHelper.java   
private static void setPreferenceStoreOfTextEditor(ITextEditor textEditor, IPreferenceStore preferenceStore)
        throws Exception {
    Method m = AbstractTextEditor.class.getDeclaredMethod("setPreferenceStore",
            new Class[] { IPreferenceStore.class });
    m.setAccessible(true);
    m.invoke(textEditor, preferenceStore);
}
项目:pgcodekeeper    文件:Diff.java   
@Override
public Object execute(ExecutionEvent event) {
    PgDbProject proj = OpenProjectUtils.getProject(event);
    Shell shell = HandlerUtil.getActiveShell(event);
    IPreferenceStore prefStore = Activator.getDefault().getPreferenceStore();
    Log.log(Log.LOG_DEBUG, "Diff wizard about to show"); //$NON-NLS-1$

    WizardDialog dialog = new WizardDialog(
            shell, new DiffWizard(proj, prefStore));
    dialog.open();
    return null;
}