예제 #1
0
 public static CodeAssistPreferences get() throws CoreException {
   final CodeAssistPreferences prefs = new CodeAssistPreferences();
   try {
     prefs.load();
   } catch (final BackingStoreException e1) {
     e1.printStackTrace();
     throw new CoreException(
         new Status(IStatus.ERROR, ErlangCore.PLUGIN_ID, "could not retrieve compiler options"));
   }
   return prefs;
 }
 @Override
 public boolean performOk() {
   try {
     prefs.setAutoActivate(autoActivateButton.getSelection());
     final Integer i = new Integer(delayText.getText());
     prefs.setDelayInMS(i.intValue());
     prefs.setErlangTriggers(erlangTriggersText.getText());
     prefs.seteDocTriggers(eDocTriggersText.getText());
     prefs.store();
   } catch (final BackingStoreException e) {
     ErlLogger.warn(e);
   }
   return super.performOk();
 }
 @Override
 protected void performDefaults() {
   prefs = new CodeAssistPreferences();
   try {
     prefs.load();
     if (autoActivateButton == null) {
       return;
     }
     autoActivateButton.setSelection(prefs.isAutoActivate());
     delayText.setText(Integer.toString(prefs.getDelayInMS()));
     erlangTriggersText.setText(prefs.getErlangTriggers());
     eDocTriggersText.setText(prefs.geteDocTriggers());
   } catch (final BackingStoreException e) {
     ErlLogger.warn(e);
   }
   super.performDefaults();
 }