-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FORGE-913 Added support for allowing timestamp input via Richfaces ca…
…lendar This adds support for supplying timestamps via the generated scaffold, with a minor disadvantage - the time is defaulted to 12:00PM, but can be modified again. Fixing this requires adding support in Metawidget to display the 'apply' button. Additionally, this still does not support the input of time fields, since Richfaces calendar does not support this component yet.
- Loading branch information
1 parent
b55a1e1
commit bad139e
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...aces/metawidget/inspectionresultprocessor/RichfacesCalendarInspectionResultProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2013 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.jboss.forge.scaffold.faces.metawidget.inspectionresultprocessor; | ||
|
||
import static org.metawidget.inspector.InspectionResultConstants.DATETIME_PATTERN; | ||
import static org.metawidget.inspector.InspectionResultConstants.DATETIME_TYPE; | ||
import java.util.Map; | ||
|
||
import org.metawidget.inspectionresultprocessor.impl.BaseInspectionResultProcessor; | ||
|
||
/** | ||
* Processes the inspection result to add additional semantic information for the MetaWidget Richfaces widgetbuilder. | ||
* See FORGE-913. | ||
* | ||
* @author Vineet Reynolds | ||
*/ | ||
|
||
public class RichfacesCalendarInspectionResultProcessor<M> extends BaseInspectionResultProcessor<M> | ||
{ | ||
// | ||
// Protected methods | ||
// | ||
|
||
@Override | ||
protected void processAttributes(Map<String, String> attributes, M metawidget) | ||
{ | ||
String dateTimeType = attributes.get(DATETIME_TYPE); | ||
if(dateTimeType != null && dateTimeType.equals("both")) | ||
{ | ||
attributes.put(DATETIME_PATTERN, "MMM d, yyyy hh:mm:ss a"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters