public class Activities
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Activities.CountingVisitor
Simple counting visitor
|
static class |
Activities.FilterActivityVisitor
Activities.IlvActivityVisitor that builds a list of Filtered activities based
on the Activities.IFilter instance |
static class |
Activities.FilterNodeVisitor
Activities.IlvActivityVisitor that builds a list of Filtered activities based
on the Activities.IFilter instance |
static class |
Activities.FindByIDActivityVisitor
Visitor that will find an Activity by ID
|
static interface |
Activities.HasCancelled
A "state" object can implement this if they want to "cancel" out of visitor operation
|
static interface |
Activities.IFilter<T>
Generic Filter class for any type
|
static interface |
Activities.IlvActivityVisitor<T>
Simple visitor pattern for activities.
|
static interface |
Activities.IlvHierarchyNodeVisitor<NodeType extends ilog.views.gantt.IlvHierarchyNode,ChartType extends ilog.views.gantt.IlvHierarchyChart,StateType>
Generic
IlvHierarchyNode visitor for visiting any subclass of IlvHierarchyNode |
static interface |
Activities.IlvNodeVisitor<T>
Generic Node Visitor that can visit nodes in an IlvHierarchyChart
|
static interface |
Activities.IlvResourceVisitor<T>
Specific implementation of an
Activities.IlvHierarchyNodeVisitor for IlvResource type objects. |
static class |
Activities.SameTypeVisitor
Special visitor where isValid() will return true if each object
that is visited has the same type as any objectname in the list
|
static class |
Activities.ShowMoveToMenuVisitor
Special Visitor where isValid() will return true IF ALL
that nodes being visited can support the MoveTo menu.
|
Modifier and Type | Field and Description |
---|---|
static Activities.IlvNodeVisitor<java.lang.Void> |
COLLAPSE_ALL_ROWS_VISITOR
Collapse all rows visitor
|
static java.lang.String |
PROPERTY_READ_ONLY_MODEL
Property on the ROOT activity to indicate that the model is readonly
|
static Activities.IlvActivityVisitor<java.lang.Void> |
SELECT_ALL_ROWS_ACTIVITY_VISITOR
Simple
Activities.IlvActivityVisitor that selects every row that is passed |
static java.lang.String |
WO_INTERNAL_STATUS_APPR
Internal Status for Approved WorkOrder
"APPR"
|
static java.util.List<java.lang.String> |
WORKORDER_OBJECTNAMES
Global List of WORKORDER type object names
|
Constructor and Description |
---|
Activities() |
Modifier and Type | Method and Description |
---|---|
static void |
addCrafts(java.util.HashSet crafts,
ilog.views.gantt.IlvActivity item,
ilog.views.gantt.IlvGanttChart ganttChart)
For a given Activity on the chart, add its crafts to the set of passed in crafts.
|
static void |
adjustChartForPadding(ilog.views.gantt.IlvHierarchyChart gchart,
java.util.Date start,
ilog.views.gantt.IlvDuration duration)
Utility method for adding padding to a visible duration
|
static void |
applyVisibleTime(ilog.views.gantt.IlvTimeScrollController timeScroller,
ilog.views.gantt.IlvHierarchyChart chart)
Applies the TimeScroller visible area to the Chart, and forces a sync
|
static void |
copyProperties(ilog.views.gantt.IlvActivity src,
ilog.views.gantt.IlvActivity dest)
Copies all Non-Null properties from the source to the destination, but it will NOT overwrite
existing Non-Null properties in the destination.
|
static long |
count(java.util.Iterator<?> items)
Count the items
|
static long |
countActivities(ilog.views.gantt.IlvHierarchyChart chart) |
static long |
countReservations(ilog.views.gantt.IlvScheduleChart chart) |
static long |
countResources(ilog.views.gantt.IlvHierarchyChart chart) |
static ilog.views.gantt.IlvTimeInterval |
createUnionTimeInterval(ilog.views.gantt.IlvHierarchyNode... nodes)
Returns a TimeInterval that fits all the nodes that are passed in.
|
static void |
dumpDebegInfoForContaints(java.lang.String msg,
java.util.Iterator<ilog.views.gantt.IlvConstraint> iter) |
static void |
dumpDebugCompareInfoForItems(java.lang.String msg,
ilog.views.gantt.property.IlvUserPropertyHolder item1,
ilog.views.gantt.property.IlvUserPropertyHolder item2)
Dumps 2 Activities and compares their properties
|
static void |
dumpDebugInfoForContstraint(ilog.views.gantt.IlvConstraint c) |
static void |
dumpDebugInfoForItem(ilog.views.gantt.IlvGanttChart gchart,
ilog.views.gantt.IlvActivity item)
debug method that dumps the information about an activity and its properties.
|
static void |
dumpDebugInfoForResource(ilog.views.gantt.IlvResource selectedresource,
ilog.views.gantt.IlvGanttModel model) |
static ilog.views.gantt.IlvActivity |
getActivityById(ilog.views.gantt.IlvGanttModel model,
ilog.views.gantt.IlvActivity parent,
java.lang.String id)
Convenience method for finding an Activiy by ID
|
static javax.swing.JPopupMenu |
getActivityContextMenu(ilog.views.gantt.IlvActivity item,
ilog.views.gantt.IlvGanttChart gchart)
Returns a context menu for an Activity (Workorder) for expanding and selecting the children of a selected
work order.
|
static ilog.views.gantt.IlvHierarchyNode[] |
getChildren(ilog.views.gantt.IlvHierarchyNode item,
ilog.views.gantt.IlvHierarchyChart chart)
Convenience Method that returns all direct children for a given node
|
static java.util.Date |
getEarliestStartTime(ilog.views.gantt.IlvActivity[] selected)
Given an array of items, then return the earliest start time for all the activities
|
static java.lang.String |
getID(ilog.views.gantt.IlvHierarchyNode node)
Returns the ID for a Resource or Activity
|
static java.util.Date |
getLatestEndTime(ilog.views.gantt.IlvActivity[] selected)
Given the array of items, return the latest end time for all the activites
|
static ilog.views.gantt.IlvActivity |
getParent(ilog.views.gantt.IlvActivity act,
ilog.views.gantt.IlvGanttModel model)
Returns the parent activity for the given activity in the model
|
static java.lang.Object |
getProperty(java.lang.Object node,
java.lang.String prop)
Gets a property from a node
|
static <T> T |
getProperty(java.lang.Object node,
java.lang.String prop,
T defaultValue)
Gets a property from a Node and returns the default if not set.
|
static boolean |
hasAnyChildren(ilog.views.gantt.IlvHierarchyNode[] items,
ilog.views.gantt.IlvHierarchyChart chart)
Returns true if ANY item has children
|
static boolean |
hasChildren(ilog.views.gantt.IlvHierarchyNode item,
ilog.views.gantt.IlvHierarchyChart chart)
|
static boolean |
hideDurationInTooltip(ilog.views.gantt.IlvActivity act) |
static boolean |
isAssignment(ilog.views.gantt.IlvActivity act)
Returns true if the Activity is an Assignment
|
static boolean |
isPM(ilog.views.gantt.IlvActivity act)
Returns true if the activity is a PM activity
|
static boolean |
isWorkorder(ilog.views.gantt.IlvActivity act)
Returns true if the given
IlvActivity is a work order |
static boolean |
isWorkorderApproved(MXActivity source)
Returns true if the source is a workorder and it is approved
|
static void |
moveToDay(java.util.Calendar day,
ilog.views.gantt.IlvActivity[] selected,
ilog.views.gantt.IlvGanttChart gchart)
Given the Date and the selected items, it performs a Move To Day operation.
|
static Activities.IlvActivityVisitor<java.util.Set<java.lang.String>> |
newAdjustTimeVisitor(ilog.views.gantt.IlvDuration adjustment)
Creates a visitor that will adjust the start and end times on an activity by the given
IlvDuration . |
static boolean |
setProperty(java.lang.Object node,
java.lang.String prop,
java.lang.Object val)
Sets a property, if possible, in the
IlvHierarchyNode . |
static void |
showWorkForSelectedActivities(ilog.views.gantt.IlvActivity[] selected,
ilog.views.gantt.IlvHierarchyChart gchart)
Resizes the Gantt View so that the selected activities will fit within the view
|
static void |
showWorkForSelectedResource(ilog.views.gantt.IlvResource selected,
ilog.views.gantt.IlvHierarchyChart chart)
Given a resource, look at the reservations and build a time duration that can fit all those reservations
|
static void |
showWorkForTimeInterval(long startMillis,
long durMillis,
ilog.views.gantt.IlvHierarchyChart gchart)
Resizes the Gantt View so that the time window will fit within the view
|
static <T> void |
visitActivities(ilog.views.gantt.IlvActivity[] items,
ilog.views.gantt.IlvGanttChart ganttChart,
Activities.IlvActivityVisitor<T> visitor,
T state)
Applies an IlvActivityVisitor to each activity and it's children.
|
static <T> void |
visitActivity(ilog.views.gantt.IlvActivity item,
ilog.views.gantt.IlvGanttChart ganttChart,
Activities.IlvActivityVisitor<T> visitor,
T state)
Applies an IlvActivityVisitor to each activity and it's children.
|
static <T> void |
visitNode(ilog.views.gantt.IlvHierarchyNode item,
ilog.views.gantt.IlvHierarchyChart chart,
Activities.IlvNodeVisitor<T> visitor,
T state)
Generic Visitor for visiting IlvHeirarchyNodes
|
static <T> void |
visitNodes(ilog.views.gantt.IlvHierarchyNode[] items,
ilog.views.gantt.IlvHierarchyChart ganttChart,
Activities.IlvNodeVisitor<T> visitor,
T state)
Generic Visitor for IlvHierarchNodes
|
static <T> void |
visitResource(ilog.views.gantt.IlvResource item,
ilog.views.gantt.IlvHierarchyChart chart,
Activities.IlvResourceVisitor<T> visitor,
T state)
Allow an
IlvResource object to be visited by the visitor. |
static <T> void |
visitResources(ilog.views.gantt.IlvResource[] items,
ilog.views.gantt.IlvHierarchyChart chart,
Activities.IlvResourceVisitor<T> visitor,
T state)
Visits an array of Resources
|
public static final java.lang.String WO_INTERNAL_STATUS_APPR
public static final java.lang.String PROPERTY_READ_ONLY_MODEL
public static final java.util.List<java.lang.String> WORKORDER_OBJECTNAMES
public static final Activities.IlvActivityVisitor<java.lang.Void> SELECT_ALL_ROWS_ACTIVITY_VISITOR
Activities.IlvActivityVisitor
that selects every row that is passedpublic static final Activities.IlvNodeVisitor<java.lang.Void> COLLAPSE_ALL_ROWS_VISITOR
public static boolean isWorkorder(ilog.views.gantt.IlvActivity act)
IlvActivity
is a work orderact
- IlvActivity
instancepublic static boolean isAssignment(ilog.views.gantt.IlvActivity act)
act
- public static boolean isPM(ilog.views.gantt.IlvActivity act)
act
- public static boolean hasChildren(ilog.views.gantt.IlvHierarchyNode item, ilog.views.gantt.IlvHierarchyChart chart)
item
- IlvActivity
instance (can be MXActivity
or IlvHierarchyNode
)chart
- gantt chart to while the item belongspublic static boolean hasAnyChildren(ilog.views.gantt.IlvHierarchyNode[] items, ilog.views.gantt.IlvHierarchyChart chart)
items
- ganttChart
- public static void addCrafts(java.util.HashSet crafts, ilog.views.gantt.IlvActivity item, ilog.views.gantt.IlvGanttChart ganttChart)
crafts
- HashSet
to which the crafts should be placeditem
- IlvActivity
item on the chartganttChart
- IlvGanttChart
gantt chartpublic static <T> void visitResource(ilog.views.gantt.IlvResource item, ilog.views.gantt.IlvHierarchyChart chart, Activities.IlvResourceVisitor<T> visitor, T state)
IlvResource
object to be visited by the visitor.T
- State objectitem
- Item being visitedchart
- Chart to which the item belongsvisitor
- Visitor that will accept the itemstate
- State that will be passed to the visitorpublic static <T> void visitResources(ilog.views.gantt.IlvResource[] items, ilog.views.gantt.IlvHierarchyChart chart, Activities.IlvResourceVisitor<T> visitor, T state)
T
- State Object generic Typeitems
- array of IlvResource itemschart
- chart to which the items belongvisitor
- visitor that will accept each of the itemsstate
- state that will be passed to the visitorpublic static <T> void visitActivity(ilog.views.gantt.IlvActivity item, ilog.views.gantt.IlvGanttChart ganttChart, Activities.IlvActivityVisitor<T> visitor, T state)
item
- IlvActivity
parent activityganttChart
- IlvGanttChart
to which the IlvActivity
belongsvisitor
- Activities.IlvActivityVisitor
that will visit each itempublic static <T> void visitNodes(ilog.views.gantt.IlvHierarchyNode[] items, ilog.views.gantt.IlvHierarchyChart ganttChart, Activities.IlvNodeVisitor<T> visitor, T state)
T
- items
- ganttChart
- visitor
- state
- public static <T> void visitNode(ilog.views.gantt.IlvHierarchyNode item, ilog.views.gantt.IlvHierarchyChart chart, Activities.IlvNodeVisitor<T> visitor, T state)
public static <T> void visitActivities(ilog.views.gantt.IlvActivity[] items, ilog.views.gantt.IlvGanttChart ganttChart, Activities.IlvActivityVisitor<T> visitor, T state)
item
- IlvActivity
parent activityganttChart
- IlvGanttChart
to which the IlvActivity
belongsvisitor
- Activities.IlvActivityVisitor
that will visit each itempublic static final Activities.IlvActivityVisitor<java.util.Set<java.lang.String>> newAdjustTimeVisitor(ilog.views.gantt.IlvDuration adjustment)
IlvDuration
.
IlvDuration
defines constants for ONE_DAY, ONE_WEEK, etc, or you can pass your own duration. This
visitor will tract each item that is visited in in the state Set
, to prevent the same item from
being visited more than once. The only use case for this is when you are processing multiple selected rows
of a selected parent.adjustment
- IlvDuration
to which to apply to the start and end timeActivities.IlvActivityVisitor
implementation that will adjust by the given adjustmentpublic static javax.swing.JPopupMenu getActivityContextMenu(ilog.views.gantt.IlvActivity item, ilog.views.gantt.IlvGanttChart gchart)
item
- IlvActivity
on which to attach the content menugchart
- IlvGanttChart
to which the item belongsJPopupMenu
or null if no valid menu can be createdpublic static void moveToDay(java.util.Calendar day, ilog.views.gantt.IlvActivity[] selected, ilog.views.gantt.IlvGanttChart gchart)
day
- selected
- gchart
- public static void dumpDebugInfoForItem(ilog.views.gantt.IlvGanttChart gchart, ilog.views.gantt.IlvActivity item)
gchart
- item
- public static void dumpDebegInfoForContaints(java.lang.String msg, java.util.Iterator<ilog.views.gantt.IlvConstraint> iter)
public static void dumpDebugInfoForContstraint(ilog.views.gantt.IlvConstraint c)
public static void dumpDebugCompareInfoForItems(java.lang.String msg, ilog.views.gantt.property.IlvUserPropertyHolder item1, ilog.views.gantt.property.IlvUserPropertyHolder item2)
item1
- item2
- public static void copyProperties(ilog.views.gantt.IlvActivity src, ilog.views.gantt.IlvActivity dest)
src
- dest
- public static void showWorkForTimeInterval(long startMillis, long durMillis, ilog.views.gantt.IlvHierarchyChart gchart)
selected
- gchart
- public static void applyVisibleTime(ilog.views.gantt.IlvTimeScrollController timeScroller, ilog.views.gantt.IlvHierarchyChart chart)
timeScroller
- chart
- public static void showWorkForSelectedActivities(ilog.views.gantt.IlvActivity[] selected, ilog.views.gantt.IlvHierarchyChart gchart)
selected
- gchart
- public static void adjustChartForPadding(ilog.views.gantt.IlvHierarchyChart gchart, java.util.Date start, ilog.views.gantt.IlvDuration duration)
public static void showWorkForSelectedResource(ilog.views.gantt.IlvResource selected, ilog.views.gantt.IlvHierarchyChart chart)
selected
- chart
- public static java.util.Date getEarliestStartTime(ilog.views.gantt.IlvActivity[] selected)
selected
- public static java.util.Date getLatestEndTime(ilog.views.gantt.IlvActivity[] selected)
selected
- public static ilog.views.gantt.IlvActivity getParent(ilog.views.gantt.IlvActivity act, ilog.views.gantt.IlvGanttModel model)
act
- model
- public static java.lang.String getID(ilog.views.gantt.IlvHierarchyNode node)
node
- public static boolean setProperty(java.lang.Object node, java.lang.String prop, java.lang.Object val)
IlvHierarchyNode
. The node must implement
IlvUserPropertyHolder
for this to work.node
- prop
- val
- public static java.lang.Object getProperty(java.lang.Object node, java.lang.String prop)
node
- prop
- public static <T> T getProperty(java.lang.Object node, java.lang.String prop, T defaultValue)
T
- node
- prop
- defaultValue
- public static ilog.views.gantt.IlvTimeInterval createUnionTimeInterval(ilog.views.gantt.IlvHierarchyNode... nodes)
charts
- public static boolean isWorkorderApproved(MXActivity source)
source
- public static ilog.views.gantt.IlvActivity getActivityById(ilog.views.gantt.IlvGanttModel model, ilog.views.gantt.IlvActivity parent, java.lang.String id)
model
- id
- public static ilog.views.gantt.IlvHierarchyNode[] getChildren(ilog.views.gantt.IlvHierarchyNode item, ilog.views.gantt.IlvHierarchyChart chart)
item
- chart
- public static void dumpDebugInfoForResource(ilog.views.gantt.IlvResource selectedresource, ilog.views.gantt.IlvGanttModel model)
public static long count(java.util.Iterator<?> items)
items
- public static long countActivities(ilog.views.gantt.IlvHierarchyChart chart)
public static long countResources(ilog.views.gantt.IlvHierarchyChart chart)
public static long countReservations(ilog.views.gantt.IlvScheduleChart chart)
public static boolean hideDurationInTooltip(ilog.views.gantt.IlvActivity act)