Package org.freeplane.core.resources.components

Examples of org.freeplane.core.resources.components.OptionPanelBuilder$Path


      throw new RuntimeException("Failed to add routes for " + routeControllerClass + ".", t);
    }

    for (Method routeMethod : routeControllerClass.getDeclaredMethods()) {
      String routeMethodName = routeMethod.getName();
      Path pathAnnotation = routeMethod.getAnnotation(Path.class);
      Paths pathsAnnotation = routeMethod.getAnnotation(Paths.class);
      if (pathAnnotation != null || pathsAnnotation != null) {
        String actionName;
        if (routeMethodName.endsWith("Action")) {
          actionName = routeMethodName.substring(0, routeMethodName.length() - "Action".length());
        }
        else {
          actionName = routeMethodName;
        }

        ERXRoute.Method method = null;
        // Search annotations for @PUT, @GET, etc.
        for (Annotation annotation : routeMethod.getAnnotations()) {
          HttpMethod httpMethod = annotation.annotationType().getAnnotation(HttpMethod.class);
          if (httpMethod != null) {
            if (method == null) {
              method = httpMethod.value();
            }
            else {
              throw new IllegalArgumentException(routeControllerClass.getSimpleName() + "." + routeMethod.getName() + " is annotated as more than one http method.");
            }
          }
        }

        // Finally default declared REST actions to @GET
        if (method == null) {
          method = ERXRoute.Method.Get;
        }

        if (pathAnnotation != null) {
          addRoute(new ERXRoute(entityName, pathAnnotation.value(), method, routeControllerClass, actionName));
          declaredRoutesFound = true;
        }
        if (pathsAnnotation != null) {
          for (Path path : pathsAnnotation.value()) {
            addRoute(new ERXRoute(entityName, path.value(), method, routeControllerClass, actionName));
View Full Code Here


    }
  }

  private void createPreferences() {
    final MModeController modeController = (MModeController) Controller.getCurrentModeController();
    final OptionPanelBuilder optionPanelBuilder = modeController.getOptionPanelBuilder();
    optionPanelBuilder.addCreator("Environment/load", new IPropertyControlCreator() {
      public IPropertyControl createControl() {
        final Set<String> charsets = Charset.availableCharsets().keySet();
        final LinkedList<String> charsetList = new LinkedList<String>(charsets);
        charsetList.addFirst("JVMdefault");
        final LinkedList<String> charsetTranslationList = new LinkedList<String>(charsets);
View Full Code Here

    addAction(new SelectAllAction());
    addAction(new SaveAcceleratorPresetsAction());
  }

  private void createOptionPanelControls() {
    optionPanelBuilder = new OptionPanelBuilder();
    final ResourceController resourceController = ResourceController.getResourceController();
    URL preferences = resourceController.getResource("/xml/preferences.xml");
    optionPanelBuilder.load(preferences);
    addAction(createPropertyAction(optionPanelBuilder));
  }
View Full Code Here

    }
  }

  private void createPreferences() {
    final MModeController modeController = (MModeController) Controller.getCurrentModeController();
    final OptionPanelBuilder optionPanelBuilder = modeController.getOptionPanelBuilder();
    final List<AFreeplaneAction> actions = new ArrayList<AFreeplaneAction>();
    actions.addAll(iconActions.values());
    actions.add(modeController.getAction("RemoveIcon_0_Action"));
    actions.add(modeController.getAction("RemoveIconAction"));
    actions.add(modeController.getAction("RemoveAllIconsAction"));

    for (final AFreeplaneAction iconAction : actions) {
      final IIconInformation info = (IIconInformation) iconAction;
      optionPanelBuilder.addCreator("Keystrokes/icons", new IPropertyControlCreator() {
        public IPropertyControl createControl() {
          final KeyProperty keyProperty = new KeyProperty(info.getShortcutKey(), info.getTranslationKeyLabel());
          keyProperty.setImageIcon(info.getIcon());
          keyProperty.disableModifiers();
          return keyProperty;
View Full Code Here

        final AddOnProperties addOn = tableModel.getAddOnAt(row);
        if (!addOn.supportsOperation(AddOnProperties.OP_CONFIGURE)) {
          JOptionPane.showMessageDialog(ManageAddOnsPanel.this, getText("cannot.configure", addOn.getTranslatedName()), "Freeplane", JOptionPane.ERROR_MESSAGE);
        }
        else {
          OptionPanelBuilder optionPanelBuilder = new OptionPanelBuilder();
          optionPanelBuilder.load(new StringReader(addOn.getPreferencesXml()));
          MModeController.createPropertyAction(optionPanelBuilder).actionPerformed(e);
        }
      }
    };
  }
View Full Code Here

      throw new ParserException("Reached end of xml document unexpectedly");
   }

   private Icon parseIcon(XMLStreamReader reader) throws XMLStreamException, ParserException
   {
      Path largeIcon = null;
      Path smallIcon = null;

      //getting attributes
      String id = reader.getAttributeValue(null, Icon.Attribute.ID.getLocalName());
      String lang = reader.getAttributeValue(null, Icon.Attribute.ID.getLocalName());
View Full Code Here

TOP

Related Classes of org.freeplane.core.resources.components.OptionPanelBuilder$Path

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.