Codota Logo
Controller.addOptionValidator
Code IndexAdd Codota to your IDE (free)

How to use
addOptionValidator
method
in
org.freeplane.features.mode.Controller

Best Java code snippets using org.freeplane.features.mode.Controller.addOptionValidator (Showing top 2 results out of 315)

  • Common ways to obtain Controller
private void myMethod () {
Controller c =
  • Codota IconController.getCurrentController()
  • Smart code suggestions by Codota
}
origin: freeplane/freeplane

private void addPropertiesToOptionPanel() {
  final URL preferences = this.getClass().getResource("preferences.xml");
  if (preferences == null)
    throw new RuntimeException("cannot open preferences");
  Controller.getCurrentController().addOptionValidator(new IValidator() {
    @Override
    public ValidationResult validate(Properties properties) {
      final ValidationResult result = new ValidationResult();
      final String readAccessString = properties
        .getProperty(ScriptingPermissions.RESOURCES_EXECUTE_SCRIPTS_WITHOUT_READ_RESTRICTION);
      final String writeAccessString = properties
      .getProperty(ScriptingPermissions.RESOURCES_EXECUTE_SCRIPTS_WITHOUT_WRITE_RESTRICTION);
      final String classpath = properties.getProperty(ScriptResources.RESOURCES_SCRIPT_CLASSPATH);
      final boolean readAccess = readAccessString != null && Boolean.parseBoolean(readAccessString);
      final boolean writeAccess = writeAccessString != null && Boolean.parseBoolean(writeAccessString);
      final boolean classpathIsSet = classpath != null && classpath.length() > 0;
      if (classpathIsSet && !readAccess) {
        result.addError(TextUtils.getText("OptionPanel.validate_classpath_needs_readaccess"));
      }
      if (writeAccess && !readAccess) {
        result.addWarning(TextUtils.getText("OptionPanel.validate_write_without_read"));
      }
      return result;
    }
  });
  final MModeController modeController = (MModeController) Controller.getCurrentModeController();
  modeController.getOptionPanelBuilder().load(preferences);
}
origin: freeplane/freeplane

public static void install(final FormatController formatController) {
  Controller.getCurrentController().addExtension(FormatController.class, formatController);
  Controller.getCurrentController().addOptionValidator(formatController.createValidator());
}
org.freeplane.features.modeControlleraddOptionValidator

Popular methods of Controller

  • getCurrentController
  • getCurrentModeController
  • getMap
  • getMapViewManager
  • getModeController
  • getViewController
  • getResourceController
  • getSelection
  • addApplicationLifecycleListener
  • getExtension
  • <init>
  • addAction
  • <init>,
  • addAction,
  • addActionIfNotAlreadySet,
  • addExtension,
  • addMapLifeCycleListener,
  • addModeController,
  • close,
  • closeAllMaps,
  • exec

Popular in Java

  • Start an intent from android
  • notifyDataSetChanged (ArrayAdapter)
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • JFileChooser (javax.swing)
  • JOptionPane (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now