Source Code Cross Referenced for RemountCollaborationAction.java in  » IDE-Netbeans » etl.project » org » netbeans » modules » etl » ui » view » graph » actions » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » etl.project » org.netbeans.modules.etl.ui.view.graph.actions 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *
003:         *          Copyright (c) 2003-2005, SeeBeyond Technology Corporation,
004:         *          All Rights Reserved
005:         *
006:         *          This program, and all the routines referenced herein,
007:         *          are the proprietary properties and trade secrets of
008:         *          SEEBEYOND TECHNOLOGY CORPORATION.
009:         *
010:         *          Except as provided for by license agreement, this
011:         *          program shall not be duplicated, used, or disclosed
012:         *          without  written consent signed by an officer of
013:         *          SEEBEYOND TECHNOLOGY CORPORATION.
014:         *
015:         */
016:        package org.netbeans.modules.etl.ui.view.graph.actions;
017:
018:        import org.netbeans.modules.sql.framework.model.SQLDBTable;
019:        import java.awt.event.ActionEvent;
020:        import java.awt.event.InputEvent;
021:        import java.net.URL;
022:        import javax.swing.Action;
023:        import java.util.Iterator;
024:        import javax.swing.ImageIcon;
025:        import javax.swing.KeyStroke;
026:        import net.java.hulp.i18n.Logger;
027:        import org.netbeans.modules.etl.logger.Localizer;
028:        import org.netbeans.modules.etl.logger.LogUtil;
029:        import org.netbeans.modules.sql.framework.model.DBMetaDataFactory;
030:        import org.netbeans.modules.sql.framework.model.SQLDBModel;
031:        import org.netbeans.modules.sql.framework.model.utils.SQLObjectUtil;
032:        import org.openide.util.Exceptions;
033:        import org.netbeans.modules.sql.framework.ui.graph.IGraphView;
034:        import org.netbeans.modules.sql.framework.ui.model.CollabSQLUIModel;
035:        import org.netbeans.modules.sql.framework.ui.graph.actions.GraphAction;
036:        import org.openide.awt.StatusDisplayer;
037:
038:        /**
039:         * @author Nithya Radhakrishnan
040:         * @version $Revision$
041:         */
042:        public class RemountCollaborationAction extends GraphAction {
043:
044:            private static final URL remountImgUrl = RemountCollaborationAction.class
045:                    .getResource("/org/netbeans/modules/sql/framework/ui/resources/images/redo.png");
046:            private static transient final Logger mLogger = LogUtil
047:                    .getLogger(RemountCollaborationAction.class.getName());
048:            private static transient final Localizer mLoc = Localizer.get();
049:
050:            public RemountCollaborationAction() {
051:                //action name
052:                String nbBundle1 = mLoc.t("PRSR001: Remount");
053:                this .putValue(Action.NAME, Localizer.parse(nbBundle1));
054:
055:                //action icon
056:                this .putValue(Action.SMALL_ICON, new ImageIcon(remountImgUrl));
057:
058:                //action tooltip
059:                String nbBundle2 = mLoc
060:                        .t("PRSR001: Drops and re-creates all the tables. (Cntl-M)");
061:                this .putValue(Action.SHORT_DESCRIPTION, Localizer
062:                        .parse(nbBundle2));
063:                // Acceleratot Cntl-M
064:                this .putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(
065:                        'M', InputEvent.CTRL_MASK));
066:            }
067:
068:            /**
069:             * called when this action is performed in the ui
070:             *
071:             * @param ev event
072:             */
073:            public void actionPerformed(ActionEvent ev) {
074:                IGraphView graphView = (IGraphView) ev.getSource();
075:                CollabSQLUIModel model = (CollabSQLUIModel) graphView
076:                        .getGraphModel();
077:                Iterator targetTables = model.getSQLDefinition()
078:                        .getTargetTables().iterator();
079:                while (targetTables.hasNext()) {
080:                    try {
081:                        SQLDBTable table = (SQLDBTable) targetTables.next();
082:                        SQLDBModel dbmodel = (SQLDBModel) table.getParent();
083:                        if (dbmodel.getETLDBConnectionDefinition().getDBType()
084:                                .equals(DBMetaDataFactory.AXION)
085:                                || dbmodel.getETLDBConnectionDefinition()
086:                                        .getDBType().equalsIgnoreCase(
087:                                                "Internal")) {
088:                            SQLObjectUtil.dropTable(table, (SQLDBModel) table
089:                                    .getParent());
090:                            SQLObjectUtil.createTable(table, (SQLDBModel) table
091:                                    .getParent());
092:                            SQLObjectUtil.setOrgProperties(table);
093:                        }
094:                    } catch (Exception ex) {
095:                        Exceptions.printStackTrace(ex);
096:                        StatusDisplayer.getDefault().setStatusText(
097:                                "Unable to remount :" + ex.getMessage());
098:                    }
099:                }
100:
101:                Iterator sourceTables = model.getSQLDefinition()
102:                        .getSourceTables().iterator();
103:                while (sourceTables.hasNext()) {
104:                    try {
105:                        SQLDBTable table = (SQLDBTable) sourceTables.next();
106:                        SQLDBModel dbmodel = (SQLDBModel) table.getParent();
107:                        if (dbmodel.getETLDBConnectionDefinition().getDBType()
108:                                .equals(DBMetaDataFactory.AXION)
109:                                || dbmodel.getETLDBConnectionDefinition()
110:                                        .getDBType().equalsIgnoreCase(
111:                                                "Internal")) {
112:                            SQLObjectUtil.dropTable(table, (SQLDBModel) table
113:                                    .getParent());
114:                            SQLObjectUtil.createTable(table, (SQLDBModel) table
115:                                    .getParent());
116:                            SQLObjectUtil.setOrgProperties(table);
117:                        }
118:                    } catch (Exception ex) {
119:                        Exceptions.printStackTrace(ex);
120:                        StatusDisplayer.getDefault().setStatusText(
121:                                "Unable to remount :" + ex.getMessage());
122:                    }
123:                }
124:            } // end of jOptionPane
125:        }
ww___w.ja___va2s___.c_o_m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.