Example usage for com.jgoodies.binding PresentationModel PresentationModel

List of usage examples for com.jgoodies.binding PresentationModel PresentationModel

Introduction

In this page you can find the example usage for com.jgoodies.binding PresentationModel PresentationModel.

Prototype

public PresentationModel(ValueModel beanChannel) 

Source Link

Document

Constructs a PresentationModel on the given bean channel.

Usage

From source file:ambit2.dbui.QueryEditor.java

License:Open Source License

protected PresentationModel<Q> createPresentationModel() {
    return new PresentationModel<Q>(new ValueHolder(null, true));
}

From source file:ambit2.dbui.QueryFieldNumericEditor.java

License:Open Source License

protected PresentationModel<QueryFieldNumeric> createPresentationModel() {
    return new PresentationModel<QueryFieldNumeric>(new ValueHolder(null, true));

}

From source file:ambit2.dbui.QueryFieldNumericEditor.java

License:Open Source License

protected JComponent[] createStatsFields() {
    propertyStats = new PropertyStats();
    statsAdapter = new PresentationModel<PropertyStats>(propertyStats);

    return new JComponent[] {
            BasicComponentFactory.createFormattedTextField(statsAdapter.getModel("avg"),
                    NumberFormat.getNumberInstance()),
            BasicComponentFactory.createFormattedTextField(statsAdapter.getModel("min"),
                    NumberFormat.getNumberInstance()),
            BasicComponentFactory.createFormattedTextField(statsAdapter.getModel("max"),
                    NumberFormat.getNumberInstance()) };
}

From source file:ambit2.ui.editors.BeanEditor.java

License:Open Source License

protected PresentationModel createPresentationModel() {
    return new PresentationModel<L>(new ValueHolder(null, true));
}

From source file:ambit2.ui.table.FindNavigator.java

License:Open Source License

public JComponent buildPanel(final IFindNavigator pageable) {
    FormLayout layout = new FormLayout("pref, 1dlu, fill:50dlu:grow,1dlu,pref, 1dlu,pref", "pref");

    PresentationModel<IFindNavigator> presentationModel = new PresentationModel<IFindNavigator>(pageable);

    label = new JLabel("Find");
    findValue = BasicComponentFactory//from  ww  w.  j av a 2 s  .  c o m
            .createTextField(presentationModel.getModel(IFindNavigator.PROPERTY_VALUE));
    findValue.setToolTipText("Enter value to search");

    prevPage = new JButton(new AbstractAmbitAction("<", "images/control_rewind.png", "Find previous") {
        public void actionPerformed(ActionEvent e) {
            pageable.findPrevious();
        }
    });
    nextPage = new JButton(new AbstractAmbitAction(">", "images/control_fastforward.png", "Find next") {
        public void actionPerformed(ActionEvent e) {
            pageable.findNext();
        }
    });
    PanelBuilder panel = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();
    //"pref, 1dlu,pref,1dlu,fill:25dlu:grow,1dlu,pref, 1dlu,fill:25dlu:grow, 1dlu,pref, 1dlu,fill:25dlu:grow",        
    panel.add(label, cc.xy(1, 1));
    panel.add(findValue, cc.xy(3, 1));
    panel.add(prevPage, cc.xy(5, 1));
    panel.add(nextPage, cc.xy(7, 1));
    return panel.getPanel();
}

From source file:ambit2.ui.table.PageNavigator.java

License:Open Source License

