コード例 #1
0
    @Override
    protected void doLoad() {
      super.doLoad();

      if (Codec.XUGGLER
              .name()
              .equals(getPreferenceStore().getString(PreferenceConstants.ENCODING_CODEC))
          && !XugglerEncoder.isInstalled())
        getPage().setErrorMessage(XUGGLER_NOT_INSTALLED_MESSAGE);
    }
コード例 #2
0
  public static void checkXugglerInstallationOnPropertyChange(
      FieldEditorPreferencePage page, PropertyChangeEvent event) {
    if (event.getSource() instanceof FieldEditor) {
      FieldEditor field = (FieldEditor) event.getSource();

      if (field.getPreferenceName().equals(PreferenceConstants.ENCODING_CODEC)) {
        if (event.getNewValue() instanceof String) {
          String newValue = (String) event.getNewValue();
          if (newValue.equals(Codec.XUGGLER.name())) {
            checkXugglerInstallation(page);
          } else {
            page.setErrorMessage(null);
          }
        }
      }
    }
  }