KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > antlr > works > components > project > file > CContainerProjectGrammar


1 package org.antlr.works.components.project.file;
2
3 import org.antlr.works.components.ComponentDocument;
4 import org.antlr.works.components.ComponentEditor;
5 import org.antlr.works.components.grammar.CDocumentGrammar;
6 import org.antlr.works.components.grammar.CEditorGrammar;
7 import org.antlr.works.components.project.CContainerProject;
8 import org.antlr.works.project.ProjectFileItem;
9
10 import javax.swing.*;
11 import java.awt.*;
12 /*
13
14 [The "BSD licence"]
15 Copyright (c) 2005-2006 Jean Bovet
16 All rights reserved.
17
18 Redistribution and use in source and binary forms, with or without
19 modification, are permitted provided that the following conditions
20 are met:
21
22 1. Redistributions of source code must retain the above copyright
23 notice, this list of conditions and the following disclaimer.
24 2. Redistributions in binary form must reproduce the above copyright
25 notice, this list of conditions and the following disclaimer in the
26 documentation and/or other materials provided with the distribution.
27 3. The name of the author may not be used to endorse or promote products
28 derived from this software without specific prior written permission.
29
30 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
31 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
32 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
33 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
34 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
35 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
39 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40
41 */

42
43 public class CContainerProjectGrammar extends CContainerProjectFile {
44
45     public CContainerProjectGrammar(CContainerProject project, ProjectFileItem item) {
46         super(project, item);
47     }
48
49     public void awake() {
50         // We need to set a border for the grammar panel because it doesn't
51
// have one by default when used alone in a window
52
editor.getPanel().setBorder(BorderFactory.createMatteBorder(0, 1, 0, 0, Color.lightGray));
53     }
54
55     public ComponentDocument createDocument() {
56         return new CDocumentGrammar();
57     }
58
59     public ComponentEditor createEditor() {
60         return new CEditorGrammar(this);
61     }
62 }
63
Popular Tags