Tabnine Logo
Controller.addOptionValidator
Code IndexAdd Tabnine 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)

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

  • Finding current android device location
  • getExternalFilesDir (Context)
  • setContentView (Activity)
  • findViewById (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now