001: package net.sourceforge.squirrel_sql.plugins.oracle.prefs;
002:
003: /*
004: * Copyright (C) 2007 Rob Manning
005: * manningr@users.sourceforge.net
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or (at your option) any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: */
021: import java.io.Serializable;
022:
023: import net.sourceforge.squirrel_sql.fw.preferences.IQueryTokenizerPreferenceBean;
024:
025: /**
026: * A bean class to store preferences for the Oracle plugin.
027: */
028: public class OraclePreferenceBean implements Cloneable, Serializable,
029: IQueryTokenizerPreferenceBean {
030:
031: static final long serialVersionUID = 5818886723165356478L;
032:
033: static final String UNSUPPORTED = "Unsupported";
034:
035: /** Client Name. */
036: private String _clientName;
037:
038: /** Client version. */
039: private String _clientVersion;
040:
041: private String statementSeparator = ";";
042:
043: private String procedureSeparator = "/";
044:
045: private String lineComment = "--";
046:
047: private boolean removeMultiLineComments = false;
048:
049: private boolean installCustomQueryTokenizer = true;
050:
051: private boolean excludeRecycleBinTables = true;
052:
053: private boolean showErrorOffset = true;
054:
055: public OraclePreferenceBean() {
056: super ();
057: }
058:
059: /**
060: * Return a copy of this object.
061: */
062: public Object clone() {
063: try {
064: return super .clone();
065: } catch (CloneNotSupportedException ex) {
066: throw new InternalError(ex.getMessage()); // Impossible.
067: }
068: }
069:
070: /**
071: * Retrieve the client to use. This is only used if <TT>useAnonymousClient</TT>
072: * is false.
073: *
074: * @return Client name.
075: */
076: public String getClientName() {
077: return _clientName;
078: }
079:
080: /**
081: * Set the client name.
082: *
083: * @param value
084: * Client name
085: */
086: public void setClientName(String value) {
087: _clientName = value;
088: }
089:
090: /**
091: * Retrieve the client version to use. This is only used if <TT>useAnonymousLogon</TT>
092: * is false.
093: *
094: * @return Client version.
095: */
096: public String getClientVersion() {
097: return _clientVersion;
098: }
099:
100: /**
101: * Set the client version.
102: *
103: * @param value
104: * Client version
105: */
106: public void setClientVersion(String value) {
107: _clientVersion = value;
108: }
109:
110: /**
111: * @see net.sourceforge.squirrel_sql.plugins.oracle.prefs.IQueryTokenizerPreferenceBean#setStatementSeparator(java.lang.String)
112: */
113: public void setStatementSeparator(String statementSeparator) {
114: this .statementSeparator = statementSeparator;
115: }
116:
117: /**
118: * @see net.sourceforge.squirrel_sql.plugins.oracle.prefs.IQueryTokenizerPreferenceBean#getStatementSeparator()
119: */
120: public String getStatementSeparator() {
121: return statementSeparator;
122: }
123:
124: /**
125: * @see net.sourceforge.squirrel_sql.plugins.oracle.prefs.IQueryTokenizerPreferenceBean#setProcedureSeparator(java.lang.String)
126: */
127: public void setProcedureSeparator(String procedureSeparator) {
128: this .procedureSeparator = procedureSeparator;
129: }
130:
131: /**
132: * @see net.sourceforge.squirrel_sql.plugins.oracle.prefs.IQueryTokenizerPreferenceBean#getProcedureSeparator()
133: */
134: public String getProcedureSeparator() {
135: return procedureSeparator;
136: }
137:
138: /**
139: * @see net.sourceforge.squirrel_sql.plugins.oracle.prefs.IQueryTokenizerPreferenceBean#setLineComment(java.lang.String)
140: */
141: public void setLineComment(String lineComment) {
142: this .lineComment = lineComment;
143: }
144:
145: /**
146: * @see net.sourceforge.squirrel_sql.plugins.oracle.prefs.IQueryTokenizerPreferenceBean#getLineComment()
147: */
148: public String getLineComment() {
149: return lineComment;
150: }
151:
152: /**
153: * @see net.sourceforge.squirrel_sql.plugins.oracle.prefs.IQueryTokenizerPreferenceBean#setRemoveMultiLineComments(boolean)
154: */
155: public void setRemoveMultiLineComments(
156: boolean removeMultiLineComments) {
157: this .removeMultiLineComments = removeMultiLineComments;
158: }
159:
160: /**
161: * @see net.sourceforge.squirrel_sql.plugins.oracle.prefs.IQueryTokenizerPreferenceBean#isRemoveMultiLineComments()
162: */
163: public boolean isRemoveMultiLineComments() {
164: return removeMultiLineComments;
165: }
166:
167: /**
168: * @see net.sourceforge.squirrel_sql.plugins.oracle.prefs.IQueryTokenizerPreferenceBean#setInstallCustomQueryTokenizer(boolean)
169: */
170: public void setInstallCustomQueryTokenizer(
171: boolean installCustomQueryTokenizer) {
172: this .installCustomQueryTokenizer = installCustomQueryTokenizer;
173: }
174:
175: /**
176: * @see net.sourceforge.squirrel_sql.plugins.oracle.prefs.IQueryTokenizerPreferenceBean#isInstallCustomQueryTokenizer()
177: */
178: public boolean isInstallCustomQueryTokenizer() {
179: return installCustomQueryTokenizer;
180: }
181:
182: /**
183: * @param excludeRecycleBinTables the excludeRecycleBinTables to set
184: */
185: public void setExcludeRecycleBinTables(
186: boolean excludeRecycleBinTables) {
187: this .excludeRecycleBinTables = excludeRecycleBinTables;
188: }
189:
190: /**
191: * @return the excludeRecycleBinTables
192: */
193: public boolean isExcludeRecycleBinTables() {
194: return excludeRecycleBinTables;
195: }
196:
197: /**
198: * @return the showErrorOffset
199: */
200: public boolean isShowErrorOffset() {
201: return showErrorOffset;
202: }
203:
204: /**
205: * @param showErrorOffset the showErrorOffset to set
206: */
207: public void setShowErrorOffset(boolean showErrorOffset) {
208: this.showErrorOffset = showErrorOffset;
209: }
210:
211: }
|