Package pl.net.bluesoft.rnd.util.i18n

Examples of pl.net.bluesoft.rnd.util.i18n.I18NSource


        return vl;

  }

    private VerticalLayout prepareAssignmentLayout() {
      I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
     
      assigneeField = new TextField();//Messages.getString("field.assignee"));
        assigneeField.setWidth("100%");
        assigneeField.setNullRepresentation("");
       
        candidateGroupsField = new TextField();//Messages.getString("field.candidateGroups"));
        candidateGroupsField.setWidth("100%");
        candidateGroupsField .setNullRepresentation("");
       
        swimlaneField = new TextField();//Messages.getString("field.swimlane"));
        swimlaneField.setWidth("100%");
        swimlaneField.setNullRepresentation("");
       
        VerticalLayout assignmentLayout = new VerticalLayout();
        assignmentLayout.setWidth("100%");
        assignmentLayout.setSpacing(true);
        assignmentLayout.setMargin(true);
        assignmentLayout.addComponent(styled(new Label(messages.getMessage("field.assignee")), "h1"));
        assignmentLayout.addComponent(htmlLabel(messages.getMessage("field.assignee.info")));
        assignmentLayout.addComponent(assigneeField);
        assignmentLayout.addComponent(styled(new Label(messages.getMessage("field.candidateGroups")), "h1"));
        assignmentLayout.addComponent(htmlLabel(messages.getMessage("field.candidateGroups.info")));
        assignmentLayout.addComponent(candidateGroupsField);
        assignmentLayout.addComponent(styled(new Label(messages.getMessage("field.swimlane")), "h1"));
        assignmentLayout.addComponent(htmlLabel(messages.getMessage("field.swimlane.info")));
        assignmentLayout.addComponent(swimlaneField);
        return assignmentLayout;
    }
