Package org.openquark.util.time

Examples of org.openquark.util.time.Time


     *
     * @param attrDesc  the attribute description
     * @return the time value of the attribute, or the default value if none is found
     */
    public Time getTimeAttributeValue (AttributeDescription attrDesc) {
        Time defaultValue = (attrDesc.defaultValue instanceof Time) ? (Time) attrDesc.defaultValue : null;
        return getTimeAttributeValue(attrDesc.name, defaultValue);
    }
View Full Code Here


             */
            public Time getCurrentRowTime(int colIndex) throws DatabaseException {
                try {
                    // Get the extracted value
                    Timestamp timestampVal = sqlResults.getTimestamp(colIndex);
                    Time timeVal = (timestampVal == null) ? null : Time.fromTimeStamp(timestampVal);

                    // Check whether the value was null.
                    if (sqlResults.wasNull()) {
                        timeVal = Connection.NULL_TIME;
                    }
View Full Code Here

             */
            public Time getCurrentRowTime(String colName) throws DatabaseException {
                try {
                    // Get the extracted value
                    Timestamp timestampVal = sqlResults.getTimestamp(colName);
                    Time timeVal = (timestampVal == null) ? null : Time.fromTimeStamp(timestampVal);

                    // Check whether the value was null.
                    if (sqlResults.wasNull()) {
                        timeVal = Connection.NULL_TIME;
                    }
View Full Code Here

        public void storeToElement(XMLSerializationManager manager, Element element,
                Object value) {
            Document document = element.getOwnerDocument();

            // Store the time value.
            Time time = (Time) value;
            Element timeElement = document.createElement(TIME_ATTR_NAME);
            timeElement.appendChild(document.createTextNode(time.toSerializedForm()));
            element.appendChild(timeElement);
        }
View Full Code Here

       
        /**
         * @see org.openquark.util.xml.XMLAttributeSerializer#storeToAttribute(org.w3c.dom.Element, java.lang.Object)
         */
        public void storeToAttribute(Element element, Object value) {
            Time time = (Time) value;
            element.setAttribute(TIME_ATTR_NAME, time.toSerializedForm());
        }
View Full Code Here

     */
    @Override
    public void setOwnerValueNode(ValueNode newValueNode) {
        super.setOwnerValueNode(newValueNode);
       
        Time timeValue = (Time)getJTimeValueNode().getValue();
        Date dateTimeValue = timeValue.toDate();
        TypeExpr dateType = valueEditorManager.getValueNodeBuilderHelper().getTypeConstructorForName(CAL_RelativeTime.TypeConstructors.RelativeDate);
        TypeExpr timeType = valueEditorManager.getValueNodeBuilderHelper().getTypeConstructorForName(CAL_RelativeTime.TypeConstructors.RelativeTime);
       
        dateValueEditor.setOwnerValueNode(new RelativeDateValueNode(dateTimeValue, dateType));
        timeValueEditor.setOwnerValueNode(new RelativeTimeValueNode(dateTimeValue, timeType));
View Full Code Here

     * Sets the initial value in both the RelativeDateValueEditor and RelativeTimeValueEditor
     * from the Date value in the ValueNode.
     */
    @Override
    public void setInitialValue() {
        Time nodeValue=(Time)getJTimeValueNode().getValue();
       
        // Convert from local timezone to quasi-UTC
        Calendar localCalendar=Calendar.getInstance(TimeZone.getDefault());
        localCalendar.setTime(nodeValue.toDate());

        Calendar uiCalendar=Calendar.getInstance(TimeZone.getTimeZone("UTC"));
        uiCalendar.set(
              localCalendar.get(Calendar.YEAR),
              localCalendar.get(Calendar.MONTH),
View Full Code Here

            DateFormat fmt=DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.LONG);
            fmt.setTimeZone(TimeZone.getDefault());

            try {
                Date date = fmt.parse(newVal);
                Time time = Time.fromDate(date);
                valueEntryPanel.replaceValueNode(new JTimeValueNode(time, typeExpr.copyTypeExpr()), true);
            } catch (ParseException pe) {
                System.out.println("Error in updateValueNode: Could not parse the Text into a Date value.");
            }
        } else {
View Full Code Here

TOP

Related Classes of org.openquark.util.time.Time

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.