Example usage for org.eclipse.jface.preference IPreferenceStore getString

List of usage examples for org.eclipse.jface.preference IPreferenceStore getString

Introduction

In this page you can find the example usage for org.eclipse.jface.preference IPreferenceStore getString.

Prototype

String getString(String name);

Source Link

Document

Returns the current value of the string-valued preference with the given name.

Usage

From source file:com.halware.nakedide.eclipse.core.logging.LogController.java

License:Open Source License

private void addSocketAppender() {
    assert _socketAppender == null;

    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    String hostname = store.getString(LogController.SOCKET_APPENDER_HOST_NAME_KEY);
    int port = store.getInt(LogController.SOCKET_APPENDER_PORT_KEY);
    Logger.getRootLogger().addAppender(new SocketAppender(hostname, port));

    _socketAppender = new SocketAppender(hostname, port);
    Logger.getRootLogger().addAppender(_socketAppender);
}

From source file:com.imperial.fiksen.codesimilarity.compare.ParseTreeMergeViewer.java

License:Open Source License

private void handleEndOfDocumentReached(Shell shell, boolean next) {
    IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore();
    String value = store.getString(ICompareUIConstants.PREF_NAVIGATION_END_ACTION);
    if (!value.equals(ICompareUIConstants.PREF_VALUE_PROMPT)) {
        performEndOfDocumentAction(shell, store, ICompareUIConstants.PREF_NAVIGATION_END_ACTION, next);
    } else {/*from  ww  w  .  j a v a2  s .c o m*/
        shell.getDisplay().beep();
        String loopMessage;
        String nextMessage;
        String message;
        String title;
        if (next) {
            title = CompareMessages.TextMergeViewer_0;
            message = CompareMessages.TextMergeViewer_1;
            loopMessage = CompareMessages.TextMergeViewer_2;
            nextMessage = CompareMessages.TextMergeViewer_3;
        } else {
            title = CompareMessages.TextMergeViewer_4;
            message = CompareMessages.TextMergeViewer_5;
            loopMessage = CompareMessages.TextMergeViewer_6;
            nextMessage = CompareMessages.TextMergeViewer_7;
        }
        String[] localLoopOption = new String[] { loopMessage, ICompareUIConstants.PREF_VALUE_LOOP };
        String[] nextElementOption = new String[] { nextMessage, ICompareUIConstants.PREF_VALUE_NEXT };
        String[] doNothingOption = new String[] { CompareMessages.TextMergeViewer_17,
                ICompareUIConstants.PREF_VALUE_DO_NOTHING };
        NavigationEndDialog dialog = new NavigationEndDialog(shell, title, null, message,
                new String[][] { localLoopOption, nextElementOption, doNothingOption });
        int result = dialog.open();
        if (result == Window.OK) {
            performEndOfDocumentAction(shell, store, ICompareUIConstants.PREF_NAVIGATION_END_ACTION_LOCAL,
                    next);
            if (dialog.getToggleState()) {
                String oldValue = store.getString(ICompareUIConstants.PREF_NAVIGATION_END_ACTION);
                store.putValue(ICompareUIConstants.PREF_NAVIGATION_END_ACTION,
                        store.getString(ICompareUIConstants.PREF_NAVIGATION_END_ACTION_LOCAL));
                store.firePropertyChangeEvent(ICompareUIConstants.PREF_NAVIGATION_END_ACTION, oldValue,
                        store.getString(ICompareUIConstants.PREF_NAVIGATION_END_ACTION_LOCAL));
            }
        }
    }
}

From source file:com.imperial.fiksen.codesimilarity.compare.ParseTreeMergeViewer.java

License:Open Source License

private void performEndOfDocumentAction(Shell shell, IPreferenceStore store, String key, boolean next) {
    String value = store.getString(key);
    if (value.equals(ICompareUIConstants.PREF_VALUE_DO_NOTHING)) {
        return;/*from ww w  .j  a  v  a 2s. c o m*/
    }
    if (value.equals(ICompareUIConstants.PREF_VALUE_NEXT)) {
        ICompareNavigator navigator = getCompareConfiguration().getContainer().getNavigator();
        if (hasNextElement(next)) {
            navigator.selectChange(next);
        }
    } else {
        selectFirstDiff(next);
    }
}

From source file:com.intel.sgx.preferences.PreferenceConstants.java

License:Open Source License

public static ISDKDescriptor getSDKDescriptor() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    File sdkDir = new File(store.getString(PreferenceConstants.SDK_PATH));

    if (System.getProperty("os.arch").contains("64")) {
        return new SGXSDK64Descriptor(sdkDir);
    } else {/* ww  w.j  a  va2  s  .  c o m*/
        return new SGXSDK32Descriptor(sdkDir);
    }
}

From source file:com.intel.sgx.SdkPathVariableProvider.java

License:Open Source License

@Override
public String getValue(String variable, IResource resource) {
    if (variable.equals("SGX_SDK_DIR_PATH")) {
        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
        String SDKPath = store.getString(PreferenceConstants.SDK_PATH);
        IPath SDKCanonicalPath = new Path(SDKPath);
        return (SDKCanonicalPath.append("Include").toOSString());
    }// w  w w. jav  a2 s. c  o m
    return null;
}

