Package de.iritgo.aktario.core.resource

Examples of de.iritgo.aktario.core.resource.ResourceService


  @Override
  public void initGUI()
  {
    try
    {
      final ResourceService resources = Engine.instance().getResourceService();
      SwingEngine swingEngine = new SwingEngine(this);

      AddressClientManager acm = (AddressClientManager) Engine.instance().getManager(AddressClientManager.ID);

      columns = acm.getAddressTableColumns();

      JPanel panel = (JPanel) swingEngine.render(getClass().getResource("/swixml/AddressQueryPane.xml"));

      content.add(panel, createConstraints(0, 0, 1, 1, GridBagConstraints.BOTH, 100, 100, null));

      search.idle();

      AddressTableCellRenderer renderer = new AddressTableCellRenderer();
      AddressTableModel model = new AddressTableModel();

      addressTable.setModel(model);
      addressTable.getColumnModel().getColumn(0).setMinWidth(0);
      addressTable.getColumnModel().getColumn(0).setMaxWidth(0);

      for (int i = 1; i < model.getColumnCount(); ++i)
      {
        addressTable.getColumnModel().getColumn(i).setCellRenderer(renderer);
      }

      addressTable.addMouseListener(new AddressTableMouseListener());

      for (int i : new IntRange(0, columns.size() - 1))
      {
        ITableColumn c = columns.get(i);

        if (StringTools.isTrimEmpty(c.getTitle().get()))
        {
          if (c.getCellIcon() != null)
          {
            addressTable.getColumnModel().getColumn(i).setMinWidth(c.getCellIcon().getIconWidth() + 4);
            addressTable.getColumnModel().getColumn(i).setMaxWidth(c.getCellIcon().getIconWidth() + 4);
          }
          else
          {
            addressTable.getColumnModel().getColumn(i).setMinWidth(4);
            addressTable.getColumnModel().getColumn(i).setMaxWidth(4);
          }
        }
      }

      TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>();

      addressTable.setRowSorter(sorter);
      sorter.setModel(model);

      addressStore.addActionListener(new ActionListener()
      {
        public void actionPerformed(ActionEvent e)
        {
          search(IComboBoxIdItem.getSelectedId(addressStore).toString(), searchText.getText());
        }
      });

      searchText.grabFocus();

      new Thread()
      {
        @Override
        public void run()
        {
          search.busy();

          AddressClientService acs = (AddressClientService) Engine.instance().getManager(
                  AddressClientService.ID);

          for (final AddressStore ads : acs.listAddressStores())
          {
            SwingUtilities.invokeLater(new Runnable()
            {
              public void run()
              {
                addressStore.addItem(new IComboBoxIdItem(ads.getName(), resources
                        .getStringWithoutException(ads.getTitle())));
              }
            });
          }
View Full Code Here

TOP

Related Classes of de.iritgo.aktario.core.resource.ResourceService

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.