jrechtacek@0
|
1 |
/*
|
jrechtacek@0
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
jrechtacek@0
|
3 |
*
|
jrechtacek@0
|
4 |
* Copyright 2011 Oracle and/or its affiliates. All rights reserved.
|
jrechtacek@0
|
5 |
*
|
jrechtacek@0
|
6 |
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
|
jrechtacek@0
|
7 |
* Other names may be trademarks of their respective owners.
|
jrechtacek@0
|
8 |
*
|
jrechtacek@0
|
9 |
* The contents of this file are subject to the terms of either the GNU
|
jrechtacek@0
|
10 |
* General Public License Version 2 only ("GPL") or the Common
|
jrechtacek@0
|
11 |
* Development and Distribution License("CDDL") (collectively, the
|
jrechtacek@0
|
12 |
* "License"). You may not use this file except in compliance with the
|
jrechtacek@0
|
13 |
* License. You can obtain a copy of the License at
|
jrechtacek@0
|
14 |
* http://www.netbeans.org/cddl-gplv2.html
|
jrechtacek@0
|
15 |
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
|
jrechtacek@0
|
16 |
* specific language governing permissions and limitations under the
|
jrechtacek@0
|
17 |
* License. When distributing the software, include this License Header
|
jrechtacek@0
|
18 |
* Notice in each file and include the License file at
|
jrechtacek@0
|
19 |
* nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
|
jrechtacek@0
|
20 |
* particular file as subject to the "Classpath" exception as provided
|
jrechtacek@0
|
21 |
* by Oracle in the GPL Version 2 section of the License file that
|
jrechtacek@0
|
22 |
* accompanied this code. If applicable, add the following below the
|
jrechtacek@0
|
23 |
* License Header, with the fields enclosed by brackets [] replaced by
|
jrechtacek@0
|
24 |
* your own identifying information:
|
jrechtacek@0
|
25 |
* "Portions Copyrighted [year] [name of copyright owner]"
|
jrechtacek@0
|
26 |
*
|
jrechtacek@0
|
27 |
* If you wish your version of this file to be governed by only the CDDL
|
jrechtacek@0
|
28 |
* or only the GPL Version 2, indicate your decision by adding
|
jrechtacek@0
|
29 |
* "[Contributor] elects to include this software in this distribution
|
jrechtacek@0
|
30 |
* under the [CDDL or GPL Version 2] license." If you do not indicate a
|
jrechtacek@0
|
31 |
* single choice of license, a recipient has the option to distribute
|
jrechtacek@0
|
32 |
* your version of this file under either the CDDL, the GPL Version 2 or
|
jrechtacek@0
|
33 |
* to extend the choice of license to its licensees as provided above.
|
jrechtacek@0
|
34 |
* However, if you add GPL Version 2 code and therefore, elected the GPL
|
jrechtacek@0
|
35 |
* Version 2 license, then the option applies only if the new code is
|
jrechtacek@0
|
36 |
* made subject to such option by the copyright holder.
|
jrechtacek@0
|
37 |
*
|
jrechtacek@0
|
38 |
* Contributor(s):
|
jrechtacek@0
|
39 |
*
|
jrechtacek@0
|
40 |
* Portions Copyrighted 2011 Sun Microsystems, Inc.
|
jrechtacek@0
|
41 |
*/
|
jrechtacek@0
|
42 |
package org.netbeans.modules.plsql.fold;
|
jrechtacek@0
|
43 |
|
jrechtacek@0
|
44 |
import org.netbeans.spi.editor.fold.FoldManager;
|
jrechtacek@0
|
45 |
import org.netbeans.spi.editor.fold.FoldManagerFactory;
|
jrechtacek@0
|
46 |
|
jrechtacek@0
|
47 |
/**
|
jrechtacek@0
|
48 |
*
|
jrechtacek@0
|
49 |
* @author chawlk
|
chrislovsund@357
|
50 |
* @author chrlse
|
jrechtacek@0
|
51 |
*/
|
jrechtacek@0
|
52 |
public class PlsqlFoldManagerFactory implements FoldManagerFactory {
|
chrislovsund@355
|
53 |
|
chrislovsund@355
|
54 |
@Override
|
chrislovsund@355
|
55 |
public FoldManager createFoldManager() {
|
subslk@464
|
56 |
final String property = System.getProperty("plsql.fold.manager", "new");
|
chrislovsund@357
|
57 |
if ("custom".equals(property)) {
|
chrislovsund@355
|
58 |
return new CustomFoldManager();
|
chrislovsund@355
|
59 |
}
|
chrislovsund@357
|
60 |
if ("old".equals(property)) {
|
chrislovsund@356
|
61 |
return new PlsqlFoldManager();
|
chrislovsund@356
|
62 |
}
|
chrislovsund@360
|
63 |
if ("simple".equals(property)) {
|
chrislovsund@360
|
64 |
return new SimplePlsqlFoldManager();
|
chrislovsund@360
|
65 |
}
|
chrislovsund@356
|
66 |
return new NewPlsqlFoldManager();
|
chrislovsund@355
|
67 |
}
|
jrechtacek@0
|
68 |
}
|