A
download FieldAppearenceGuiConf.java
Language: Java
License: LGPL
Copyright: (C) 2001-2003 Renaud Pawlak ,
LOC: 105
Project Info
Java Aspect Components(jac)
Server: ObjectWeb Forge
Type: cvs
...\objectweb\jac\aspects\gui\
   ...CollectionItemView.java
   AbstractNode.java
   Actions.java
   AddEvent.java
   BehaviorGuiConf.java
   Border.java
   Callback.java
   ...sAppearenceGuiConf.java
   ClassChooser.java
   CollectionEvent.java
   CollectionItemView.java
   CollectionModel.java
   CollectionPosition.java
   CollectionUpdate.java
   CollectionView.java
   CollectionWrapper.java
   ComboBoxModel.java
   CommitException.java
   CompositeView.java
   Constants.java
   Currency.java
   CustomizedDisplay.java
   CustomizedGUI.java
   CustomizedView.java
   DateFormat.java
   DateHourFormat.java
   DialogView.java
   DisplayContext.java
   EditorContainer.java
   Event.java
   EventHandler.java
   ExpressionListener.java
   ExprWatcher.java
   ExprWatcherParser.java
   ExtendedTableModel.java
   ...dAppearenceGuiConf.java
   FieldEditor.java
   FieldItemView.java
   FieldUpdate.java
   FieldView.java
   FileEditorConfig.java
   FilterCriteria.java
   FloatFormat.java
   Format.java
   GenericFactory.java
   gui.acc
   GuiAC.java
   GuiConf.java
   HandlerResult.java
   ...tCanceledException.java
   InputSequence.java
   InputWrapper.java
   IntFormat.java
   InvokeEvent.java
   InvokeThread.java
   Length.java
   LessAbstractListModel.java
   LinkGenerator.java
   ListModel.java
   MatrixUtils.java
   MemberItemView.java
   Menu.java
   MenuView.java
   ...dAppearenceGuiConf.java
   MethodItemView.java
   MethodUpdate.java
   MethodView.java
   Model.java
   NumberFormat.java
   ObjectChooserModel.java
   ObjectNode.java
   ObjectUpdate.java
   ObjectView.java
   package.html
   PanelContent.java
   PanelView.java
   PercentFormat.java
   PointFormat.java
   ReferenceEditor.java
   RelationNode.java
   RemoveEvent.java
   Reports.java
   ResourceManager.java
   RootNode.java
   SortCriteria.java
   StatusView.java
   SubstanceEvent.java
   TableCellViewer.java
   TableFilter.java
   TableMap.java
   TableModel.java
   TableSorter.java
   TabsView.java
   Target.java
   Template.java
   TemplateReader.java
   TimeoutException.java
   Transfer.java
   TreeListener.java
   TreeModel.java
   TreeView.java
   Unit.java
   Utils.java
   View.java
   ViewControlWrapper.java
   ViewFactory.java
   ViewIdentity.java
   Views.java
   WaitWrapper.java
   WindowView.java
   WrappableList.java
   WrappableMap.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
/*
  Copyright (C) 2001-2003 Renaud Pawlak <renaud@aopsys.com>, 
                          Laurent Martelli <laurent@aopsys.com>

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as
  published by the Free Software Foundation; either version 2 of the
  License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

package org.objectweb.jac.aspects.gui;

import org.objectweb.jac.core.rtti.*;

/**
 * This configuration interface of the Gui aspect defines all the
 * methods that handle the appearence of the fields in objects views.
 *
 * @see GuiAC
 * @see View
 *
 * @author <a href="mailto:renaud@cnam.fr">Renaud Pawlak</a>
 * @author <a href="mailto:laurent@aopsys.com">Laurent Martelli</a> */

public interface FieldAppearenceGuiConf {

    /**
     * Sets an item to be visible or not.
     *
     * <p>If a field of method item is not visible, it will not be
     * displayed by the object views. If a class item is not visible,
     * then it will not be possible to open a view on objects of this
     * class.
     *
     * <p>By default, the RTTI does not define this property and every
     * item is visble. Thus, the GUI aspect component programmer should
     * overload the default contructor of this class to set some
     * visible attributes to false.<p>
     * 
     * @param member the member item (may be a method or a field name);
     * it can be null to set the whole class visible or not
     * @param visible whether the member must be visible
     *
     * @see GuiAC#isVisible(MetaItem) 
     */
    void setVisible(MemberItem member, boolean visible);

