Package net.helipilot50.stocktrade.framework

Examples of net.helipilot50.stocktrade.framework.ParameterHolder


        if (logger.isDebugEnabled()) {
          logger.debug("Mapping Row to Object [" + beanWrapper.getWrappedClass().getName() + "]");
        }

        for (int i = 0; i < columnNamesToMap.length; i++) {
          ParameterHolder beanWrapperHolder = new ParameterHolder(beanWrapper);
            PropertyDescriptor descriptor = getDescriptorAndBeanForColumnName(columnNamesToMap[i], beanWrapperHolder);
            BeanWrapper localWrapper = ((BeanWrapper) beanWrapperHolder.getObject());

            if (descriptor == null) {
                logger.error("Skipping unknown property \"" + columnNamesToMap[i] + "\"");
                continue;
            }
View Full Code Here


            modifiers = modifiers | Constants.KM_ALT_OPTION;
        if ((e.getModifiers() & ActionEvent.META_MASK) > 0)
            modifiers = modifiers | Constants.KM_CMD;

        Hashtable qq_Params = new Hashtable();
        qq_Params.put( "keyID", new ParameterHolder(this.keyID) );
        qq_Params.put( "modifier", new ParameterHolder(modifiers) );
        FocusHelper.functionKeyActivate(new EventHandle(sink, "FunctionKeyPress", qq_Params));
        // AD:2/9/2008 If the F1 key is pressed also post HelpRequest to be consistent with Forte
        // Investigated using a separate KeyAction and KeyListeners but neither functioned exactly like Forte.
        // Having a separate HelpRequestKeyAction overrode the FunctionKeyPress.
        // KeyListeners needed to have focus to work correctly.
View Full Code Here

        super();
    }

    public boolean process(EventHandle pHandle) {
        if (pHandle.getParameters() != null){
            ParameterHolder rowHolder = (ParameterHolder)pHandle.getParameter("row");
            if (rowHolder != null)
                UIutils.currentRow.set(new Integer(rowHolder.getInt()));
        }
        return true;
    }
View Full Code Here

@Deprecated
public class TabFolderChangeListener implements ChangeListener {