From source file:com.iw.plugins.spindle.editors.assist.usertemplates.XMLFileContextType.java

License:Mozilla Public License

public static IStatus validateTemplateName(IPreferenceStore store, String contextId, String templateName) {

    SpindleStatus status = new SpindleStatus();
    String value = store.getString(contextId);

    if (!templateExists(value, contextId))
        status.setError(//from w w w. jav a2s.  c o m
                UIPlugin.getString("templates.missing.pref", value, UIPlugin.getString(contextId + ".label")));

    return status;
}

From source file:com.iw.plugins.spindle.editors.template.assist.TemplateContentAssistProcessor.java

License:Mozilla Public License

protected void init(IDocument document) throws IllegalStateException {
    fDTD = null;/*from   w w w  .  ja va  2 s. c o  m*/
    IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore();
    if (fHasHTMLExtension) {
        String dtdString = store.getString(PreferenceConstants.TEMPLATE_EDITOR_HTML_SHOW_XHTML);
        if (dtdString.equals(TemplateEditor.XHTML_NONE_LABEL))
            return;

        if (dtdString.equals(TemplateEditor.XHTML_STRICT_LABEL)) {
            fDTD = TemplateEditor.XHTML_STRICT;
        } else if (dtdString.equals(TemplateEditor.XHTML_TRANSITIONAL_LABEL)) {
            fDTD = TemplateEditor.XHTML_TRANSITIONAL;
        } else if (dtdString.equals(TemplateEditor.XHTML_FRAMES_LABEL)) {
            fDTD = TemplateEditor.XHTML_FRAMESET;
        }

    }
}

From source file:com.iw.plugins.spindle.refactor.RenamedComponentOrPageRefactor.java

License:Mozilla Public License

private void updateProjectModel(HashMap confirmed) throws CoreException {

    IPreferenceStore store = TapestryPlugin.getDefault().getPreferenceStore();

    boolean renameAliases = RENAME_ALIASES.equals(store.getString(RENAME_ALIASES_BEHAVIOUR));

    IPluginLibrarySpecification refactorSpec = refactorer.getSpecification();

    for (Iterator iter = confirmed.keySet().iterator(); iter.hasNext();) {

        IFile element = (IFile) iter.next();
        String extension = element.getFileExtension();

        String tapestryPath = getTapestryPath(element);

        String alias = findAlias(tapestryPath, extension);

        if (alias != null) {

            IFile newFile = (IFile) confirmed.get(element);
            String newTapestryPath = getTapestryPath(newFile);

            if ("jwc".equals(extension)) {

                if (renameAliases) {

                    refactorSpec.removeComponentSpecificationPath(alias);

                    IPath path = newFile.getFullPath().removeFileExtension();
                    alias = path.lastSegment();

                }/*w w w.  jav a2 s . co  m*/

                refactorSpec.setComponentSpecificationPath(alias, newTapestryPath);

            } else {

                refactorSpec.setPageSpecificationPath(alias, newTapestryPath);

            }

        }

    }

    refactorer.commit(new NullProgressMonitor());
}

From source file:com.iw.plugins.spindle.ui.wizards.project.BaseTemplateSelectionPage.java

License:Mozilla Public License

/**
 * check that the workspace setting are valid.
 *///from  w  w  w. ja  v  a2  s.c  o m
private IStatus validateWorkspaceSettings() {
    IPreferenceStore store = UIPlugin.getDefault().getPreferenceStore();
    SpindleMultiStatus status = new SpindleMultiStatus();

    status.addStatus(
            XMLFileContextType.validateTemplateName(store, XMLFileContextType.APPLICATION_FILE_CONTEXT_TYPE,
                    store.getString(PreferenceConstants.APP_TEMPLATE)));

    status.addStatus(XMLFileContextType.validateTemplateName(store,
            XMLFileContextType.LIBRARY_FILE_CONTEXT_TYPE, store.getString(PreferenceConstants.LIB_TEMPLATE)));

    status.addStatus(
            XMLFileContextType.validateTemplateName(store, XMLFileContextType.COMPONENT_FILE_CONTEXT_TYPE,
                    store.getString(PreferenceConstants.COMPONENT_TEMPLATE)));

    status.addStatus(XMLFileContextType.validateTemplateName(store, XMLFileContextType.PAGE_FILE_CONTEXT_TYPE,
            store.getString(PreferenceConstants.PAGE_TEMPLATE)));

    status.addStatus(
            XMLFileContextType.validateTemplateName(store, XMLFileContextType.TEMPLATE_FILE_CONTEXT_TYPE,
                    store.getString(PreferenceConstants.TAP_TEMPLATE_TEMPLATE)));

    return status.getMostSevere(status.getChildren());

}

From source file:com.iw.plugins.spindle.util.Utils.java

License:Mozilla Public License

public static String[] getImportOrderPreference() {
    IPreferenceStore prefs = JavaPlugin.getDefault().getPreferenceStore();
    String str = prefs.getString(PreferenceConstants.ORGIMPORTS_IMPORTORDER);
    if (str != null) {
        return unpackOrderList(str);
    }//  www. j a  v  a 2 s .c  o m
    return new String[0];
}