    /**
     * Tells the GUI to use embedded editors in the default view for
     * all fields of a class, whenever possible.
     * @param cl the class item
     * @see FieldEditor 
     */
    void setEmbeddedEditors(ClassItem cl);

    /**
     * Tells the GUI wether to use embedded editors in a view for all
     * fields of a class.
     * @param cl the class item
     * @param viewName the view name
     * @param embedded wether to use embedded editors by default
     * @see FieldEditor 
     */
    void setEmbeddedEditors(ClassItem cl, String viewName, boolean embedded);

    /**
     * Tells wether to use embedded editors for the cells of a table
     * in a given view.
     *
     * @param collection the collection whose table view to configure
     * @param viewName the view name for which to configure
     * @param embedded wether to use embedded editors or not in the cells of the table
     *
     * @see #setEmbeddedEditorColumns(CollectionItem,String,MemberItem[]) */
    void setEmbeddedEditors(
        CollectionItem collection,
        String viewName,
        boolean embedded);

    /**
     * Tells to use embedded editors for the cells of some columns in
     * a given view
     *
     * @param collection the collection whose table view to configure
     * @param viewName the view name for which to configure
     * @param members wether to use embedded editors or not in the cells of the table
     * 
     * @see #setEmbeddedEditors(CollectionItem,String,boolean) 
     */
    void setEmbeddedEditorColumns(
        CollectionItem collection,
        String viewName,
        MemberItem[] members);

    /**
     * This configuration method allows the programmer to set a class
     * member to be internally edited for the default view.
     *
     * @param member the member item to be embedded (may be a
     * field or a method)
     * @see FieldEditor 
     * @see #setEmbeddedEditor(MemberItem,String,boolean)
     */
    void setEmbeddedEditor(MemberItem member);

    /**
     * This configuration method allows the programmer to set a class
     * member to be internally edited.
     *
     * <p>By default, each member of a class is editable with an "edit"
     * button or link that opens a popup that allows the user to edit
     * its value (see the <code>FieldEditor</code> interface). If this
     * configuration method is called, then the editor will be embedded
     * into the object's view the member belongs to.
     *
     * @param member the member item to be embedded (may be a
     * field or a method)
     * @param viewName the view for which to use an embedded
     * editor. "default", "autocreate" or one of your own.
     * @param embedded wether to use an editor or not
     *
     * @see FieldEditor 
     * @see #setEmbeddedEditor(MemberItem,String,boolean) 
     */
    void setEmbeddedEditor(MemberItem member, String viewName, boolean embedded);

    /**
     * Sets a border to the field in an object view.
     *
     * @param field the field
     * @param alignment LEFT: title is on the left, RIGHT:
     * title is on the right, CENTER: title is centered 
     * @param style LINE: the border is a line, ETCHED: the border is a
     * 3D line, LOWERED: the border is a 3D effect that makes the
     * bordered element lowered, RAISED: the border is a 3D effect that
     * makes the bordered element raised.  
     * @see #setBorder(FieldItem)
     */
    void setBorder(FieldItem field, String alignment, String style);

    /**
     * Sets a border to the field in an object view. Uses a default
     * style (LINE) and alignement(LEFT)
     *
     * @param field the field
     * @see #setBorder(FieldItem,String,String)
     */
    void setBorder(FieldItem field);

    /**
     * Sets the width of the field's embedded editor when exist.
     *
     * @param field the field
     * @param width the editor width
     * @see #setEmbeddedEditor(MemberItem) 
     * @see #setEditorHeight(FieldItem,Length)
     * @see #setDefaultEditorWidth(ClassItem,Length)
     */
    void setEditorWidth(FieldItem field, Length width);

    /**
     * Sets the default editor width for value of a given type.
     *
     * @param type the type 
     * @param width the editor width
     *
     * @see #setDefaultEditorWidth(ClassItem,Length)
     * @see #setDefaultEditorHeight(VirtualClassItem,Length)
     * @see #setEditorWidth(FieldItem,Length)
     */
    void setDefaultEditorWidth(VirtualClassItem type, Length width);

