KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > cheatsheets > data > CheatSheet


1 /*******************************************************************************
2  * Copyright (c) 2002, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.cheatsheets.data;
12
13 import java.util.ArrayList JavaDoc;
14 import java.util.Collection JavaDoc;
15
16 /**
17  *
18  */

19 public class CheatSheet implements ICheatSheet {
20     
21     protected String JavaDoc title;
22     private Item introItem;
23     private ArrayList JavaDoc items;
24     private boolean containsCommandOrAction;
25
26     /**
27      * Creates a new cheat sheet.
28      *
29      */

30     public CheatSheet() {
31     }
32
33     /**
34      * This method sets the title of cheat sheet.
35      *
36      * @param title the title of cheat sheet
37      */

38     public void setTitle(String JavaDoc title) {
39         this.title = title;
40     }
41
42     /**
43      * This method returns the title of the cheat sheet.
44      * @return the title of the cheat sheet
45      */

46     public String JavaDoc getTitle(){
47         return title;
48     }
49
50     /**
51      * Returns the intro item.
52      */

53     public Item getIntroItem() {
54         return introItem;
55     }
56
57     /**
58      * Returns the items.
59      */

60     public ArrayList JavaDoc getItems() {
61         return items;
62     }
63
64     /**
65      * Returns the intro item.
66      */

67     public void setIntroItem(Item intro) {
68         introItem = intro;
69     }
70
71     /**
72      * Adds an item to the cheat sheet.
73      *
74      * @param item the item to add
75      */

76     public void addItem(Item item) {
77         if(items == null) {
78             items = new ArrayList JavaDoc();
79         }
80         items.add(item);
81     }
82
83     /**
84      * Adds all the items from the collection to the cheat sheet.
85      *
86      * @param c the collection of items to add
87      */

88     public void addItems(Collection JavaDoc c) {
89         if(items == null) {
90             items = new ArrayList JavaDoc();
91         }
92         items.addAll(c);
93     }
94
95     public void setContainsCommandOrAction(boolean containsCommandOrAction) {
96         this.containsCommandOrAction = containsCommandOrAction;
97     }
98
99     public boolean isContainsCommandOrAction() {
100         return containsCommandOrAction;
101     }
102 }
103
Popular Tags