Package org.apache.jorphan.reflect

Examples of org.apache.jorphan.reflect.Functor


    if (tableModel == null) {
        if(standalone) {
            tableModel = new ObjectTableModel(new String[] { COLUMN_RESOURCE_NAMES_0, COLUMN_RESOURCE_NAMES_1, COLUMN_RESOURCE_NAMES_2 },
                    Argument.class,
                    new Functor[] {
                    new Functor("getName"), // $NON-NLS-1$
                    new Functor("getValue")// $NON-NLS-1$
                    new Functor("getDescription") }// $NON-NLS-1$
                    new Functor[] {
                    new Functor("setName"), // $NON-NLS-1$
                    new Functor("setValue"), // $NON-NLS-1$
                    new Functor("setDescription") }// $NON-NLS-1$
                    new Class[] { String.class, String.class, String.class });
        } else {
            tableModel = new ObjectTableModel(new String[] { COLUMN_RESOURCE_NAMES_0, COLUMN_RESOURCE_NAMES_1 },
                    Argument.class,
                    new Functor[] {
                    new Functor("getName"), // $NON-NLS-1$
                    new Functor("getValue") }// $NON-NLS-1$
                    new Functor[] {
                    new Functor("setName"), // $NON-NLS-1$
                    new Functor("setValue") }, // $NON-NLS-1$
                    new Class[] { String.class, String.class });
            }
        }
    }
View Full Code Here


        for (int i = 0; i < parts.length; i++) {
            String label = parts[i];
            if (isVariableName(label)) {
                varCount++;
            } else {
                Functor set = (Functor) headerLabelMethods.get(label);
                set.invoke(saveConfig, new Boolean[] { Boolean.TRUE });
            }
        }

        if (delim != null) {
            log.warn("Default delimiter '" + _saveConfig.getDelimiter()
View Full Code Here

    }

    Functor createWriter(Class<?> c,String propName)
    {
        String setter = "set" + propName; // $NON-NLS-1$
        return new Functor(setter);
    }
View Full Code Here

    {
        String getter = "get" + propName; // $NON-NLS-1$
        try
        {
            c.getMethod(getter,new Class[0]);
            return new Functor(getter);
        }
        catch(Exception e) { return new Functor("is" + propName); }
    }
View Full Code Here

    public TableVisualizer() {
        super();
        model = new ObjectTableModel(COLUMNS,
                TableSample.class,         // The object used for each row
                new Functor[] {
                new Functor("getSampleNumberString"), // $NON-NLS-1$
                new Functor("getStartTimeFormatted"// $NON-NLS-1$
                        new Object[]{format}),
                new Functor("getThreadName"), // $NON-NLS-1$
                new Functor("getLabel"), // $NON-NLS-1$
                new Functor("getElapsed"), // $NON-NLS-1$
                new SampleSuccessFunctor("isSuccess"), // $NON-NLS-1$
                new Functor("getBytes") }, // $NON-NLS-1$
                new Functor[] { null, null, null, null, null, null, null },
                new Class[] {
                String.class, String.class, String.class, String.class, Long.class, ImageIcon.class, Integer.class });
        init();
    }
View Full Code Here

                    checkPanel.add(check, BorderLayout.NORTH);
                    check.addActionListener(this);
                    String actionCommand = NAME_SET_PREFIX + name; // $NON-NLS-1$
                    check.setActionCommand(actionCommand);
                    if (!functors.containsKey(actionCommand)) {
                        functors.put(actionCommand, new Functor(actionCommand));
                    }
                } catch (IllegalAccessException e) {
                    log.warn("Problem creating save config dialog", e);
                } catch (InvocationTargetException e) {
                    log.warn("Problem creating save config dialog", e);
View Full Code Here

        });
    }

    public void actionPerformed(ActionEvent e) {
        String action = e.getActionCommand();
        Functor f = functors.get(action);
        f.invoke(saveConfig, new Object[] {
                Boolean.valueOf(((JCheckBox) e.getSource()).isSelected()) });
    }
View Full Code Here

    protected void initializeTableModel() {
        if(standalone) {
            tableModel = new ObjectTableModel(new String[] { COLUMN_RESOURCE_NAMES_0, COLUMN_RESOURCE_NAMES_1, COLUMN_RESOURCE_NAMES_2 },
                    Argument.class,
                    new Functor[] {
                    new Functor("getName"), // $NON-NLS-1$
                    new Functor("getValue")// $NON-NLS-1$
                    new Functor("getDescription") }// $NON-NLS-1$
                    new Functor[] {
                    new Functor("setName"), // $NON-NLS-1$
                    new Functor("setValue"), // $NON-NLS-1$
                    new Functor("setDescription") }// $NON-NLS-1$
                    new Class[] { String.class, String.class, String.class });
        } else {
        tableModel = new ObjectTableModel(new String[] { COLUMN_RESOURCE_NAMES_0, COLUMN_RESOURCE_NAMES_1 },
                Argument.class,
                new Functor[] {
                new Functor("getName"), // $NON-NLS-1$
                new Functor("getValue") }// $NON-NLS-1$
                new Functor[] {
                new Functor("setName"), // $NON-NLS-1$
                new Functor("setValue") }, // $NON-NLS-1$
                new Class[] { String.class, String.class });
    }
    }
View Full Code Here

    public StatGraphVisualizer() {
        super();
        model = new ObjectTableModel(COLUMNS,
                SamplingStatCalculator.class,
                new Functor[] {
                new Functor("getLabel"),                    //$NON-NLS-1$
                new Functor("getCount"),                    //$NON-NLS-1$
                new Functor("getMeanAsNumber"),                //$NON-NLS-1$
                new Functor("getMedian"),                    //$NON-NLS-1$
                new Functor("getPercentPoint",                //$NON-NLS-1$
                new Object[] { new Float(.900) }),
                new Functor("getMin"),                        //$NON-NLS-1$
                new Functor("getMax"),                         //$NON-NLS-1$
                new Functor("getErrorPercentage"),            //$NON-NLS-1$
                new Functor("getRate"),                        //$NON-NLS-1$
                new Functor("getKBPerSecond") },            //$NON-NLS-1$
                new Functor[] { null, null, null, null, null, null, null, null,    null, null },
                new Class[] { String.class, Long.class, Long.class, Long.class, Long.class, Long.class,
                Long.class, String.class, String.class, String.class });
        clearData();
        init();
View Full Code Here

    public SamplerResultTab() {
        // create tables
        resultModel = new ObjectTableModel(COLUMNS_RESULT, RowResult.class, // The object used for each row
                new Functor[] {
                        new Functor("getKey"), // $NON-NLS-1$
                        new Functor("getValue") }, // $NON-NLS-1$
                new Functor[] {
                        null, null }, new Class[] {
                        String.class, String.class }, false);
        resHeadersModel = new ObjectTableModel(COLUMNS_HEADERS,
                RowResult.class, // The object used for each row
                new Functor[] {
                        new Functor("getKey"), // $NON-NLS-1$
                        new Functor("getValue") }, // $NON-NLS-1$
                new Functor[] {
                        null, null }, new Class[] {
                        String.class, String.class }, false);
        resFieldsModel = new ObjectTableModel(COLUMNS_FIELDS, RowResult.class, // The object used for each row
                new Functor[] {
                        new Functor("getKey"), // $NON-NLS-1$
                        new Functor("getValue") }, // $NON-NLS-1$
                new Functor[] {
                        null, null }, new Class[] {
                        String.class, String.class }, false);
    }
View Full Code Here

TOP

Related Classes of org.apache.jorphan.reflect.Functor

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.