    /**
     * Sets the default editor width for value of a given type.
     *
     * @param type the type 
     * @param width the editor width
     *
     * @see #setDefaultEditorWidth(VirtualClassItem,Length)
     * @see #setDefaultEditorHeight(VirtualClassItem,Length)
     * @see #setEditorWidth(FieldItem,Length)
     */
    void setDefaultEditorWidth(ClassItem type, Length width);

    /**
     * Set a field to be editable.
     *
     * @param field the field
     * @param editable the flag (true is default) 
     */
    void setEditable(FieldItem field, boolean editable);

    /**
     * Sets the height of a field's editor. It does not affect single
     * line editors (used by primitive types)
     *
     * @param field the field 
     * @param height the editor height 
     *
     * @see #setEmbeddedEditor(MemberItem) 
     * @see #setEditorWidth(FieldItem,Length)
     * @see #setDefaultEditorHeight(ClassItem,Length) 
     */
    void setEditorHeight(FieldItem field, Length height);

    /**
     * Sets the default editor height for value of a given type.
     *
     * @param type the type 
     * @param height the editor height
     *
     * @see #setDefaultEditorHeight(ClassItem,Length)
     * @see #setDefaultEditorWidth(VirtualClassItem,Length)
     * @see #setEditorHeight(FieldItem,Length)
     */
    void setDefaultEditorHeight(VirtualClassItem type, Length height);

    /**
     * Sets the default editor height for value of a given type.
     *
     * @param type the type 
     * @param height the editor height
     *
     * @see #setDefaultEditorHeight(VirtualClassItem,Length)
     * @see #setDefaultEditorWidth(VirtualClassItem,Length)
     * @see #setEditorHeight(FieldItem,Length)
     */
    void setDefaultEditorHeight(ClassItem type, Length height);

    /**
     * Sets the category of an item of a class.
     *
     * <p>The category must correspond to one of these defined on the
     * class with the <code>setCategories</code> configuration method.
     * 
     * @param member the member to categorize (a method or a field)
     * @param category the existing category name
     * @see #setCategories(MemberItem,String[]) 
     * @see ClassAppearenceGuiConf#setCategories(ClassItem,String[]) 
     */
    void setCategory(MemberItem member, String category);

    /**
     * Sets the categories of an item of a class.
     *
     * <p>The category must correspond to one of these defined on the
     * class with the <code>setCategories</code> configuration method.
     * 
     * @param member the member to categorize (a method or a field)
     * @param categories the existing category names
     * @see #setCategory(MemberItem,String)
     * @see ClassAppearenceGuiConf#setCategories(ClassItem,String[]) 
     */
    void setCategories(MemberItem member, String[] categories);

    /**
     * Tells the GUI to insert a referenced object to be displayed as an
     * embedded view in its container object view.
     *
     * @param member the member (reference field or method) that must
     * be embedded 
     *
     * @see #setEmbeddedView(MemberItem,String,boolean)
     */
    void setEmbeddedView(MemberItem member);

    /**
     * Tells the GUI to insert a referenced object to be displayed as an
     * embedded view in its container object view.
     *
     * @param member the member (reference field or method) that must
     * be embedded 
     * @param viewName the view for which the member must be embedded
     * @param embedded wether to embedded the member or not
     *
     * @see #setEmbeddedView(MemberItem)
     */
    void setEmbeddedView(MemberItem member,
                         String viewName,
                         boolean embedded);

    /**
     * Tells the GUI wether to use an embedded view for the adder of a
     * collection.  
     * @param collection the collection
     * @param embedded wether to use an embedded view for the adder
     */
    void setEmbeddedAdder(CollectionItem collection, boolean embedded);

    /**
     * Sets the render of a given field (more precisely a collection)
     * to be rendered by a table.
     *
     * <p>In a table view, each item of the displayed collection fills
     * a table line. Each column represents one field of the objects
     * whithin the collection (the item within the collection whould be
     * of the same class --- or at least share a common superclass).
     *
     * @param field the field that contains the collection 
     */
    void setTableView(FieldItem field);

