Package net.sourceforge.processdash.ev.EVSnapshot

Examples of net.sourceforge.processdash.ev.EVSnapshot.Metadata


        @Override
        public Component getListCellRendererComponent(JList list, Object value,
                int index, boolean isSelected, boolean cellHasFocus) {

            // use the name of the snapshot as its display value
            Metadata snap = (Metadata) value;
            Component result = super.getListCellRendererComponent(list,
                snap.getName(), index, isSelected, cellHasFocus);

            // place a checkmark icon next to the active snapshot
            if (snap.getId().equals(activeSnapshotId))
                setIcon(DashboardIconFactory.getCheckIcon());
            else
                setIcon(null);

            // display snapshot comments as a tooltip
            String comment = snap.getComment();
            String tooltip = null;
            if (StringUtils.hasValue(comment))
                tooltip = "<html><div style='width:200px'>"
                        + HTMLUtils.escapeEntities(comment) + "</div></html>";
            setToolTipText(tooltip);
View Full Code Here


        public void actionPerformed(ActionEvent e) {
            // find the snapshot that the user wants to edit
            int selIdx = snapshotList.getSelectedIndex();
            if (selIdx == -1)
                return;
            Metadata snap = (Metadata) snapshotModel.get(selIdx);

            // prompt the user for the desired name/description
            String[] userValues = showSnapEditDialog(
                TaskScheduleSnapshotManager.this,
                resources.getString("Edit.Title"), //
                snap.getName(), snap.getComment());
            if (userValues == null)
                return;

            // retrieve the edited values and save the changes
            String newName = userValues[0];
            if (newName.length() > 0)
                snap.setName(newName);
            snap.setComment(userValues[1]);
            snap.save(data);

            // alert the list model so it can redraw the given item
            snapshotModel.set(selIdx, snap);
        }
View Full Code Here

                return;

            int[] sel = snapshotList.getSelectedIndices();
            for (int i = sel.length; i-- > 0;) {
                int pos = sel[i];
                Metadata snap = (Metadata) snapshotModel.elementAt(pos);
                if (snap.getId().equals(activeSnapshotId))
                    setSelectedBaseline(null);
                snap.delete(data);
                snapshotModel.remove(pos);
            }
        }
View Full Code Here

        public SelectAction() {
            super(resources.getString("Select.Button"), "Select.Tooltip", false);
        }

        public void actionPerformed(ActionEvent e) {
            Metadata snap = (Metadata) snapshotList.getSelectedValue();
            if (snap != null) {
                setSelectedBaseline(snap.getId());
                SwingUtilities.getWindowAncestor(
                    TaskScheduleSnapshotManager.this).dispose();
            }
        }
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.ev.EVSnapshot.Metadata

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.