Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/aspectj/tools/ajde/jbuilder/JBuilderOptionsPanel.java


1   
2   /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3    *
4    * This file is part of the IDE support for the AspectJ(tm)
5    * programming language; see http://aspectj.org
6    *
7    * The contents of this file are subject to the Mozilla Public License
8    * Version 1.1 (the "License"); you may not use this file except in
9    * compliance with the License. You may obtain a copy of the License at
10   * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
11   *
12   * Software distributed under the License is distributed on an "AS IS" basis,
13   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14   * for the specific language governing rights and limitations under the
15   * License.
16   *
17   * The Original Code is AspectJ.
18   *
19   * The Initial Developer of the Original Code is Xerox Corporation. Portions
20   * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation.
21   * All Rights Reserved.
22   *
23   * Contributor(s):
24   */
25  
26  package org.aspectj.tools.ajde.jbuilder;
27  
28  import java.io.*;
29  import javax.swing.*;
30  import java.awt.*;
31  import javax.swing.border.*;
32  import com.borland.primetime.ide.*;
33  import com.borland.primetime.actions.*;
34  import com.borland.primetime.node.*;
35  import com.borland.jbuilder.node.*;
36  import com.borland.primetime.editor.*;
37  import com.borland.primetime.ide.*;
38  import com.borland.primetime.vfs.*;
39  import com.borland.jbuilder.runtime.*;
40  import com.borland.primetime.runtime.*;
41  import com.borland.primetime.viewer.*;
42  import com.borland.primetime.properties.*;
43  import org.aspectj.ajde.ui.swing.*;
44  import org.aspectj.ajde.*;
45  
46  /**
47   * @author Mik Kersten
48   */
49  public class JBuilderOptionsPanel extends OptionsPanel {
50    
51    private JPanel runOptions_panel = new JPanel();
52    private JPanel build_panel = new JPanel();
53    private FlowLayout flowLayout1 = new FlowLayout();
54    private BorderLayout borderLayout4 = new BorderLayout();
55    private JPanel buildPaths_panel = new JPanel();
56    private Box compileOptions_box3 = Box.createVerticalBox();
57    private BorderLayout borderLayout1 = new BorderLayout();
58    private TitledBorder titledBorder1;
59    private Border border2;
60    private TitledBorder titledBorder2;
61    private Border border4;
62      private JCheckBox annotateSubMembers_checkBox = new JCheckBox();
63      private JCheckBox annotateMembers_checkBox = new JCheckBox();
64      private Border border1;
65      private TitledBorder titledBorder3;
66      private Border border3;
67  
68    public JBuilderOptionsPanel() {
69      try {
70        jbInit();
71        this.setName("JBuilder Integration Options");
72      } catch (Exception e) {
73        e.printStackTrace();
74      }
75    }
76  
77    public void loadOptions() throws IOException {
78      annotateMembers_checkBox.setSelected(
79        JBuilderManager.INSTANCE.getProjectProperties().getMemberAndTypeInlineAnnotations()
80      );
81      annotateSubMembers_checkBox.setSelected(
82        JBuilderManager.INSTANCE.getProjectProperties().getCodeInlineAnnotations()
83      );
84    }
85  
86    public void saveOptions() throws IOException {
87      JBuilderManager.INSTANCE.getProjectProperties().setMemberAndTypeInlineAnnotations(
88        annotateMembers_checkBox.isSelected()
89      );
90      JBuilderManager.INSTANCE.getProjectProperties().setCodeInlineAnnotations(
91        annotateSubMembers_checkBox.isSelected()
92      );
93      
94          JBuilderManager.INSTANCE.clearCurrentGutter();
95      JBuilderManager.INSTANCE.updateInlineAnnotations();
96      
97  //    try {
98  //      Node node = Browser.getActiveBrowser().getActiveNode();
99  //      Browser.getActiveBrowser().closeNode(node);
100 //      Ajde.getDefault().getEditorManager().showSourceLine(node.getLongDisplayName(), 1, false);
101 //    } catch (Exception e) { }
102   }  
103 
104   private void jbInit() throws Exception {
105     titledBorder1 = new TitledBorder(border1, "ajc Build Paths");
106     border2 =
107       BorderFactory.createCompoundBorder(new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(156, 156, 158)),"Gutter Structure Annotations"),BorderFactory.createEmptyBorder(5,5,5,5));
108     titledBorder2 = new TitledBorder(border3, "Run Options");
109     border4 =
110       BorderFactory.createCompoundBorder(
111         titledBorder2,
112         BorderFactory.createEmptyBorder(5, 5, 5, 5));
113     border1 = BorderFactory.createEtchedBorder(Color.white,new Color(156, 156, 158));
114     titledBorder3 = new TitledBorder(border1,"Gutter Structure Annotations");
115     border3 = BorderFactory.createCompoundBorder(titledBorder3,BorderFactory.createEmptyBorder(5,5,5,5));
116     this.setLayout(borderLayout1);
117     build_panel.setLayout(borderLayout4);
118     buildPaths_panel.setLayout(flowLayout1);
119     buildPaths_panel.setBorder(border3);
120     titledBorder1.setTitleFont(new java.awt.Font("Dialog", 0, 11));
121     titledBorder2.setTitleFont(new java.awt.Font("Dialog", 0, 11));
122     annotateSubMembers_checkBox.setFont(new java.awt.Font("Dialog", 0, 11));
123     annotateSubMembers_checkBox.setText("Show annotations for sub-member elements (not visible in tree view)");
124     annotateMembers_checkBox.setFont(new java.awt.Font("Dialog", 0, 11));
125     annotateMembers_checkBox.setText("Show annotations for members and types (visible in tree view)");
126     titledBorder3.setTitleFont(new java.awt.Font("Dialog", 0, 11));
127     build_panel.add(buildPaths_panel,  BorderLayout.NORTH);
128     build_panel.add(runOptions_panel,  BorderLayout.CENTER);
129     buildPaths_panel.add(compileOptions_box3, null);
130     compileOptions_box3.add(annotateMembers_checkBox, null);
131     compileOptions_box3.add(annotateSubMembers_checkBox, null);
132     this.add(build_panel, BorderLayout.NORTH);
133   }
134 
135 }