    /**
     * Sets the render of a given field (more precisely a collection)
     * to be rendered by a tree view.
     *
     * @param field the field that contains the collection 
     */
    void setTreeView(FieldItem field);

    /**
     * Sets the position of buttons (view,add,remove,...) for a collection
     *
     * @param collection the collection
     * @param position the position of buttons. Can be TOP,BOTTOM,LEFT or RIGHT
     */
    void setButtonsPosition(CollectionItem collection, String position);
    void setButtonsPosition(CollectionItem collection, String viewName,String position);

    /** 
     * Sets the render of a collection to be rendered by a choice and an 
     * embedded view on the selected object.
     * 
     * @param collection the collection 
     * @param external tell if the object is embedded in the current view or if is is opened in an external panel (given by {@link GuiConf#addReferenceToPane(String,MemberItem,String)} 
     */
    void setChoiceView(CollectionItem collection, boolean external);

    /**
     * Tells the GUI wether to show row numbers for tables and lists.
     * @param collection the affected collection
     * @param value wether to show row numbers
     *
     * @see #setDefaultShowRowNumbers(boolean)
     */
    void showRowNumbers(CollectionItem collection, boolean value);

    /**
     * Tells the GUI wether to show row numbers for tables and lists by
     * default.
     *
     * @param value wether to show row numbers
     *
     * @see #showRowNumbers(CollectionItem,boolean) 
     */
    void setDefaultShowRowNumbers(boolean value);

    /**
     * Sets a default sorted column for a collection.
     *
     * <p>By default, collections are not sorted. You can precise a
     * column to use to sort the collection by default. It will be used
     * at the construction of the collection.</p>
     *
     * @param collection the collection
     * @param column the column used to sort (it is a fieldItem, watch
     * out for case). You may preprend a '-' to use the reverse order
     * of that column.
     */
    void setDefaultSortedColumn(CollectionItem collection, String column);

    /**
     * Sets the default order in which the attributes of the elements
     * of a collection are to be rendered.
     *
     * @param collection the collection
     * @param targetClass the class of attributes to render
     * @param memberNames the name of the members in the
     * rendering order
     *
     * @see #setMembersOrder(CollectionItem,String,ClassItem,String[])
     * @see ClassAppearenceGuiConf#setTableMembersOrder(ClassItem,String[])
     * @see ClassAppearenceGuiConf#setAttributesOrder(ClassItem,String[]) */
    void setMembersOrder(
        CollectionItem collection,
        ClassItem targetClass,
        String[] memberNames);

    /**
     * Sets the order in which the attributes of the elements of a
     * collection are to be rendered for a given view.
     *
     * @param collection the collection
     * @param viewName the type for which to set the members order
     * @param targetClass the class of attributes to render
     * @param memberNames the name of the members in the
     * rendering order
     * 
     * @see #setMembersOrder(CollectionItem,ClassItem,String[]) */
    void setMembersOrder(
        CollectionItem collection,
        String viewName,
        ClassItem targetClass,
        String[] memberNames);

    /**
     * This configuration method allows the programmer to make a set of
     * object to be proposed to the final user when an edition of this
     * field value is performed.
     *
     * <p>Most of the GUI will propose the choice within a ComboBox.
     *
     * <p>When the choices values can not be defined at programming
     * time but must be dynamically created, then the programmer can
     * use the <code>setDynamicFieldChoice</code> method.
     *
     * @param field the field
     * @param choice the values the user will have to choose from when
     * a edition of the field is performed
     *
     * @see #setDynamicFieldChoice(FieldItem,Boolean,ClassItem,String) 
     * @see #setFieldChoice(FieldItem,Boolean,String[])
     * @see #setFieldEnum(FieldItem,String)
     * @see GuiConf#defineEnum(String,String[],int,int)
     */
    void setFieldChoice(FieldItem field, Boolean editable, String[] choice);

    /**
     * <p>Declare a field as an enumeration.</p>
     *
     * @param field the field
     * @param enumeration the name of the enumeration
     *
     * @see GuiConf#defineEnum(String,String[],int,int)
     * @see #setFieldChoice(FieldItem,Boolean,String[])
     * @see #setDynamicFieldChoice(FieldItem,Boolean,ClassItem,String) 
     */
    void setFieldEnum(FieldItem field, String enumeration);