    public void stateChanged(ChangeEvent arg0) {
        Hashtable<String, ParameterHolder> qq_Params = new Hashtable<String, ParameterHolder>();
        qq_Params.put( "index", new ParameterHolder(((JTabbedPane)arg0.getSource()).getSelectedIndex()) );
        qq_Params.put( "page", new ParameterHolder(((JTabbedPane)arg0.getSource()).getSelectedComponent()) );
        ClientEventManager.postEvent(arg0.getSource(), "AfterTabSelect", qq_Params);

    }
View Full Code Here

    }

  static Hashtable<String, Object> makeParamList(int X, int Y, int mod, JComponent pControl, boolean pIsChildEvent){
        Hashtable<String, Object> params = new Hashtable<String, Object>();
        if (pIsChildEvent) {
            params.put("child", new ParameterHolder(pControl));
        }
        params.put( "x", new ParameterHolder(UIutils.pixelsToMils(X)));
        params.put( "y", new ParameterHolder(UIutils.pixelsToMils(Y)));
        int modifiers = 0;
        if ((mod & ActionEvent.CTRL_MASK) > 0)
            modifiers = modifiers | Constants.KM_CTRL;
        if ((mod & ActionEvent.SHIFT_MASK) > 0)
            modifiers = modifiers | Constants.KM_SHIFT;
        if ((mod & ActionEvent.ALT_MASK) > 0)
            modifiers = modifiers | Constants.KM_ALT_OPTION;
        if ((mod & ActionEvent.META_MASK) > 0)
            modifiers = modifiers | Constants.KM_CMD;
        params.put( "modifier", new ParameterHolder(modifiers) );

        // Set nodes and rows and columns on relevant controls

        if (pControl != null && pControl instanceof OutlineFieldJTree) {
            OutlineFieldJTree tree = (OutlineFieldJTree)pControl;
            OutlineField control = (OutlineField)tree.getOutlineField();

            // TF:27/9/07:Made the row and column 1-based indexes instead of 0-based and used Craig's new method. We need to translate
            // the X-offset by the amount the tree is indented.
            params.put("column", new ParameterHolder(control.getColumnIndex(X + OutlineField.cHEADER_MARGIN_LEFT) + 1));
            params.put( "node", new ParameterHolder(((OutlineFieldJTree)pControl).getLastSelectedPathComponent()) );
            params.put( "row", new ParameterHolder(((OutlineFieldJTree)pControl).getRowForLocation(X, Y)+1) ); //CONV_REM: dc - added row parameter

        }
        else if (pControl != null && pControl instanceof JListView) {
            params.put( "node", new ParameterHolder(((JListView)pControl).getCurrentNode()) );
            params.put( "row", new ParameterHolder(0) );
            params.put( "column", new ParameterHolder(0) );
        }
        else if (pControl != null && pControl instanceof ListView) {
            ListView list = (ListView)pControl;
            params.put( "node", new ParameterHolder(((ListView)pControl).getCurrentNode()) );
            // TF:27/9/07:Made the row and column 1-based indexes instead of 0-based
            // TF:26/3/08:getSelectedRow has changed to be 1-based itself, so we need to change this back to remove the +1
            params.put( "row", new ParameterHolder(list.getSelectedRow()));
//            qq_Params.put( "column", new ParameterHolder(0) );
            params.put( "column", new ParameterHolder(list.getTable().getSelectedColumn()+1) );//CONV_REM:dq Need the column that was selected, not a 0.
        }
        else if (pControl != null && pControl instanceof JTable)
        {
            JTable table = (JTable)pControl;
            if (table.getModel() instanceof TableSorter) {
                DisplayNode dn = ((DisplayNode)((ArrayFieldModel)((TableSorter)table.getModel()).getTableModel()).getData().get(table.getSelectedRow()));
                params.put( "node", new ParameterHolder(dn) );
            }
            else {
                params.put( "node", new ParameterHolder(null) );
            }
            // TF:23/9/07:We need to return the X and Y coordinates with respect to the cell, not the table. Also, we need
            // to change the child to the renderer or editor for that cell.
            Point loc = new Point(X, Y);
            int row = table.rowAtPoint(loc);
            int column = table.columnAtPoint(loc);
            // TF:27/9/07:Made the row and column 1-based indexes instead of 0-based
            params.put( "row", new ParameterHolder(row+1) );
            params.put( "column", new ParameterHolder(column+1) );

            // make sure we have a valid cell, just in case they click outside the table, eg in the empty scroll pane.
            if (row >= 0 && column >= 0) {
                Rectangle cellBounds = table.getCellRect(row, column, false);
                X -= cellBounds.x;
                Y -= cellBounds.y;

                TableCellRenderer renderer = table.getCellRenderer(row, column);
                if (renderer != null) {
                    Component c = renderer.getTableCellRendererComponent(table, table.getValueAt(row, column), false, false, row, column);
                    params.put("child", new ParameterHolder(c));
                }
            }
        }
        else if (pControl != null && pControl instanceof JTree)
        {
          JTree tree = (JTree) pControl;
            int currentRow = getRowForLocation(Y, tree);
            // TF:27/9/07:Made the row and column 1-based indexes instead of 0-based
            params.put( "row", new ParameterHolder(currentRow+1) );
            TreePath path = tree.getPathForRow(currentRow);
            if (path != null) {
              params.put("node", new ParameterHolder(path.getLastPathComponent()));
            }
            else {
              params.put("node", new ParameterHolder(null));
            }
        }
        else if (pControl instanceof OutlineField) {
          OutlineField outlineField = (OutlineField) pControl;
            int currentRow = getRowForLocation(Y, outlineField.getTree());
            TreePath path = outlineField.getTree().getPathForRow(currentRow);
            if (path != null) {
              params.put("node", new ParameterHolder(path.getLastPathComponent()));
            }
            else {
              params.put("node", new ParameterHolder(null));
            }
            // TF:27/9/07:Made the row and column 1-based indexes instead of 0-based, plus used Craig's new method
            params.put("row", new ParameterHolder(currentRow+1));
            params.put("column", new ParameterHolder(outlineField.getColumnIndex(X + OutlineField.cCOLUMN_SPACING)+1));
            params.put("sizes", new ParameterHolder(outlineField.getColumnSizes()));
            params.put("spacing", new ParameterHolder(OutlineField.cCOLUMN_SPACING));
        }
        else if (pControl instanceof MultiLineTextField){
            MultiLineTextField field = (MultiLineTextField)pControl;
            try {
                int offset = field.getCaretPosition()-1;
                int lRow = field.getLineOfOffset(offset);
                int lCol = offset - field.getLineStartOffset(lRow);
                params.put("row", new ParameterHolder(lRow));
                params.put("column", new ParameterHolder(lCol));
            }
            catch (BadLocationException ble) {
                Logger.getLogger(ClickListener.class).error("Bad location for text field", ble);
                params.put("row", new ParameterHolder(0));
                params.put("column", new ParameterHolder(0));
            }
        }
        // Handle a PaletteList.  CraigM: 22/04/2008
        else if (pControl instanceof PaletteList) {
          PaletteList pl = (PaletteList)pControl;
          Component comp = pl.getComponentAt(X, Y);
          if (comp instanceof JToggleButton) {
                params.put( "row", new ParameterHolder(pl.getIndexValue((JToggleButton)comp)));
          }
          else {
                params.put( "row", new ParameterHolder(0) );
          }
            params.put( "column", new ParameterHolder(0) );
            params.put( "node", new ParameterHolder(null) );
        }
        else
        {
            params.put( "row", new ParameterHolder(0) );
            params.put( "column", new ParameterHolder(0) );
            params.put( "node", new ParameterHolder(null) );
        }

        return params;
    }
