Package org.eclipse.jface.preference

Examples of org.eclipse.jface.preference.IPreferenceStore


        return WidgetUtils.createComposite(parent, numCols);
    }

    private boolean loadBoolean(String name, boolean restoreDefault)
    {
        IPreferenceStore store = getPreferenceStore();
        return restoreDefault ? store.getDefaultBoolean(name) : store.getBoolean(name);
    }
View Full Code Here


        updateErrorMessage();
    }

    private String loadString(String name, String backup, boolean restoreDefault)
    {
        IPreferenceStore store = getPreferenceStore();
        String value = restoreDefault ? store.getDefaultString(name) : store.getString(name);
        return ("".equals(value) ? backup : value);
    }
View Full Code Here

        tasksReconciler = new TasksReconciler(this);
    }

    private void reconfigureBracketInserter()
    {
        IPreferenceStore preferenceStore = getPreferenceStore();

        bracketInserter.setCloseBracketsEnabled(
            preferenceStore.getBoolean(PreferenceConstants.AUTO_COMPLETION_BRACKET1));
        bracketInserter.setCloseBracesEnabled(
            preferenceStore.getBoolean(PreferenceConstants.AUTO_COMPLETION_BRACKET2));
        bracketInserter.setCloseParensEnabled(
            preferenceStore.getBoolean(PreferenceConstants.AUTO_COMPLETION_BRACKET3));
        bracketInserter.setCloseAngularBracketsEnabled(
            preferenceStore.getBoolean(PreferenceConstants.AUTO_COMPLETION_BRACKET4));
        bracketInserter.setCloseDoubleQuotesEnabled(
            preferenceStore.getBoolean(PreferenceConstants.AUTO_COMPLETION_QUOTE1));
        bracketInserter.setCloseSingleQuotesEnabled(
            preferenceStore.getBoolean(PreferenceConstants.AUTO_COMPLETION_QUOTE2));
    }
View Full Code Here

        cmdList.add("-html");
        cmdList.add("-opath");
        cmdList.add(outputDir);

        // Add additional options
        IPreferenceStore store = PerlEditorPlugin.getDefault().getPreferenceStore();
        StringTokenizer st =
            new StringTokenizer(store.getString(
                    SourceFormatterPreferences.HTML_EXPORT_OPTIONS));
        while (st.hasMoreTokens())
        {
            cmdList.add(st.nextToken());
        }
View Full Code Here

public class TestSmartTyping extends BasePDETestCase
{
    public void testAll() throws Exception
    {
        IPreferenceStore prefs = PerlEditorPlugin.getDefault().getPreferenceStore();
       
        boolean p1 = prefs.getBoolean(PreferenceConstants.AUTO_COMPLETION_BRACKET1);
        boolean p2 = prefs.getBoolean(PreferenceConstants.AUTO_COMPLETION_BRACKET2);
        boolean p3 = prefs.getBoolean(PreferenceConstants.AUTO_COMPLETION_BRACKET3);
        boolean p4 = prefs.getBoolean(PreferenceConstants.AUTO_COMPLETION_BRACKET4);
        boolean p5 = prefs.getBoolean(PreferenceConstants.AUTO_COMPLETION_QUOTE1);
        boolean p6 = prefs.getBoolean(PreferenceConstants.AUTO_COMPLETION_QUOTE2);
   
        try { _testAll(); }
        finally
        {
            prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET1, p1);
            prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET2, p2);
            prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET3, p3);
            prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET4, p4);
            prefs.setValue(PreferenceConstants.AUTO_COMPLETION_QUOTE1, p5);
            prefs.setValue(PreferenceConstants.AUTO_COMPLETION_QUOTE2, p6);
        }
    }