    /**
     * Same as <code>setFieldChoice</code> but with dynamically
     * defined values.
     *
     * <p>The values are dynamically defined at runtime by the
     * invocation of a target method. This target method must return a
     * collection of objects or an array of objects that contains the
     * possible new values for the fields.</p>
     *
     * <p>If the target method is static, it will be called with the
     * object as the only parameter. If it's not static, it will called
     * <em>on</em> the object with no parameters.</p>
     *
     * @param field the field
     * @param editable wether the user is allowed to enter a value not 
     * in the list
     * @param targetClass the class that contains the target method
     * @param targetMethod name of a static method within the target
     * class that returns the values to choose from. It must take an
     * Object as parameter which will be the instance to which the
     * field belongs to.  
     *
     * @see #setDynamicFieldChoice(FieldItem,Boolean,MethodItem) 
     * @see ClassAppearenceGuiConf#setDynamicClassChoice(String,MethodItem)
     */
    void setDynamicFieldChoice(
        FieldItem field,
        Boolean editable,
        ClassItem targetClass,
        String targetMethod);

    /**
     * Same as <code>setFieldChoice</code> but with dynamically
     * defined values.
     *
     * @param field the field
     * @param editable wether the user is allowed to enter a value not
     * in the list
     * @param targetMethod a static method that returns the values to
     * choose from. It must take an Object as parameter which will be
     * the instance to which the field belongs to.
     *
     * @see #setDynamicFieldChoice(FieldItem,Boolean,ClassItem,String) 
     * @see ClassAppearenceGuiConf#setDynamicClassChoice(String,MethodItem) 
     */
    void setDynamicFieldChoice(
        FieldItem field,
        Boolean editable,
        MethodItem targetMethod);

    /**
     * Use objects from a collection as the available choices to edit
     * a reference field.
     *
     * @param field the edited reference field
     * @param editable wether the user is allowed to enter a value not
     * in the list
     * @param targetCollection the collection. It must belong to same class
     * as the field. 
     */
    void setDynamicFieldChoice(
        FieldItem field,
        Boolean editable,
        CollectionItem targetCollection);

    /**
     * Set the type of the objects of a collection.
     *
     * <p>If this method is not used, the collection type can be
     * dynamically found out by the GUI from the adder's argument
     * types.
     *
     * @param collection the collection within this class 
     * @param type the type of this collection (an exiting class name) 
     */
    void setCollectionType(CollectionItem collection, String type);

    /**
     * Tells the preferred height a table or list view of a collection
     * should take, if possible.
     *
     * @param collection the collection
     * @param height the preferred height 
     *
     * @see #setPreferredWidth(CollectionItem,Length)
     */
    void setPreferredHeight(CollectionItem collection, Length height);

    /**
     * Tells the preferred width a table or list view of a collection
     * should take, if possible.
     *
     * @param collection the collection
     * @param width the preferred width 
     *
     * @see #setPreferredHeight(CollectionItem,Length)
     */
    void setPreferredWidth(CollectionItem collection, Length width);

    /**
     * Sets the number of rows to display simultaneously for a
     * collection. 
     *
     * <p>This is only used by the web GUI so that generated
     * web pages are not too big. If the number of elements in the
     * collection is bigger than numRows, a "previous" and a "next"
     * button are displayed so that the user can see the rest of the
     * collection. The default is 10. Use 0 to display all rows.</p>
     *
     * @param collection the collection
     * @param numRows the number of rows per page 
     *
     * @see #setAvailableNumRowsPerPage(CollectionItem,int[])
     */
    void setNumRowsPerPage(CollectionItem collection, int numRows);

    /**
     * Causes the view of a collection to let the user selects the
     * number of rows to display simultaneously at runtime.
     *
     * @param collection the collection
     * @param numRows the numbers of rows per page the user can choose from.
     *
     * @see #setNumRowsPerPage(CollectionItem,int) 
     */
    void setAvailableNumRowsPerPage(CollectionItem collection, int[] numRows);

