Package com.jgoodies.binding.beans

Examples of com.jgoodies.binding.beans.BeanAdapter


    protected final BeanAdapter projectModel;
    protected final BeanAdapter orgModel;

    public GeneralInfoPanel(final PsiProject psiProject) {
        project = psiProject;
        projectModel = new BeanAdapter(project, true);
        orgModel = new BeanAdapter(project.getOrganization(), true);

        final VirtualFile virtualFile = project.getXmlFile().getVirtualFile();
        if (virtualFile == null)
            throw new IllegalStateException("PSI file has no virtual project.");
        final VirtualFile dir = virtualFile.getParent();
View Full Code Here


    protected final PsiProject project;
    protected final BeanAdapter model;

    public DeploymentPanel(final PsiProject psiProject) {
        project = psiProject;
        model = new BeanAdapter(project, true);

        layoutComponents();
        bindComponents();
    }
View Full Code Here

    /**
     * Creates an instance for the given project and document.
     */
    public SourcesPanel(final PsiProject pProject) {
        model = new BeanAdapter(pProject, true);

        resourcesPanel = new ResourcesPanel(pProject.getResources());
        layoutComponents();
        bindComponents();
    }
View Full Code Here

    /**
     * Creates an instance for the given file.
     */
    public TestingPanel(final PsiProject pProject) {
        final BeanAdapter model = new BeanAdapter(pProject, true);

        resources = new ResourcesPanel(pProject.getTestResources());
        Bindings.bind(testsSourceDirField,
                      model.getValueModel("unitTestSourceDirectory"));

        layoutComponents();
    }
View Full Code Here

    protected final PsiScmRepository scmRepository;
    protected final BeanAdapter model;

    public ScmPanel(final PsiProject pProject) {
        scmRepository = pProject.getScmRepository();
        model = new BeanAdapter(scmRepository, true);

        bindComponents();

        versionsPanel = new VersionsPanel(pProject);
        branchesPanel = new BranchesPanel(pProject);
View Full Code Here

    decimalFormat.setParseIntegerOnly(true);
    if (article != null) {
      articleName = article.getArticleName();

      //BeanAdapter beanAdapterArticle = new BeanAdapter(article);
      BeanAdapter beanAdapterArticle = new BeanAdapter(new IArticleModel(article));
      textFieldNumberOf = BasicComponentFactory.createFormattedTextField(
          //beanAdapterArticle.getValueModel("numberOfItemsLong"),
          beanAdapterArticle.getValueModel(IArticleModel.PROPERTY_NUMBER_OF_ITEMS_LONG),
          decimalFormat);

      textFieldOrder = BasicComponentFactory
          .createIntegerField(beanAdapterArticle
              .getValueModel("dialogOrder"));
    }
    if (attributes != null && attributes.size() != 0) {
      textFields = new LinkedHashMap<String, JTextField>();
      textFieldDialogOrders = new LinkedHashMap<String, JTextField>();
      checkBoxes = new LinkedHashMap<String, JCheckBox>();
      comboBoxes = new LinkedHashMap<String, JComboBox>();

      // g�r gjennom alle attributter og lager et tekstfelt, checkboks
      // eller comboboks for hver
      for (IArticleAttribute attribute : attributes) {
        BeanAdapter beanAdapter = new BeanAdapter(new IArticleAttributeModel(attribute), true);
        beans.add(beanAdapter);

        if (attribute.isYesNo()) {
          checkBoxes.put(attribute.getAttributeName(),
              BasicComponentFactory.createCheckBox(beanAdapter
                  //.getValueModel("attributeValueBool"), ""));
                  .getValueModel(IArticleAttributeModel.PROPERTY_ATTRIBUTE_VALUE_BOOL), ""));
          //beanAdapter.setValue("attributeValueBool", Boolean.FALSE);
          beanAdapter.setValue(IArticleAttributeModel.PROPERTY_ATTRIBUTE_VALUE_BOOL, Boolean.FALSE);
        } else if (attribute.getChoices() != null
            && attribute.getChoices().size() != 0) {
          comboBoxes.put(attribute.getAttributeName(),
              new JComboBox(new ComboBoxAdapter(attribute
                  .getChoices(), beanAdapter
                  //.getValueModel("attributeValue"))));
                  .getValueModel(IArticleAttributeModel.PROPERTY_ATTRIBUTE_VALUE))));
        } else {

          textFields.put(attribute.getAttributeName(),
              BasicComponentFactory.createTextField(beanAdapter
                  //.getValueModel("attributeValue")));
                  .getValueModel(IArticleAttributeModel.PROPERTY_ATTRIBUTE_VALUE)));

        }
          textFieldDialogOrders
              .put(
                  attribute.getAttributeName(),
                  BasicComponentFactory
                      .createIntegerField(beanAdapter
                          //.getValueModel("dialogOrderAttribute")));
                          .getValueModel(IArticleAttributeModel.PROPERTY_DIALOG_ORDER_ATTRIBUTE)));

      }
View Full Code Here

            Set<Head> headings = orderLineAttributes.keySet();
            Set<OrderLineAttribute> attributes;
            components = new LinkedHashMap<Head, Map<String, JComponent>>();
            Map<String, JComponent> comps;

            BeanAdapter beanAdapterAtt;
            for (Head head : headings) {
                attributes = orderLineAttributes.get(head);
                allAttributes.addAll(attributes);
                JComponent component;
                if (attributes != null && attributes.size() != 0) {
                    comps = new LinkedHashMap<String, JComponent>();

                    if (!head.getNameString().equalsIgnoreCase("Garasjetype")) {
                        beanAdapterAtt = new BeanAdapter(new IArticleAttributeModel(attributes.iterator()
                                .next()));

                        component = BasicComponentFactory.createFormattedTextField(beanAdapterAtt
                                .getValueModel(IArticleAttributeModel.PROPERTY_NUMBER_OF_ITEMS_LONG),
                                decimalFormat);
                        component.setName("TextFieldAntall");
                        comps.put("Antall", component);
                    }

                    AttributeChangeListener attributeChangeListener = new AttributeChangeListener();
                    for (IArticleAttribute att : attributes) {
                        beanAdapterAtt = new BeanAdapter(new IArticleAttributeModel(att));
                        beanAdapterAtt.addBeanPropertyChangeListener(attributeChangeListener);

                        if (att.isYesNo()) {
                            component = BasicComponentFactory.createCheckBox(beanAdapterAtt
                                    .getValueModel(IArticleAttributeModel.PROPERTY_ATTRIBUTE_VALUE_BOOL), "");
                            component.setName("CheckBox" + att.getAttributeName());
                            comps.put(att.getAttributeName(), component);
                        } else if (att.getChoices() != null && att.getChoices().size() != 0) {
                            component = new JComboBox(new ComboBoxAdapter(att.getChoices(), beanAdapterAtt
                                    .getValueModel(IArticleAttributeModel.PROPERTY_ATTRIBUTE_VALUE)));
                            component.setName("ComboBox" + att.getAttributeName());
                            comps.put(att.getAttributeName(), component);
                        } else {
                            component = createTextField(att, beanAdapterAtt);
View Full Code Here

      textFieldRed.setHorizontalAlignment(JTextField.CENTER);
      textFieldRed.setBackground(ColorEnum.RED.getColor());
        panelAssembliesMain = new JPanel(new BorderLayout());
        panelTeamsMain = new JPanel(new BorderLayout());
        yearWeek = new YearWeek();
        BeanAdapter yearWeekAdapter = new BeanAdapter(yearWeek, true);
        yearChooser = new JYearChooser();
        yearWeekAdapter.addPropertyChangeListener(viewHandler
                .getWeekChangeListener(yearWeek, window));
       
        orderPanelView=viewHandler.getOrderPanelView().buildPanel(window, "150",viewHandler.getRightClickListener(), "130", true);

        SelectionInList weekSelectionList = viewHandler
View Full Code Here

   */
  public JComboBox getComboBoxWeeks(WindowInterface window) {
    JComboBox comboBoxWeeks = BasicComponentFactory
        .createComboBox(weekSelectionList);
    comboBoxWeeks.setSelectedItem(Util.getCurrentWeek());
    BeanAdapter routeDateAdapter = new BeanAdapter(yearWeek, true);
    weekSelectionList.setSelectionHolder(routeDateAdapter
        .getValueModel(YearWeek.PROPERTY_WEEK));
    weekSelectionList
        .addValueChangeListener(new WeekChangeListener(window));
    comboBoxWeeks.setName("ComboBoxWeeks");
    return comboBoxWeeks;
View Full Code Here

    {
        FeedRenderingSettings feedRenderingSettings =
            GlobalModel.SINGLETON.getGlobalRenderingSettings();

        // Factory for valueModels corresponding to bean properties of GlobalRenderingSettings
        BeanAdapter globChannelRenderingAdapter = new BeanAdapter(feedRenderingSettings, true);

        ValueModel articleFilterModelHolder = globChannelRenderingAdapter.getValueModel("articleFilter");
        ValueModel articleViewModeHolder = GlobalModel.SINGLETON.getViewModeValueModel();

        ActionManager.register(CMD_ARTICLE_WHATIS,
            new ShowTipAction(TipOfTheDay.TIP_WHAT_IS_ARTICLE));
        ActionManager.register(CMD_ARTICLE_BROWSE, BrowseArticleAction.getInstance());
View Full Code Here

TOP

Related Classes of com.jgoodies.binding.beans.BeanAdapter

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.