View Full Code Here

        }
    }
   
    private void _testAll() throws Exception
    {
        IPreferenceStore prefs = PerlEditorPlugin.getDefault().getPreferenceStore();
       
        prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET1, true);
        prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET2, true);
        prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET3, true);
        prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET4, true);
        prefs.setValue(PreferenceConstants.AUTO_COMPLETION_QUOTE1, true);
        prefs.setValue(PreferenceConstants.AUTO_COMPLETION_QUOTE2, true);
       
        PerlEditor editor = openEditor("EPICTest/empty.pl");
        PerlEditor.TestInterface testIface = editor.getTestInterface();
       
        try
        {  
            Keyboard.typeString("}");           
            assertEquals("}", testIface.getText());

            testIface.clear();
           
            Keyboard.typeString("{");
            assertEquals("{}", testIface.getText());
            Keyboard.typeString("{");
            assertEquals("{{}}", testIface.getText());
            Keyboard.typeString("}");
            Keyboard.typeString("}");
            assertEquals("{{}}", testIface.getText());

            testIface.clear();
           
            Keyboard.typeString("my @x = (foo");
            assertEquals("my @x = (foo)", testIface.getText());
            Keyboard.typeString(";");
            assertEquals("my @x = (foo;)", testIface.getText());
            Keyboard.backspace();
            assertEquals("my @x = (foo)", testIface.getText());
            Keyboard.typeString(")");
            assertEquals("my @x = (foo)", testIface.getText());
            Keyboard.typeString(";");
            assertEquals("my @x = (foo);", testIface.getText());
           
            testIface.clear();
           
            Keyboard.typeString("print aaa");
            assertEquals("print aaa", testIface.getText());
            Keyboard.left();
            Keyboard.left();
            Keyboard.left();
            Keyboard.typeString("'");
            assertEquals("print ''aaa", testIface.getText());
            Keyboard.backspace();
            assertEquals("print 'aaa", testIface.getText());
            Keyboard.right();
            Keyboard.right();
            Keyboard.right();
            Keyboard.right();
            Keyboard.typeString("'");
            assertEquals("print 'aaa'", testIface.getText());
            Keyboard.left();
            Keyboard.typeString("'");
            Keyboard.typeString(";");
            assertEquals("print 'aaa';", testIface.getText());
           
            testIface.clear();
           
            Keyboard.typeString("# ' ok {");
            assertEquals("# ' ok {}", testIface.getText());
           
            testIface.clear();
           
            Keyboard.typeString("=comment\nLet's go");
            assertEquals("=comment\nLet's go", testIface.getText());
           
            testIface.clear();
            prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET2, false);

            Keyboard.typeString(" ");
            Keyboard.left();
            Keyboard.typeString("${()");
View Full Code Here

public class TestTasks extends BasePDETestCase
{
    public void testAll() throws Exception
    {
        IPreferenceStore prefs = PerlEditorPlugin.getDefault().getPreferenceStore();
       
        boolean p1 = prefs.getBoolean(TaskTagPreferences.ID_WHITESPACE);
   
        try { _testAll(); }
        finally
        {
            prefs.setValue(TaskTagPreferences.ID_WHITESPACE, p1);
        }
    }
View Full Code Here

        }
    }
   
    private void _testAll() throws Exception
    {
        IPreferenceStore prefs = PerlEditorPlugin.getDefault().getPreferenceStore();
       
        prefs.setValue(TaskTagPreferences.ID_WHITESPACE, true);
       
        PerlEditor editor = openEditor("EPICTest/test_Tasks.pl");
       
        try
        {
View Full Code Here

  }

  public static List<CloudServerURL> getUserDefinedUrls(String serverTypeId) {
    List<CloudServerURL> urls = new ArrayList<CloudServerURL>();

    IPreferenceStore prefStore = CloudFoundryServerUiPlugin.getDefault().getPreferenceStore();
    String urlString = prefStore.getString(ATTR_USER_DEFINED_URLS + "." + serverTypeId); //$NON-NLS-1$

    if (urlString != null && urlString.length() > 0) {
      // Split on "||"
      String[] urlEntries = urlString.split("\\|\\|"); //$NON-NLS-1$
      if (urlEntries != null) {
View Full Code Here

    return urls;
  }

  public static void storeUserDefinedUrls(String serverTypeId, List<CloudServerURL> urls) {
    IPreferenceStore prefStore = CloudFoundryServerUiPlugin.getDefault().getPreferenceStore();
    StringBuilder builder = new StringBuilder();

    for (CloudServerURL url : urls) {
      if (url.getUserDefined()) {
        builder.append(url.getName());

        builder.append(","); //$NON-NLS-1$
        builder.append(url.getUrl());

        builder.append("||"); //$NON-NLS-1$
      }
    }

    prefStore.setValue(ATTR_USER_DEFINED_URLS + "." + serverTypeId, builder.toString()); //$NON-NLS-1$
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.preference.IPreferenceStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.