    /**
     * Enables the user to filter a table by retaining only rows whose
     * columns have a given value. This feature is only available on
     * the web GUI for the moment.
     * @param collection the collection to configure
     * @param columnNames the field names (from the collection's
     * component type) that can be filtered 
     */
    void showColumnFilters(CollectionItem collection,                                  
                           String[] columnNames);
    /**
     * Sets the view of a given setter's calling box to be a file
     * chooser.<p>
     *
     * As logically expected, the type of the set field must be a
     * String or an URL.<p>
     *
     * @param method the method item. It can be of the form
     * "methodName" or "methodName(<types>)". The first syntax will use
     * the method with that name. The second syntax allow you to
     * specify parameter types (separated by commas, with no spaces).
     * @param fileExtensions allowed file extensions to choose from
     * @param fileDescription
     *
     * @see java.net.URL
     * @see GuiAC#isFileChooserView(MethodItem) 
     */
    void setFileChooserView(
        MethodItem method,
        String[] fileExtensions,
        String fileDescription);

    /**
     * Add some allowed file extensions for File field.
     *
     * @param field the field
     * @param fileExtensions a list of allowed file extensions to
     * choose from (for instance {"html","xhtml"})
     * @param fileDescription a description for those file extensions
     * (for instance "HTML documents")
     */
    /*
    void addAllowedFileExtensions(
        FieldItem field,
        String[] fileExtensions,
        String fileDescription);
    */

    /**
     * This configuration method attaches an icon to a given field so
     * that the iconized instances of this field will be represented by
     * this icon (for instance in a treeview).
     *
     * @param member the member (field or method)
     * @param name the icon's resource name 
     */
    void setIcon(MemberItem member, String name);

    /**
     * This configuration method allows not to use a node to represent
     * a given relation (collection) in a treeview, even if the show
     * relations mode is on .
     *
     * @param field the field 
     */
    void hideTreeRelation(FieldItem field);

    /**
     * Set the default value for a choice.
     *
     * <p>The default value is dynamically calculated by the
     * <code>method</code> parameter from the string value (result can
     * be an object). A default implementation for method is provided
     * by <code>GuiAC</code>.
     *
     * @param field the field
     * @param method a static method that returns the default value
     * (prototype: Object m(FieldItem,String))
     * @param value the string representation of the default value
     * @see GuiAC#getDefaultValue(FieldItem,String) */
    void setDefaultValue(FieldItem field, MethodItem method, String value);

    /**
     * Set the default value for a choice.
     *
     * <p>Same as setDefaultValue(ClassItem, String, MethodItem, String)
     * using default MethodItem <code>GuiAC.getDefaultValue</code>.
     *
     * @param field the field
     * @param value the string representation of the default value
     * @see GuiAC#getDefaultValue(FieldItem,String)
     * @see #setDefaultValue(FieldItem,MethodItem,String) 
     */
    void setDefaultValue(FieldItem field, String value);

    /**
     * Sets the display format of a float or double field.
     *
     * @param field the field
     * @param format the display format of the field
     *
     * @see java.text.DecimalFormat
     */
    void setFloatFormat(FieldItem field, String format);

    /**
     * Sets the description of a class member (field of method).
     *
     * @param member the member
     * @param description the description of the class member
     */
    void setDescription(MemberItem member, String description);

    /**
     * Sets the label of a class member (field of method).
     *
     * @param member the member
     * @param label the label of the class member
     * @see #setLabel(MemberItem,MemberItem,String)
     */
    void setLabel(MemberItem member, String label);

    /**
     * Sets the label of a class member (field of method) for a given
     * context
     *
     * @param member the member
     * @param selector use the label when inside the view of his member item
     * @param label the label of the class member
     * @see #setLabel(MemberItem,String) 
     */
    void setLabel(MemberItem member, MemberItem selector, String label);

    /**
     * Wether to display a label containing the name of the field in views.
     *
     * @param member the member
     * @param value boolean indicating wether to display the label
     */
    void setDisplayLabel(MemberItem member, boolean value);