View Full Code Here


        initComponent();
        initLayout();
    }

    private void initComponent() {
        I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
        queueDescriptionField = new TextField();
        queueDescriptionField.setWidth("75%");
        queueDescriptionField.setNullRepresentation("");
        queueDescriptionField.setInputPrompt(messages.getMessage("queue.editor.description.prompt"));
        queueDescriptionField.addListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(Property.ValueChangeEvent event) {
                queue.setDescription((String) queueDescriptionField.getValue());
            }
        });

        roleNameComboBox = new RoleNameComboBox();
        roleNameComboBox.setHandler(this);

        queueNameLabel = new Label("<h2>" + queue.getName() + "</h2>");
        queueNameLabel.setContentMode(Label.CONTENT_XHTML);
       
        removeQueueButton = VaadinUtility.button(messages.getMessage("  X  "), new Runnable() {
            @Override
            public void run() {
                handler.removeQueue(queue);
            }
        });
       
        roleNameDescription = new Label(messages.getMessage("queue.editor.assigned.roles"));
       
        rolePermissionLayout = new CssLayout() {
            @Override
            protected String getCss(Component c) {
                if (c instanceof QueueRolePermissionBox) {
View Full Code Here

        }
        return widgetItems;
    }

    private VerticalLayout buildWidgetEditorTabContent() {
      I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
      VerticalLayout availableWidgetsLayout = new VerticalLayout();
        availableWidgetsLayout.setSpacing(true);
        availableWidgetsLayout.setWidth("100%");
        availableWidgetsLayout.addComponent(availableWidgetsPane);
        VerticalLayout stepLayout = new VerticalLayout();
        stepLayout.setWidth("100%");
        stepLayout.setSpacing(true);
        stepLayout.setMargin(true);
        stepLayout.addComponent(new Label(messages.getMessage("userstep.editor.widgets.instructions"), Label.CONTENT_XHTML));
        stepLayout.addComponent(availableWidgetsLayout);
        Panel treePanel = new Panel();
        treePanel.setStyleName(Reindeer.PANEL_LIGHT);
        treePanel.addComponent(stepTree);
        treePanel.setWidth("245px");
View Full Code Here

        stepLayout.setExpandRatio(treeAndParamLayout, 1.0f);
        return stepLayout;
    }

    private VerticalLayout buildStateDefinitionLayout() {
        I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();

        descriptionField = new TextField();
        descriptionField.setNullRepresentation("");
        descriptionField.setWidth("100%");
       
        commentaryTextArea = new RichTextArea();
        commentaryTextArea.setNullRepresentation("");
        commentaryTextArea.setWidth("100%");

        VerticalLayout stateLayout = new VerticalLayout();
        stateLayout.setWidth("100%");
        stateLayout.setSpacing(true);
        stateLayout.setMargin(true);

        stateLayout.addComponent(styled(new Label(messages.getMessage("field.description")), "h1"));
        stateLayout.addComponent(htmlLabel(messages.getMessage("field.description.info")));
        stateLayout.addComponent(descriptionField);

        stateLayout.addComponent(styled(new Label(messages.getMessage("field.commentary")), "h1"));
        stateLayout.addComponent(htmlLabel(messages.getMessage("field.commentary.info")));
        stateLayout.addComponent(commentaryTextArea);

        return stateLayout;
    }
View Full Code Here

        return stateLayout;
    }

    public void deleteTreeItem(final Object widget) {
      I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
      ConfirmDialog.show(application.getMainWindow(),
          messages.getMessage("dialog.delete.title"),
          messages.getMessage("dialog.delete.question"),
          messages.getMessage("dialog.delete.confirm"),
          messages.getMessage("dialog.delete.cancel"),
                new ConfirmDialog.Listener() {
                    public void onClose(ConfirmDialog dialog) {
                        if (dialog.isConfirmed()) {
                            HierarchicalContainer hc = (HierarchicalContainer) stepTree.getContainerDataSource();
                            hc.removeItemRecursively(widget);
View Full Code Here

    return getResource("icon.widget.default");
  }

  private Resource getResource(String pathKey) {
    I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
    final String path = messages.getMessage(pathKey);
    final InputStream stream = getClass().getClassLoader().getResourceAsStream(path);
    if (stream != null) {
      String[] pathParts = path.split("/");
      return new StreamResource(new StreamResource.StreamSource() {
        @Override
View Full Code Here

      deleteTreeItem(target);
    }
  }

  private void loadJSONConfig() {
    I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
   
    try {
      Map<String, String> map = JSONHandler.loadConfig(stepTreeContainer, rootItem, jsonConfig, permissions);
      if (stepTree != null) {
        stepTree.expandItemsRecursively(rootItem);
      }

      assigneeField.setValue(map.get(JSONHandler.ASSIGNEE));
      swimlaneField.setValue(map.get(JSONHandler.SWIMLANE));
      candidateGroupsField.setValue(map.get(JSONHandler.CANDIDATE_GROUPS));
            commentaryTextArea.setValue(map.get(JSONHandler.COMMENTARY));
            descriptionField.setValue(map.get(JSONHandler.DESCRIPTION));

      for (Object widget : stepTreeContainer.getItemIds()) {
        if (widget != rootItem) {
          stepTree.getItem(widget).getItemProperty("icon").setValue(getWidgetIcon(((WidgetItemInStep) widget).getWidgetItem()));
                }
            }
    } catch (WidgetNotFoundException e) {
      logger.log(Level.SEVERE, "Widget not found", e);
      application.getMainWindow().showNotification(messages.getMessage("error.config_not_loaded.title"),
          messages.getMessage("error.config_not_loaded.widget_not_found.body", e.getWidgetItemName()),
                        Notification.TYPE_ERROR_MESSAGE);
    } catch (ParsingFailedException e) {
            logger.log(Level.SEVERE, "Parsing failed found", e);
      application.getMainWindow().showNotificationmessages.getMessage("error.config_not_loaded.title"),
          messages.getMessage("error.config_not_loaded.unexpected_error.body", e.getLocalizedMessage()),
                        Notification.TYPE_ERROR_MESSAGE);
    }
  }
View Full Code Here

                        Notification.TYPE_ERROR_MESSAGE);
    }
  }

  private HierarchicalContainer prepareTreeContainer() {
    I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
    stepTreeContainer = new HierarchicalContainer();
    stepTreeContainer.addContainerProperty("name", String.class, messages.getMessage("stepTree.name.default"));
    stepTreeContainer.addContainerProperty("icon", Resource.class, getResource("icon.widget.default"));

    final WidgetItem widgetItem = new WidgetItem(
                "ROOT",
                messages.getMessage("stepTree.root.name"),
                messages.getMessage("stepTree.root.description"),
                null,
        null,
                new ArrayList<PermissionDefinition>(),
                true,
                null
View Full Code Here

            if (propertiesPanel != null) {
                widgetInStep.getWidgetPropertiesPanel().ensureForm();

                PropertiesForm propertiesForm = propertiesPanel.getPropertiesForm();
                if (!propertiesForm.isValid()) {
                    I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
                    VaadinUtility.validationNotification(
                            application,
                            messages,
                            messages.getMessage("stepTree.contains.invalid")
                    );

                    // switch to problematic widget
                    paramPanel.loadWidget(widgetInStep, false);
                    stepTree.setValue(widgetInStep);
View Full Code Here

        privilegeNameEditors = new ArrayList<PrivilegeNameEditor>();
        initComponent();
    }

    private void initComponent() {
        I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
       
        descriptionLabel = new Label(messages.getMessage("permission.editor.description"));
   
        newPrivilegeNameField = new TextField();
        newPrivilegeNameField.setNullRepresentation("");
       
        newPrivilegeNameButton = VaadinUtility.button(
                messages.getMessage("permission.editor.new.privilege"),
                new Runnable() {
                    @Override
                    public void run() {
                        String privilegeName = (String) newPrivilegeNameField.getValue();
                        PermissionDefinition definition = new PermissionDefinition(privilegeName);
View Full Code Here

TOP

Related Classes of pl.net.bluesoft.rnd.util.i18n.I18NSource

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.