001: /*
002: * Copyright (C) 2005 - 2008 JasperSoft Corporation. All rights reserved.
003: * http://www.jaspersoft.com.
004: *
005: * Unless you have purchased a commercial license agreement from JasperSoft,
006: * the following license terms apply:
007: *
008: * This program is free software; you can redistribute it and/or modify
009: * it under the terms of the GNU General Public License version 2 as published by
010: * the Free Software Foundation.
011: *
012: * This program is distributed WITHOUT ANY WARRANTY; and without the
013: * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
014: * See the GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
018: * or write to:
019: *
020: * Free Software Foundation, Inc.,
021: * 59 Temple Place - Suite 330,
022: * Boston, MA USA 02111-1307
023: *
024: *
025: *
026: *
027: * JRSQLExpressionArea.java
028: *
029: * Created on 28 aprile 2003, 22.55
030: *
031: */
032:
033: package it.businesslogic.ireport.gui;
034:
035: import org.syntax.jedit.*;
036:
037: /**
038: *
039: * @author Administrator
040: */
041: public class JRSQLExpressionArea extends JEditTextArea {
042:
043: private int spessore = 0;
044: protected boolean viewScrollbars = true;
045:
046: /** Creates a new instance of JRTextExpressionArea */
047: public JRSQLExpressionArea() {
048: super ();
049: spessore = vertical.getWidth();
050: super .painter.setLineHighlightColor(java.awt.Color.WHITE);
051: this .setDocument(new SyntaxDocument());
052: this
053: .setTokenMarker(new org.syntax.jedit.tokenmarker.TSQLTokenMarker());
054: }
055:
056: /** Getter for property viewScrollbars.
057: * @return Value of property viewScrollbars.
058: *
059: */
060: public boolean isViewScrollbars() {
061: return viewScrollbars;
062: }
063:
064: /** Setter for property viewScrollbars.
065: * @param viewScrollbars New value of property viewScrollbars.
066: *
067: */
068: public void setViewScrollbars(boolean viewScrollbars) {
069:
070: //System.out.println("Ops"+viewScrollbars);
071: //if (this.viewScrollbars == viewScrollbars) return;
072: if (!viewScrollbars) {
073: //super.vertical.setVisible(false);
074: //super.horizontal.setVisible(false);
075:
076: //super.vertical.setSize(0,0);
077: } else {
078: //super.vertical.setVisible(true);
079: //super.horizontal.setVisible(true);
080: //super.vertical.setSize(spessore, super.vertical.getHeight());
081: //super.horizontal.setSize(spessore, super.horizontal.getWidth());
082: }
083: this .viewScrollbars = viewScrollbars;
084: }
085:
086: public void setEnabled(boolean enabled) {
087: if (super .isEnabled() == enabled)
088: return;
089: super .setEnabled(enabled);
090: if (!super .isEnabled()) {
091: for (int i = 0; i < this .getComponentCount(); ++i)
092: this .getComponent(i).setBackground(
093: java.awt.Color.LIGHT_GRAY);
094: this .setCaretVisible(false);
095: this .getPainter().setLineHighlightEnabled(false);
096:
097: } else {
098: for (int i = 0; i < this .getComponentCount(); ++i)
099: this .getComponent(i)
100: .setBackground(java.awt.Color.WHITE);
101: this .setCaretVisible(true);
102: this .getPainter().setLineHighlightEnabled(true);
103: }
104: }
105:
106: }
|