    /**
     * Set the style of a field
     *
     * @param field the field
     * @param style the CSS style
     *
     * @see ClassAppearenceGuiConf#setStyle(ClassItem,String)
     * @see GuiConf#addStyleSheetURL(String)
     * @see GuiConf#addStyleSheetURL(String,String)
     */
    void setStyle(FieldItem field, String style);

    /**
     * Tells wether to show an add button for a collection
     *
     * @param collection the collection to configure
     * @param addable wether to show a button or not
     *
     * @see #setRemovable(CollectionItem,boolean)
     */
    void setAddable(CollectionItem collection, boolean addable);

    /**
     * Tells wether to show remove buttons for items of a collection
     *
     * @param collection the collection to configure
     * @param removable wether to show buttons or not
     *
     * @see #setAddable(CollectionItem,boolean)
     */
    void setRemovable(CollectionItem collection, boolean removable);

    /**
     * Sets the view type of a field instead of using the default
     * one ("List" or "Table"). It allows you to define a custom view
     * constructor for that type in order to handle complex tables.
     * The view constructor must take 3 arguments: a CollectionItem, an
     * Object (the susbtance), and a CollectionItemView)
     */
    void setViewType(FieldItem field, String viewName, String viewType);

    /**
     * Tells wether items in the default view of a collection have a
     * "view" button to open a view of the item.
     *
     * @param collection the collection
     * @param viewable wether items are viewable
     * 
     * @see #setViewableItems(CollectionItem,String,boolean) 
     */
    void setViewableItems(CollectionItem collection, boolean viewable);

    /**
     * Tells wether items in a given default view of a collection have
     * a "view" button to open a view of the item.
     *
     * @param collection the collection
     * @param viewName the view to configure
     * @param viewable wether items have a view button
     *
     * @see #setViewableItems(CollectionItem,boolean) 
     */
    void setViewableItems(CollectionItem collection, String viewName, boolean viewable);
    
    /**
     * Enables or disables links for references in cells of a table
     */
    void setEnableLinks(CollectionItem collection, String viewName, boolean enable);

    /**
     * Groups cells of table.
     *
     * @param collection the collection whose table cells to group
     * @param viewName the view to configure
     * @param groupBy group adjacent cells with same values of columns
     * whose field start with this field
     *
     * @see #setMultiLineCollection(CollectionItem,String,CollectionItem)
     */
    void groupBy(CollectionItem collection,
                 String viewName,
                 FieldItem groupBy);

    /**
     * Creates subrows in some cells of a table.
     *
     * @param collection the collection whose table cells to subdivide
     * @param viewName the view to configure
     * @param multiLine subdivide cells of columns whose field start
     * with this field
     *
     * @see #groupBy(CollectionItem,String,FieldItem)
     */
    void setMultiLineCollection(CollectionItem collection,
                                String viewName,
                                CollectionItem multiLine);

    /**
     * Use a field as a row to be added at the end of a table
     */
    void setAdditionalRow(CollectionItem collection,String viewName,
                          String row);

    /**
     * Sets the view type to use for cells of a column of table,
     * instead of the default one.
     * 
     * @param collection the collection to configure
     * @param viewName the view to configure
     * @param column the column to configure
     * @param viewType the view type to use for that column
     *
     * @see GuiConf#setViewConstructor(String,String,AbstractMethodItem)
     */
    void setCellViewType(CollectionItem collection, String viewName, 
                         FieldItem column, String viewType);

    /**
     * Defines preferred mnemonics for field of method.
     * @param method 
     * @param mnemonics the mnemonics
     */
    void setMnemonics(MemberItem method, String mnemonics);

    /**
     * Sets the string to display instead of "true" and "false" for a boolean field.
     * @param field a field
     * @param trueValue string to display instead of "true"
     * @param falseValue string to display instead of "false"
     */
    void setFieldBooleanValues(FieldItem field, String trueValue, String falseValue);


    /**
     * Sets the width to use for table columns
     *
     * @param member the class to configure
     * @param preferred the preferred width of the column,
     * @param min the minimum width of the column
     * @param max the maximum width of the column
     *
     * @see ClassAppearenceGuiConf#setColumnWidth(ClassItem,Length,Length,Length) 
     */
    void setColumnWidth(MemberItem member, Length preferred, Length min, Length max);

}

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us