View Full Code Here

    }

    public void actionPerformed(ActionEvent e) {
        if (((JComponent)e.getSource()).isEnabled()) {
            Hashtable<String, Object> qq_Params_child = new Hashtable<String, Object>();
            qq_Params_child.put("Child", new ParameterHolder(e.getSource()));
            ChildEventHelper.postEventToAllParents((JComponent)e.getSource(), "ChildActivate", qq_Params_child);
        }
    }
View Full Code Here

    }

    private void fireCollapsed(TreeExpansionEvent event) {
        Hashtable<String, Object> qq_Params = new Hashtable<String, Object>();
        DisplayNode dn  = ((DisplayNode)event.getPath().getPath()[event.getPath().getPathCount()-1]);
        qq_Params.put( "Folder", new ParameterHolder(dn) );
        ClientEventManager.postEvent( this, "RequestFolderClose", qq_Params );
    }
View Full Code Here

    }

    private void fireExpanded(TreeExpansionEvent event) {
        Hashtable<String, Object> qq_Params = new Hashtable<String, Object>();
        DisplayNode dn  = ((DisplayNode)event.getPath().getPath()[event.getPath().getPathCount()-1]);
        qq_Params.put( "Folder", new ParameterHolder(dn) );
        ClientEventManager.postEvent( this, "RequestFolderOpen", qq_Params );
    }
View Full Code Here

                (((Anchorable)o).getIsAnchored())) {

            return ((Anchorable)o).getProxy();
        }
        else if (o instanceof ParameterHolder && isAnchored(((ParameterHolder)o).getObject())) {
            ParameterHolder ph = (ParameterHolder)o;
            ph.setObject(getAnchoredObject(ph.getObject()));
        }
        return o;
    }
View Full Code Here

        return TransactionMgr.getOuterTransactionDesc();

    }

  public static void main(String[] args) {
      ParameterHolder h1 = new ParameterHolder(), h2 = new ParameterHolder();
      String result = DBUtilities.translateSQL("blah :fred = \"2008-02-04 13:19:12.000\" or :fred = '2008-02-04 15:00:06' or :'blad' = :\"blah\"", h1, h2);
      System.out.println(result);
    }
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.framework.ParameterHolder

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.