public JComponent buildPanel(final IPageNavigator pageable) {
    FormLayout layout = new FormLayout(
            "pref, 1dlu,pref,1dlu, fill:25dlu:grow,1dlu,pref, 1dlu,fill:25dlu:grow,1dlu,pref, 1dlu,pref, 1dlu,fill:25dlu:grow",
            "pref");

    PresentationModel<IPageNavigator> presentationModel = new PresentationModel<IPageNavigator>(pageable);

    label = new JLabel("Page");
    currentPage = BasicComponentFactory/* ww w. ja  v  a  2s  .  c  o  m*/
            .createIntegerField(presentationModel.getModel(IPageNavigator.PROPERTY_PAGE));
    currentPage.setToolTipText("Current page");

    allPages = BasicComponentFactory
            .createIntegerField(presentationModel.getModel(IPageNavigator.PROPERTY_MAXPAGES));
    allPages.setToolTipText("All pages");
    allPages.setEditable(false);

    pageSize = BasicComponentFactory
            .createIntegerField(presentationModel.getModel(IPageNavigator.PROPERTY_PAGESIZE));
    pageSize.setToolTipText("Records per page");

    prevPage = new JButton(new AbstractAmbitAction("<", "images/resultset_previous.png", "Previous page") {
        public void actionPerformed(ActionEvent e) {
            pageable.previousPage();
        }
    });
    nextPage = new JButton(new AbstractAmbitAction("<", "images/resultset_next.png", "Next page") {
        public void actionPerformed(ActionEvent e) {
            pageable.nextPage();
        }
    });
    PanelBuilder panel = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();
    //"pref, 1dlu,pref,1dlu,fill:25dlu:grow,1dlu,pref, 1dlu,fill:25dlu:grow, 1dlu,pref, 1dlu,fill:25dlu:grow",        
    panel.add(label, cc.xy(1, 1));
    panel.add(prevPage, cc.xy(3, 1));
    panel.add(currentPage, cc.xy(5, 1));
    panel.add(new JLabel("/"), cc.xy(7, 1));
    panel.add(allPages, cc.xy(9, 1));
    panel.add(nextPage, cc.xy(11, 1));
    panel.add(pageSize, cc.xy(13, 1));

    return panel.getPanel();
}

From source file:ambit2.ui.table.RecordNavigator.java

License:Open Source License

public JComponent buildPanel(final IRecordNavigator navigator) {
    FormLayout layout = new FormLayout(
            "pref, 1dlu,pref,1dlu,fill:25dlu:grow,1dlu,pref,1dlu,fill:25dlu:grow,1dlu,pref", "pref");

    PresentationModel<IRecordNavigator> presentationModel = new PresentationModel<IRecordNavigator>(navigator);

    label = new JLabel("Record");
    currentPage = BasicComponentFactory// ww  w  .ja  v a  2  s  .  co  m
            .createIntegerField(presentationModel.getModel(IRecordNavigator.PROPERTY_RECORD));
    currentPage.setToolTipText("Current record");
    allPages = BasicComponentFactory
            .createIntegerField(presentationModel.getModel(IRecordNavigator.PROPERTY_MAXRECORDS));
    allPages.setToolTipText("All pages");
    allPages.setEditable(false);
    prevPage = new JButton(new AbstractAmbitAction("<", "images/resultset_previous.png", "Previous record") {
        public void actionPerformed(ActionEvent e) {
            navigator.prev();
        }
    });
    nextPage = new JButton(new AbstractAmbitAction(">", "images/resultset_next.png", "Next record") {
        public void actionPerformed(ActionEvent e) {
            navigator.next();
        }
    });
    PanelBuilder panel = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();
    panel.add(label, cc.xy(1, 1));
    panel.add(prevPage, cc.xy(3, 1));
    panel.add(currentPage, cc.xy(5, 1));
    panel.add(new JLabel("/"), cc.xy(7, 1));
    panel.add(allPages, cc.xy(9, 1));
    panel.add(nextPage, cc.xy(11, 1));

    return panel.getPanel();
}

From source file:ch.fork.AdHocRailway.ui.locomotives.configuration.LocomotiveGroupConfigPanel.java

License:Open Source License

public LocomotiveGroupConfigPanel() {
    presentationModel = new PresentationModel<LocomotiveGroup>(new ValueHolder(null, true));
    initComponents();/*from ww  w.j a v a2  s. c  o  m*/
    buildPanel();
    setLocomotiveGroup(null);
}

From source file:ch.fork.AdHocRailway.ui.routes.configuration.RouteGroupConfigPanel.java

License:Open Source License

public RouteGroupConfigPanel() {
    presentationModel = new PresentationModel<RouteGroup>(new ValueHolder(null, true));
    buildPanel();
}

From source file:ch.fork.AdHocRailway.ui.turnouts.configuration.TurnoutGroupConfigPanel.java

License:Open Source License

public TurnoutGroupConfigPanel() {
    presentationModel = new PresentationModel<TurnoutGroup>(new ValueHolder(null, true));
    buildPanel();
    setTurnoutGroup(null);
}