------------------------------------------------------------------------------- >Log Session: Monday, November 12, 2007 8:31:49 AM CET >System Info: Product Version = NetBeans IDE 6.0 RC1 (Build 200711081200) Operating System = Linux version 2.6.11.4-21.17-default running on i386 Java; VM; Vendor = 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06; Sun Microsystems Inc. Java Home = /opt/jdk1.6.0_01/jre System Locale; Encoding = en_US (nb); ISO-8859-1 Home Directory = /home/gugrim Current Directory = /home/gugrim User Directory = /home/gugrim/.netbeans/6.0rc1 Installation = /home/gugrim/netbeans-6.0-200711081200/nb6.0 /home/gugrim/netbeans-6.0-200711081200/ide8 /home/gugrim/netbeans-6.0-200711081200/java1 /home/gugrim/netbeans-6.0-200711081200/xml1 /home/gugrim/netbeans-6.0-200711081200/apisupport1 /home/gugrim/netbeans-6.0-200711081200/enterprise4 /home/gugrim/netbeans-6.0-200711081200/profiler2 /home/gugrim/netbeans-6.0-200711081200/visualweb1 /home/gugrim/netbeans-6.0-200711081200/identity1 /home/gugrim/netbeans-6.0-200711081200/harness /home/gugrim/netbeans-6.0-200711081200/platform7 Boot & Ext. Classpath = /opt/jdk1.6.0_01/jre/lib/resources.jar:/opt/jdk1.6.0_01/jre/lib/rt.jar:/opt/jdk1.6.0_01/jre/lib/sunrsasign.jar:/opt/jdk1.6.0_01/jre/lib/jsse.jar:/opt/jdk1.6.0_01/jre/lib/jce.jar:/opt/jdk1.6.0_01/jre/lib/charsets.jar:/opt/jdk1.6.0_01/jre/classes:/opt/jdk1.6.0_01/jre/lib/ext/dnsns.jar:/opt/jdk1.6.0_01/jre/lib/ext/sunpkcs11.jar:/opt/jdk1.6.0_01/jre/lib/ext/sunjce_provider.jar:/opt/jdk1.6.0_01/jre/lib/ext/localedata.jar Application Classpath = /home/gugrim/netbeans-6.0-200711081200/platform7/lib/boot.jar:/home/gugrim/netbeans-6.0-200711081200/platform7/lib/org-openide-modules.jar:/home/gugrim/netbeans-6.0-200711081200/platform7/lib/org-openide-util.jar:/opt/jdk1.6/lib/dt.jar:/opt/jdk1.6/lib/tools.jar Startup Classpath = /home/gugrim/netbeans-6.0-200711081200/platform7/core/core.jar:/home/gugrim/netbeans-6.0-200711081200/platform7/core/org-openide-filesystems.jar:/home/gugrim/netbeans-6.0-200711081200/nb6.0/core/org-netbeans-upgrader.jar:/home/gugrim/netbeans-6.0-200711081200/nb6.0/core/locale/core_nb.jar ------------------------------------------------------------------------------- WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.editor uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.options.editor uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.editor.codetemplates uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.db uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.xml.text uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.languages uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.html.editor uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.java.editor uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.web.core.syntax uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.visualweb.dataconnectivity uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.debugger.jpda.projects uses org.netbeans.modules.editor.highlights which is deprecated: Use org.netbeans.spi.highlighting (Editor Library 2) instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.debugger.jpda.ant uses org.netbeans.modules.editor.highlights which is deprecated: Use org.netbeans.spi.highlighting (Editor Library 2) instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.editor.plain uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.ide.kit uses org.netbeans.modules.editor.highlights which is deprecated: Use org.netbeans.spi.highlighting (Editor Library 2) instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.db.sql.editor uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.visualweb.designer.jsf uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.css.visual uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.properties.syntax uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.web.jsf.navigation uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead. WARNING [org.netbeans.modules.settings.convertors.XMLSettingsSupport]: Warning: unknown module code base: org.netbeans.modules.java in MultiFileObject@1324b17[Services/org-netbeans-modules-java-settings-JavaSettings.settings] WARNING: LibrariesStorage: Library "junit" is already defined, skeeping the definition from: org-netbeans-api-project-libraries/Libraries/junit-3.8.2.xml in Default System INFO [org.netbeans.core.startup.NbEvents]: Turning on modules: org.openide.util [7.10.0.1 1 200711081200] org.openide.modules [7.3 200711081200] org.netbeans.modules.servletjspapi/1 [1.1 1 200711081200] org.netbeans.modules.web.jsf12/1 [1.0 1 200711081200] org.netbeans.modules.visualweb.designtime/1 [1.0 200711081200] org.openide.awt [6.11.0.1 200711081200] org.openide.filesystems [7.3 200711081200] org.netbeans.modules.queries/1 [1.10 200711081200] org.netbeans.api.progress/1 [1.10.0.1 1 200711081200] org.openide.dialogs [7.5 200711081200] org.openide.nodes [7.2.0.1 200711081200] org.openide.explorer [6.12 1 200711081200] org.openide.windows [6.18 200711081200] org.netbeans.modules.editor.mimelookup/1 [1.8 200711081200] org.openide.text [6.16 200711081200] org.openide.actions [6.6.0.1 200711081200] org.openide.loaders [6.7 200711081200] org.netbeans.modules.projectapi/1 [1.13 200711081200] org.netbeans.modules.projectuiapi/1 [1.24.0.6 6 200711081200] org.jdesktop.layout/1 [1.4 1.0.3 200711081200] org.netbeans.modules.apisupport.paintapp [1.1 200711081200] org.netbeans.lib.profiler/1 [1.1 200711081200] org.netbeans.lib.profiler.common/1 [1.1 200711081200] org.netbeans.libs.javacapi [0.5.1 1 200711081200] org.netbeans.libs.javacimpl/1 [0.6.0.5 5 200711081200] org.netbeans.lib.uihandler [1.13 200711081200] org.netbeans.modules.editor.util/1 [1.21 200711081200] org.netbeans.modules.lexer/2 [1.25.0.1 1 200711081200] org.netbeans.modules.editor.settings/1 [1.12 200711081200] org.netbeans.modules.editor.lib2/1 [1.5.2 2 200711081200] org.netbeans.modules.editor.fold/1 [1.6 200711081200] org.netbeans.modules.editor.lib/1 [1.20.0.4.2 4 200711081200] org.netbeans.modules.editor.errorstripe.api/1 [2.3.0.1 1 200711081200] org.netbeans.modules.editor.errorstripe/2 [2.3.0.1.1 1 200711081200] org.netbeans.modules.options.api/1 [1.5 200711081200] org.openide.io [1.11 200711081200] org.netbeans.bootstrap/1 [2.7 200711081200] org.netbeans.core.startup/1 [1.10.0.1 200711081200] org.netbeans.modules.javahelp/1 [2.9 200711081200] org.netbeans.modules.editor.settings.storage/1 [1.10 200711081200] org.openide.options [6.7 200711081200] org.openidex.util/3 [3.13 200711081200] org.netbeans.modules.editor/3 [1.35.0.4.2 200711081200] org.netbeans.modules.options.keymap [1.1 200711081200] org.netbeans.modules.options.editor/1 [1.4 200711081200] org.netbeans.modules.diff/1 [1.18.0.42.1 42 200711081200] org.netbeans.modules.masterfs/1 [1.11 200711081200] org.netbeans.modules.versioning/1 [1.5.0.1.42.1 1 200711081200] org.netbeans.modules.versioning.util [1.0.0 200711081200] org.netbeans.modules.editor.completion/1 [1.9 200711081200] org.netbeans.spi.editor.hints/0 [1.2.0.5 5 200711081200] org.netbeans.modules.editor.codetemplates/1 [1.5.0.1.5 1 200711081200] org.netbeans.libs.svnClientAdapter/1 [1.2 0.9 200711081200] org.netbeans.libs.jsr223/1 [1.6 6 200711081200] org.netbeans.modules.templates [1.1 200711081200] org.netbeans.api.xml/1 [1.14 200711081200] org.netbeans.spi.navigator/1 [1.5 200711081200] org.openide.execution [1.10 200711081200] org.apache.tools.ant.module/3 [3.27.0.2 2 200711081200] org.netbeans.modules.project.libraries/1 [1.15 200711081200] org.netbeans.api.java/1 [1.13 200711081200] org.netbeans.modules.java.platform/1 [1.9 200711081200] org.netbeans.modules.project.ant/1 [1.17 200711081200] org.netbeans.modules.java.project/1 [1.12 200711081200] org.netbeans.modules.editor.guards/1 [1.0 200711081200] org.netbeans.modules.refactoring.api [1.2 200711081200] org.netbeans.modules.java.lexer/1 [1.2 200711081200] org.netbeans.modules.classfile/1 [1.19 200711081200] org.netbeans.libs.lucene/1 [2.1.0 2.1.0 200711081200] org.netbeans.spi.tasklist/1 [1.0 1 200711081200] org.netbeans.modules.java.preprocessorbridge [1.1 200711081200] org.netbeans.modules.editor.indent/2 [1.6.4 200711081200] org.netbeans.modules.java.source [0.26.0.1.5 1 200711081200] org.netbeans.modules.refactoring.java/1 [1.2 200711081200] org.netbeans.swing.plaf [1.6 200711081200] org.netbeans.core/2 [3.6.0.1 200711081200] org.netbeans.core.ui/1 [1.10 200711081200] org.netbeans.modules.db/1 [1.24.0.5 5 200711081200] org.netbeans.modules.derby [1.9 200711081200] org.netbeans.modules.schema2beans/1 [1.16 200711081200] org.netbeans.api.debugger/1 [1.11 200711081200] org.netbeans.spi.viewmodel/2 [1.12 200711081200] org.netbeans.api.debugger.jpda/2 [2.13 200711081200] org.netbeans.modules.settings/1 [1.13 200711081200] org.netbeans.modules.j2ee.metadata/0 [1.3 200711081200] org.netbeans.modules.j2eeapis/1 [1.8 200711081200] org.netbeans.modules.j2ee.metadata.model.support/1 [1.0 200711081200] org.netbeans.modules.xml.core/2 [1.13.0.4 4 200711081200] org.netbeans.libs.xerces/1 [1.10 2.8.0 200711081200] org.netbeans.modules.j2ee.dd/1 [1.10.0.2 2 200711081200] org.netbeans.modules.j2eeserver/4 [1.33.0.1 1 200711081200] org.netbeans.modules.j2ee.samples [1.2 200711081200] org.netbeans.api.web.webmodule [1.10 200711081200] org.netbeans.modules.visualweb.extension.openide/1 [2.0 200711081200] org.netbeans.modules.xml.xam/1 [1.2 1 200711081200] org.netbeans.modules.xml.schema.model/1 [1.2 1 200711081200] org.netbeans.modules.xml.wsdl.model/1 [1.2 1 200711081200] org.netbeans.modules.websvc.serviceapi [1.0 200711081200] org.netbeans.modules.j2ee.api.ejbmodule [1.7 200711081200] org.netbeans.modules.j2ee.dd.webservice [1.6 200711081200] org.netbeans.modules.websvc.websvcapi [1.6 200711081200] org.netbeans.modules.j2ee.persistenceapi/1 [1.3 200711081200] org.netbeans.modules.jumpto/1 [1.3 200711081200] org.netbeans.modules.java.sourceui/1 [1.3.0.1.1 1 200711081200] org.netbeans.modules.dbschema/1 [1.10.0.3.5 3 200711081200] org.netbeans.core.multiview/1 [1.10 200711081200] org.netbeans.modules.xml.multiview/1 [1.6.0.2 2 200711081200] org.apache.xml.resolver [1.2 1.2 200711081200] org.netbeans.modules.xml.catalog/2 [1.12.0.4.4 4 200711081200] org.netbeans.modules.dbapi [1.5.0.5 200711081200] org.netbeans.modules.j2ee.persistence [1.4.0.1 1 200711081200] org.netbeans.modules.editor.structure/1 [1.15.0.1 1 200711081200] org.netbeans.modules.xml.lexer [1.1 200711081200] org.netbeans.modules.xml.text/2 [1.13.0.4.4 4 200711081200] org.netbeans.modules.xml.retriever/1 [1.1 200711081200] org.netbeans.modules.websvc.jaxws21api/1 [1.1 200711081200] org.netbeans.modules.websvc.jaxws21/1 [1.1 200711081200] org.netbeans.modules.websvc.jaxwsmodel/1 [1.2 200711081200] org.netbeans.modules.websvc.jaxwsapi [1.1 200711081200] org.netbeans.libs.glassfish_logging/1 [1.1 1 200711081200] org.netbeans.core.output2/1 [1.8.1.1 1 200711081200] org.netbeans.modules.web.jspparser/2 [2.7 200711081200] org.netbeans.modules.gototest/1 [1.0 200711081200] org.netbeans.modules.junit/2 [2.25 200711081200] org.netbeans.modules.websvc.clientapi [1.6 200711081200] org.netbeans.modules.ant.browsetask [1.12 200711081200] org.netbeans.modules.java.editor.lib/1 [1.6 200711081200] org.netbeans.modules.j2ee.common/1 [1.19 200711081200] org.netbeans.modules.web.project [1.7 200711081200] org.netbeans.modules.visualweb.api.portlet.dd/1 [2.0 1 200711081200] org.netbeans.modules.visualweb.api.j2ee/1 [2.0 200711081200] org.netbeans.spi.palette/1 [1.11 200711081200] org.netbeans.modules.visualweb.complib.api [1.0 200711081200] org.netbeans.modules.el.lexer/1 [1.1 200711081200] org.netbeans.modules.xml.xdm/1 [1.2 1 200711081200] org.netbeans.modules.html.lexer/1 [1.1 200711081200] org.netbeans.modules.jsp.lexer/1 [1.1 200711081200] org.netbeans.modules.editor.bracesmatching/0 [1.3 200711081200] org.netbeans.modules.html.editor.lib/1 [1.6 200711081200] org.netbeans.modules.languages/0 [1.86.0.1 1 200711081200] org.netbeans.modules.html.editor/1 [1.8.0.1 200711081200] org.netbeans.modules.editor.plain.lib/1 [1.4 200711081200] org.netbeans.modules.java.editor/1 [2.10.0.3.1.1.5 3 200711081200] org.netbeans.modules.web.core.syntax/1 [1.31.0.1.3.1 1 200711081200] org.netbeans.modules.web.jsf/1 [1.7.0.1.1 1 200711081200] org.netbeans.modules.visualweb.project.jsf/1 [2.1.0.1 1 200711081200] org.netbeans.api.visual [2.9 200711081200] org.netbeans.modules.db.sql.visualeditor/1 [2.1.0.5 200711081200] org.netbeans.upgrader [4.6 200711081200] org.netbeans.modules.visualweb.rowset/1 [1.0 200711081200] org.netbeans.modules.visualweb.dataprovider/1 [2.0 200711081200] org.netbeans.modules.visualweb.propertyeditors.resolver [1.0 200711081200] org.netbeans.modules.web.jsf12ri/1 [1.0 1 200711081200] org.netbeans.modules.visualweb.propertyeditors.api [1.0 200711081200] org.netbeans.modules.visualweb.propertyeditors/1 [2.0 200711081200] org.netbeans.modules.visualweb.designtime.base [1.0 200711081200] org.netbeans.modules.visualweb.jsfsupport.components [2.0 200711081200] org.netbeans.libs.commons_fileupload/1 [1.0 200711081200] org.netbeans.libs.commons_logging/1 [1.4 1.0.4 200711081200] org.netbeans.modules.visualweb.designtimeext/1 [1.0 200711081200] org.netbeans.modules.visualweb.woodstock.webui.jsf [2.0 200711081200] org.netbeans.modules.visualweb.designtime.idebridge [1.0 200711081200] org.netbeans.modules.visualweb.libs.batik/1 [2.0 200711081200] org.netbeans.modules.visualweb.designer.html [2.0 200711081200] org.netbeans.modules.visualweb.designer.cssengine [2.0 200711081200] org.netbeans.modules.visualweb.api.designer/1 [2.0 200711081200] org.netbeans.modules.visualweb.api.insync/1 [2.0 200711081200] org.netbeans.modules.visualweb.designer.markup/1 [2.0 200711081200] org.netbeans.modules.visualweb.jsfsupport/1 [2.0 200711081200] org.netbeans.modules.visualweb.xhtml [2.0 200711081200] org.netbeans.modules.visualweb.extension.openide.loaders [2.0 200711081200] org.netbeans.modules.visualweb.webui/1 [2.0 200711081200] org.netbeans.modules.visualweb.webui.designtime/1 [2.0 200711081200] org.netbeans.modules.visualweb.classloaderprovider [2.0 200711081200] org.netbeans.modules.visualweb.insync/1 [2.1 200711081200] org.netbeans.modules.visualweb.dataconnectivity/1 [2.1 200711081200] org.netbeans.spi.debugger.ui/1 [2.9 200711081200] org.netbeans.modules.editor.highlights/0 [1.2.0.1 1 200711081200] org.netbeans.modules.debugger.jpda.projects [1.2.0.1 200711081200] org.netbeans.modules.debugger.jpda/2 [1.17 200711081200] org.netbeans.modules.ant.freeform/1 [1.15 200711081200] org.netbeans.modules.java.freeform/1 [1.7 200711081200] org.netbeans.modules.java.hints/1 [1.20.0.3.3.5 3 200711081200] org.netbeans.modules.debugger.jpda.ant [1.8 200711081200] org.netbeans.modules.java.j2seproject/1 [1.12.0.43 43 200711081200] org.netbeans.modules.java.navigation/1 [1.7 200711081200] org.netbeans.modules.java.j2seplatform/1 [1.8.0.2 2 200711081200] org.netbeans.modules.javadoc/1 [1.22.0.5 200711081200] org.netbeans.modules.java.guards/0 [0.2 200711081200] org.netbeans.modules.form/2 [1.22 2 200711081200] org.netbeans.modules.java.examples/1 [1.7 200711081200] org.netbeans.modules.properties/1 [1.21 200711081200] org.netbeans.modules.i18n/1 [1.22 200711081200] org.netbeans.modules.java.debug [1.1.0.5 200711081200] org.netbeans.modules.javawebstart [1.0 200711081200] org.netbeans.modules.ant.debugger/1 [1.8.0.2 200711081200] org.netbeans.swing.dirchooser [1.0 200711081200] org.netbeans.modules.editor.bookmarks/1 [1.4 200711081200] org.netbeans.modules.sendopts/2 [2.1 200711081200] org.netbeans.modules.utilities/1 [1.25 200711081200] org.netbeans.modules.servletapi/1 [1.11 200711081200] org.netbeans.modules.httpserver/2 [2.7.0.42 42 200711081200] org.netbeans.modules.usersguide/1 [1.20 200711081200] org.netbeans.core.execution/1 [1.10.0.1 200711081200] org.netbeans.modules.favorites/1 [1.12 200711081200] org.netbeans.modules.projectui [1.12.0.1.6 1 200711081200] org.netbeans.modules.editor.plain/1 [1.4 200711081200] org.netbeans.modules.autoupdate.services [1.3 200711081200] org.netbeans.modules.autoupdate.ui [1.2 200711081200] org.netbeans.swing.tabcontrol [1.9 200711081200] org.netbeans.core.windows/2 [2.8.0.1 200711081200] org.netbeans.modules.core.kit [1.0 200711081200] org.netbeans.core.ide/1 [1.10 200711081200] org.netbeans.modules.ide.branding/1 [1.4] org.netbeans.modules.extbrowser/1 [1.11 200711081200] org.netbeans.insane/1 [1.0 1 200711081200] org.netbeans.modules.timers/1 [1.1 200711081200] org.netbeans.modules.defaults/1 [1.3 200711081200] org.netbeans.modules.ide.kit [1.2 200711081200] org.netbeans.modules.ant.kit [1.0 200711081200] org.netbeans.modules.java.helpset/1 [1.0 200711081200] org.netbeans.modules.java.kit [1.0 200711081200] org.netbeans.modules.debugger.jpda.ui/1 [1.6 200711081200] org.netbeans.modules.web.debug/1 [2.10 200711081200] org.netbeans.modules.web.core/1 [1.28.0.42.2 42 200711081200] org.netbeans.modules.web.freeform [1.6 200711081200] org.netbeans.modules.web.monitor/1 [1.17 200711081200] org.netbeans.modules.web.examples/1 [1.7 200711081200] org.netbeans.modules.j2ee.debug/1 [1.5 200711081200] org.netbeans.modules.j2ee.ant [1.9.0.1 200711081200] org.netbeans.modules.web.jstl11/1 [2.8 1.1.2 200711081200] org.netbeans.modules.j2ee.genericserver [1.6 200711081200] org.netbeans.modules.j2ee.ejbcore [1.7 200711081200] org.netbeans.modules.j2ee.ddloaders/1 [1.8.0.2 200711081200] org.netbeans.modules.web.refactoring [1.0.0.42 200711081200] org.netbeans.modules.db.core [1.5 200711081200] org.netbeans.modules.db.sql.editor [1.5.0.5 200711081200] org.netbeans.modules.db.drivers [1.0 200711081200] org.netbeans.modules.db.kit [1.1 200711081200] org.netbeans.modules.j2ee.toplinklib/1 [2.8 200711081200] org.netbeans.modules.j2ee.jpa.verification [1.1.0.5 200711081200] org.netbeans.modules.j2ee.jpa.refactoring [1.0 200711081200] org.netbeans.modules.j2ee.persistence.kit [1.0 200711081200] org.netbeans.modules.web.kit [1.0 200711081200] org.netbeans.modules.j2ee.weblogic9/1 [1.6 200711081200] org.netbeans.modules.visualweb.libs.jtidy/1 [1.5 200711081200] org.netbeans.modules.visualweb.project.importpage [2.0 200711081200] org.netbeans.modules.j2ee.ejbrefactoring [1.0 200711081200] org.netbeans.modules.visualweb.ravehelp.rave_nbpack [2.0 200711081200] org.netbeans.modules.j2ee.sun.dd/1 [1.7.1.1 1 200711081200] org.netbeans.modules.identity.profile.api [1.2 200711081200] org.netbeans.modules.j2ee.sun.appsrv/1 [1.6 1 200711081200] org.netbeans.modules.identity.server.manager/1 [1.2 200711081200] org.netbeans.modules.languages.diff [1.4 200711081200] org.netbeans.modules.languages.manifest [1.3 200711081200] org.netbeans.modules.websvc.core [1.7.0.1.4.5 1 200711081200] org.netbeans.modules.websvc.manager [1.0 200711081200] org.netbeans.modules.websvc.editor.hints [1.0.5 200711081200] org.netbeans.modules.websvc.components.strikeiron/0 [0.4 200711081200] org.netbeans.modules.websvc.wsitmodelext [3.0 200711081200] org.netbeans.modules.websvc.design [1.0 200711081200] org.netbeans.modules.websvc.wsitconf [3.0 200711081200] org.netbeans.modules.websvc.metro.samples/1 [1.0 200711081200] org.netbeans.modules.websvc.customization [1.1 200711081200] org.netbeans.modules.websvc.kit [1.0 200711081200] org.netbeans.modules.xml.catalogsupport [1.0 200711081200] org.netbeans.modules.xml.xam.ui/1 [1.0 200711081200] org.netbeans.modules.xml.axi [1.2 200711081200] org.netbeans.modules.visdev.prefuse/1 [1.2 1 200711081200] org.netbeans.modules.xml.nbprefuse [1.0 200711081200] org.netbeans.modules.xml.refactoring/1 [1.0 200711081200] org.netbeans.modules.xml.schema.ui.basic/1 [1.2 200711081200] org.netbeans.modules.visualweb.designer/1 [2.0 200711081200] org.netbeans.modules.visualweb.designer.jsf [2.0 200711081200] org.netbeans.lib.profiler.ui/1 [1.1 200711081200] org.netbeans.modules.profiler/1 [1.6 200711081200] org.netbeans.modules.profiler.j2ee.sunas/1 [1.3 200711081200] org.netbeans.modules.xml.search/1 [1.1 200711081200] org.netbeans.modules.identity.samples/1 [1.2 200711081200] org.netbeans.modules.identity.ant/1 [1.0 200711081200] org.netbeans.modules.identity.profile.ui [1.1 200711081200] org.netbeans.modules.j2ee.sun.ddui/1 [1.8.0.1.1 1 200711081200] org.netbeans.modules.j2ee.sun.appsrv81/1 [1.4.0.1.1 1 200711081200] org.netbeans.modules.identity.kit [1.0 200711081200] org.netbeans.modules.uihandler [2.4 200711081200] org.netbeans.modules.web.flyingsaucer/1 [1 1 200711081200] org.netbeans.modules.xml.schema.refactoring/1 [1.0 200711081200] org.netbeans.modules.languages.css [1.12 200711081200] org.netbeans.modules.css.visual/1 [2.0.0.1 200711081200] org.netbeans.modules.properties.syntax/1 [1.18 200711081200] org.netbeans.modules.xml.validation [1.0 200711081200] org.netbeans.modules.xml.schema.completion [1.0 200711081200] org.netbeans.modules.xml.wsdl.bindingsupport.api [1.0 200711081200] org.netbeans.libs.jxpath [1.1 200711081200] org.netbeans.modules.xml.xpath [1.1 200711081200] org.netbeans.modules.xml.wsdl.extensions [1.1 200711081200] org.netbeans.modules.xml.wsdl.bindingsupport [1.0 200711081200] org.netbeans.modules.xml.wsdlui [1.1 200711081200] org.netbeans.modules.apisupport.ant [2.31 200711081200] org.netbeans.modules.xml.tax/2 [1.13.0.4.4 4 200711081200] org.netbeans.libs.freemarker/1 [2.3.8.1 238 200711081200] org.netbeans.modules.apisupport.project [1.18.0.6.4 6 200711081200] org.netbeans.modules.apisupport.refactoring [1.4.0.6 200711081200] org.netbeans.modules.profiler.j2se/1 [1.3 200711081200] org.netbeans.modules.xml.wsdlextui [1.1 200711081200] org.netbeans.modules.swingapp [1.1 200711081200] org.netbeans.lib.cvsclient/1 [1.15 200711081200] org.netbeans.modules.visualweb.errorhandler/1 [2.0 200711081200] org.netbeans.modules.visualweb.palette [2.0 200711081200] org.netbeans.modules.visualweb.project.jsfloader/1 [2.0 200711081200] org.netbeans.modules.visualweb.dataprovider.designtime/1 [2.0 200711081200] org.netbeans.modules.visualweb.jsfsupport.designtime [2.0 200711081200] org.netbeans.modules.visualweb.dataconnectivity.designtime [1.0 200711081200] org.netbeans.modules.visualweb.webui.themes [2.0 200711081200] org.netbeans.modules.visualweb.ejb/1 [2.0 200711081200] org.netbeans.modules.visualweb.samples.bundled [1.0 200711081200] org.netbeans.modules.visualweb.web.ui.appbase/1 [2.0 200711081200] org.netbeans.modules.visualweb.complib [2.0 200711081200] org.netbeans.modules.visualweb.jsfsupport.designtime_1_2 [2.0 200711081200] org.netbeans.modules.visualweb.jsfsupport.designtime_1_1 [2.0 200711081200] org.netbeans.modules.visualweb.errorhandler.client/1 [2.0 200711081200] org.netbeans.modules.web.jsf.navigation/1 [2.0 200711081200] org.netbeans.modules.web.jsf.kit [1.0 200711081200] org.netbeans.modules.visualweb.outline [2.0 200711081200] org.netbeans.modules.visualweb.webui.jsf.defaulttheme [2.0 200711081200] org.netbeans.modules.visualweb.j2ee14classloaderprovider [2.0 200711081200] org.netbeans.modules.visualweb.navigation [1.0 200711081200] org.netbeans.modules.visualweb.j2ee15classloaderprovider [2.0 200711081200] org.netbeans.modules.visualweb.websvcmgr/1 [1.0.5 200711081200] org.netbeans.modules.visualweb.kit [1.0 200711081200] org.netbeans.modules.editor.mimelookup.impl/1 [1.1 200711081200] org.netbeans.modules.xml.tools/2 [1.13.0.4.4.4 4 200711081200] org.netbeans.modules.xsl/1 [1.13.0.4 200711081200] org.netbeans.modules.languages.javascript [1.30 200711081200] org.netbeans.modules.image/1 [1.19 200711081200] org.netbeans.modules.html/1 [1.22 200711081200] org.netbeans.modules.languages.bat [1.3 200711081200] org.netbeans.modules.languages.sh [1.4 200711081200] org.netbeans.modules.editor.kit [1.0 200711081200] org.netbeans.modules.progress.ui [1.0 200711081200] org.netbeans.libs.ini4j/1 [1.0 0.9 200711081200] org.netbeans.modules.i18n.form/2 [1.21 200711081200] org.netbeans.modules.j2ee.clientproject [1.1.0.1 1 200711081200] org.netbeans.modules.j2ee.ejbjarproject [1.6 200711081200] org.netbeans.modules.j2ee.earproject [1.7 200711081200] org.netbeans.libs.jsch/1 [1.5 0.1.24 200711081200] org.netbeans.modules.versioning.system.cvss/1 [1.9.1.1.42.1 1 200711081200] org.netbeans.modules.javawebstart.signtask [1.0 200711081200] org.netbeans.modules.j2ee.platform/1 [1.5 200711081200] org.netbeans.modules.j2ee.ejbverification [1.0.0.5 200711081200] org.netbeans.modules.j2ee.archive [1.1 200711081200] org.netbeans.modules.j2ee.kit [1.0 200711081200] org.netbeans.modules.tasklist.ui/1 [1.0.1 200711081200] org.netbeans.modules.xml.schema.abe [1.1 200711081200] org.netbeans.modules.xml.schema/1 [1.13.0.4 200711081200] org.netbeans.modules.tasklist.projectint/1 [1.0 200711081200] org.netbeans.modules.form.j2ee/0 [0.2 1 200711081200] org.netbeans.modules.form.kit [1.0 200711081200] org.netbeans.modules.ant.grammar/1 [1.15 200711081200] org.netbeans.modules.updatecenters/1 [1.11 200711081200] org.netbeans.modules.profiler.nbmodule/1 [1.3 200711081200] org.netbeans.modules.localhistory [1.1.1 200711081200] org.netbeans.modules.utilities.project/1 [1.7 200711081200] org.netbeans.modules.subversion [1.2 200711081200] org.netbeans.modules.profiler.j2ee.jboss/1 [1.3 200711081200] org.netbeans.modules.tomcat5/1 [1.10 200711081200] org.netbeans.modules.welcome/1 [1.12 200711081200] org.netbeans.modules.lexer.nbbridge/1 [1.2.0.1 200711081200] org.netbeans.modules.apisupport.feedreader/1 [1.4 200711081200] org.netbeans.modules.apisupport.kit [1.0 200711081200] org.netbeans.modules.j2ee.jboss4/1 [1.7.0.1 200711081200] org.netbeans.modules.uihandler.exceptionreporter [1.0 200711081200] org.netbeans.modules.ide.branding.kit [1.0 200711081200] org.netbeans.modules.profiler.j2ee.tomcat/1 [1.3 200711081200] org.netbeans.modules.debugger.jpda.heapwalk/1 [1.1 200711081200] org.netbeans.modules.web.struts/1 [1.5.0.1 1 200711081200] org.netbeans.modules.xml.wsdl.refactoring/1 [1.0 200711081200] org.netbeans.modules.xml.kit [1.0 200711081200] org.netbeans.modules.xml.wsdl.kit [1.0 200711081200] org.netbeans.modules.profiler.j2ee.weblogic/1 [1.3 200711081200] org.netbeans.modules.profiler.j2ee/1 [1.3 200711081200] org.netbeans.modules.tasklist.todo/1 [1.0 200711081200] org.netbeans.modules.tasklist.kit [1.0 200711081200] org.netbeans.modules.profiler.freeform/1 [1.3 200711081200] INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: FontsColors settings should reside in 'FontsColors' subfolder, see #90403 for details. Offending file 'Editors/NetBeans41/defaultColoring.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: FontsColors settings should reside in 'FontsColors' subfolder, see #90403 for details. Offending file 'Editors/text/css/NetBeans41/coloring.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: FontsColors settings should reside in 'FontsColors' subfolder, see #90403 for details. Offending file 'Editors/text/xml/NetBeans41/coloring.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: FontsColors settings should reside in 'FontsColors' subfolder, see #90403 for details. Offending file 'Editors/text/x-jsp/NetBeans41/coloring.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: FontsColors settings should reside in 'FontsColors' subfolder, see #90403 for details. Offending file 'Editors/text/html/NetBeans41/coloring.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: FontsColors settings should reside in 'FontsColors' subfolder, see #90403 for details. Offending file 'Editors/text/x-java/NetBeans41/coloring.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: FontsColors settings should reside in 'FontsColors' subfolder, see #90403 for details. Offending file 'Editors/text/x-properties/NetBeans41/coloring.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: FontsColors settings should reside in 'FontsColors' subfolder, see #90403 for details. Offending file 'Editors/text/plain/NetBeans41/coloring.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: FontsColors settings should reside in 'FontsColors' subfolder, see #90403 for details. Offending file 'Editors/application/xml-dtd/NetBeans41/coloring.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: Keybindings settings should reside in 'Keybindings' subfolder, see #90403 for details. Offending file 'Editors/text/base/keybindings.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: Keybindings settings should reside in 'Keybindings' subfolder, see #90403 for details. Offending file 'Editors/text/x-sql/keybindings.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: Keybindings settings should reside in 'Keybindings' subfolder, see #90403 for details. Offending file 'Editors/text/xml/keybindings.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: Keybindings settings should reside in 'Keybindings' subfolder, see #90403 for details. Offending file 'Editors/text/x-jsp/keybindings.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: Keybindings settings should reside in 'Keybindings' subfolder, see #90403 for details. Offending file 'Editors/text/html/keybindings.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: Keybindings settings should reside in 'Keybindings' subfolder, see #90403 for details. Offending file 'Editors/text/x-java/keybindings.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: Keybindings settings should reside in 'Keybindings' subfolder, see #90403 for details. Offending file 'Editors/text/x-properties/keybindings.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: Keybindings settings should reside in 'Keybindings' subfolder, see #90403 for details. Offending file 'Editors/text/plain/keybindings.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: Keybindings settings should reside in 'Keybindings' subfolder, see #90403 for details. Offending file 'Editors/application/xml-dtd/keybindings.xml' INFO [org.netbeans.modules.editor.settings.storage.SettingsProvider]: Won't provide any settings for text/base It's been deprecated, use MimePath.EMPTY instead. WARNING [org.netbeans.modules.editor.impl.KitsTracker]: Inconsistent mime type declaration for the kit: org.netbeans.modules.xml.text.syntax.XMLKit@1418687; mimeType from the kit is 'text/xml, but the kit is registered for 'text/xml-external-parsed-entity' WARNING [org.netbeans.modules.editor.impl.KitsTracker]: Inconsistent mime type declaration for the kit: org.netbeans.modules.web.core.syntax.JSPKit@e7ef68; mimeType from the kit is 'text/x-jsp, but the kit is registered for 'text/x-tag' INFO [org.netbeans.modules.editor.settings.storage.SettingsType]: CodeTemplates settings should reside in 'CodeTemplates' subfolder, see #90403 for details. Offending file 'Editors/text/x-java/abbreviations.xml' WARNING [org.netbeans.modules.editor.impl.KitsTracker]: No mime type uses editor kit implementation class: class org.netbeans.editor.BaseKit WARNING [org.netbeans.modules.editor.impl.KitsTracker]: No mime type uses editor kit implementation class: class org.netbeans.modules.editor.NbEditorKit WARNING [org.netbeans.modules.editor.impl.KitsTracker]: No mime type uses editor kit implementation class: class org.netbeans.editor.ext.ExtKit WARNING [org.netbeans.modules.editor.impl.KitsTracker]: No mime type uses editor kit implementation class: class javax.swing.text.DefaultEditorKit WARNING [org.netbeans.modules.editor.impl.KitsTracker]: No mime type uses editor kit implementation class: class javax.swing.text.EditorKit WARNING [org.netbeans.modules.editor.impl.KitsTracker]: No mime type uses editor kit implementation class: class java.lang.Object WARNING [org.openide.loaders]: Should override getLookup() in class org.netbeans.modules.form.FormDataObject, e.g.: [MultiDataObject.this.]getCookieSet().getLookup() WARNING [org.netbeans.editor.DrawLayerList]: Using deprecated DrawLayer: highlight-layer z-order: 3000 class: org.netbeans.modules.editor.highlights.HighlightLayer Layer class org.netbeans.modules.editor.highlights.HighlightLayer, name='highlight-layer WARNING [org.netbeans.editor.DrawLayerList]: Using deprecated DrawLayer: annotation-layer z-order: 2100 class: org.netbeans.editor.DrawLayerFactory$AnnotationLayer Layer class org.netbeans.editor.DrawLayerFactory$AnnotationLayer, name='annotation-layer WARNING [org.openide.loaders]: Should override getLookup() in class org.openide.loaders.InstanceDataObject, e.g.: [MultiDataObject.this.]getCookieSet().getLookup() WARNING [org.openide.filesystems.Ordering]: Encountered non-boolean relative ordering attribute org.openide.filesystems.MultiFileObject.VoidValue#3 from org-netbeans-modules-project-ui-BuildMainProject.shadow/org-netbeans-modules-project-ui-RebuildMainProject.shadow on Toolbars/Build WARNING [org.openide.filesystems.Ordering]: Encountered non-boolean relative ordering attribute org.openide.filesystems.MultiFileObject.VoidValue#3 from org-netbeans-modules-debugger-ui-actions-ConnectAction.shadow/javax-swing-JToolBar$Separator.instance on Toolbars/Build WARNING [org.openide.filesystems.Ordering]: Encountered non-boolean relative ordering attribute org.openide.filesystems.MultiFileObject.VoidValue#3 from org-netbeans-modules-project-ui-DebugMainProject.shadow/org-netbeans-modules-debugger-ui-actions-ConnectAction.shadow on Toolbars/Build WARNING [org.openide.filesystems.Ordering]: Encountered non-boolean relative ordering attribute org.openide.filesystems.MultiFileObject.VoidValue#3 from org-netbeans-modules-project-ui-RebuildMainProject.shadow/org-netbeans-modules-project-ui-RunMainProject.shadow on Toolbars/Build WARNING [org.openide.filesystems.Ordering]: Encountered non-boolean relative ordering attribute org.openide.filesystems.MultiFileObject.VoidValue#3 from org-netbeans-modules-project-ui-RunMainProject.shadow/org-netbeans-modules-project-ui-DebugMainProject.shadow on Toolbars/Build WARNING [org.openide.filesystems.Ordering]: Not all children in Toolbars/Build/ marked with the position attribute: [javax-swing-JToolBar$Separator.instance, org-netbeans-modules-project-ui-RunSingle.shadow, org-netbeans-modules-project-ui-DebugSingle.shadow, org-netbeans-modules-project-ui-TestSingle.shadow, org-netbeans-modules-project-ui-DebugTestSingle.shadow], but some are: [org-netbeans-modules-project-ui-BuildMainProject.shadow, org-netbeans-modules-project-ui-RebuildMainProject.shadow, org-netbeans-modules-project-ui-RunMainProject.shadow, org-netbeans-modules-debugger-ui-actions-DebugMainProjectAction.shadow, org-netbeans-modules-profiler-actions-ProfilerToolbarDropdownAction.instance] WARNING [org.openide.filesystems.Ordering]: Encountered non-boolean relative ordering attribute org.openide.filesystems.MultiFileObject.VoidValue#3 from org-netbeans-modules-project-ui-BuildMainProject.shadow/org-netbeans-modules-project-ui-RebuildMainProject.shadow on Toolbars/Build WARNING [org.openide.filesystems.Ordering]: Encountered non-boolean relative ordering attribute org.openide.filesystems.MultiFileObject.VoidValue#3 from org-netbeans-modules-debugger-ui-actions-ConnectAction.shadow/javax-swing-JToolBar$Separator.instance on Toolbars/Build WARNING [org.openide.filesystems.Ordering]: Encountered non-boolean relative ordering attribute org.openide.filesystems.MultiFileObject.VoidValue#3 from org-netbeans-modules-project-ui-DebugMainProject.shadow/org-netbeans-modules-debugger-ui-actions-ConnectAction.shadow on Toolbars/Build WARNING [org.openide.filesystems.Ordering]: Encountered non-boolean relative ordering attribute org.openide.filesystems.MultiFileObject.VoidValue#3 from org-netbeans-modules-project-ui-RebuildMainProject.shadow/org-netbeans-modules-project-ui-RunMainProject.shadow on Toolbars/Build WARNING [org.openide.filesystems.Ordering]: Encountered non-boolean relative ordering attribute org.openide.filesystems.MultiFileObject.VoidValue#3 from org-netbeans-modules-project-ui-RunMainProject.shadow/org-netbeans-modules-project-ui-DebugMainProject.shadow on Toolbars/Build WARNING [org.openide.filesystems.Ordering]: Not all children in Toolbars/Build/ marked with the position attribute: [javax-swing-JToolBar$Separator.instance, org-netbeans-modules-project-ui-RunSingle.shadow, org-netbeans-modules-project-ui-DebugSingle.shadow, org-netbeans-modules-project-ui-TestSingle.shadow, org-netbeans-modules-project-ui-DebugTestSingle.shadow], but some are: [org-netbeans-modules-project-ui-BuildMainProject.shadow, org-netbeans-modules-project-ui-RebuildMainProject.shadow, org-netbeans-modules-project-ui-RunMainProject.shadow, org-netbeans-modules-debugger-ui-actions-DebugMainProjectAction.shadow, org-netbeans-modules-profiler-actions-ProfilerToolbarDropdownAction.instance] Diagnostic information Input arguments: -Djdk.home=/opt/jdk1.6 -Dnetbeans.dirs=/home/gugrim/netbeans-6.0-200711081200/nb6.0:/home/gugrim/netbeans-6.0-200711081200/ide8:/home/gugrim/netbeans-6.0-200711081200/java1:/home/gugrim/netbeans-6.0-200711081200/xml1:/home/gugrim/netbeans-6.0-200711081200/apisupport1:/home/gugrim/netbeans-6.0-200711081200/enterprise4:/home/gugrim/netbeans-6.0-200711081200/profiler2:/home/gugrim/netbeans-6.0-200711081200/visualweb1:/home/gugrim/netbeans-6.0-200711081200/identity1:/home/gugrim/netbeans-6.0-200711081200/harness: -Dnetbeans.home=/home/gugrim/netbeans-6.0-200711081200/platform7 -Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade -Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense -Xmx365m -Xss2m -Xms32m -XX:PermSize=32m -XX:MaxPermSize=200m -Dnetbeans.logger.console=true -ea -Dapple.laf.useScreenMenuBar=true -Dawt.useSystemAAFontSettings=lcd Compiler: HotSpot Client Compiler Heap memory usage: initial 32.0MB maximum 363.2MB Non heap memory usage: initial 52.2MB maximum 252.0MB Garbage collector: Copy (Collections=245 Total time spent=0s) Garbage collector: MarkSweepCompact (Collections=1 Total time spent=0s) Classes: loaded=7740 total loaded=7740 unloaded 0 INFO [org.netbeans.core.ui.warmup.DiagnosticTask]: Total memory 2,126,262,272 INFO [org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalog]: No content in cache for URL_Standard provider. Returns EMPTY_MAP INFO [org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalog]: No content in cache for URL_PluginPortal provider. Returns EMPTY_MAP INFO [org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalog]: No content in cache for URL_Beta provider. Returns EMPTY_MAP INFO [org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalog]: No content in cache for URL_ThirdParty provider. Returns EMPTY_MAP WARNING [org.netbeans.modules.java.source.usages.RepositoryUpdater]: Source root: /home/gugrim/projects/Klara/trunk/web not on its sourcepath. WARNING [org.netbeans.modules.java.source.usages.RepositoryUpdater]: Source root: /home/gugrim/projects/DOISuite4/trunk/DOIStudio4/web not on its sourcepath. INFO [org.netbeans.modules.java.source.usages.SymbolDumper]: Unhandled ElementKind: STATIC_INIT INFO [org.netbeans.modules.java.source.usages.SymbolDumper]: Unhandled ElementKind: STATIC_INIT WARNING [org.netbeans.api.java.source.JavaSource]: JavaSource.runUserActionTask called in AWT event thread by: org.netbeans.modules.editor.java.GoToSupport.performGoTo(GoToSupport.java:131) INFO [org.netbeans.modules.java.source.usages.SymbolDumper]: Unhandled ElementKind: STATIC_INIT INFO [org.netbeans.modules.java.source.usages.SymbolDumper]: Unhandled ElementKind: STATIC_INIT INFO [org.netbeans.modules.java.source.usages.SymbolDumper]: Unhandled ElementKind: STATIC_INIT WARNING [org.openide.filesystems.Ordering]: Not all children in FormDesignerPalette/ marked with the position attribute: [DOI], but some are: [_Layouts_only_for_internal_use_, SwingContainers, SwingControls, SwingMenus, SwingWindows, AWT, Borders, Beans, J2EEComponents, LookAndFeels] WARNING [org.netbeans.api.java.source.JavaSource]: JavaSource.runUserActionTask called in AWT event thread by: org.netbeans.modules.form.GandalfPersistenceManager.getSuperClassName(GandalfPersistenceManager.java:573) WARNING [org.openide.filesystems.Ordering]: Not all children in FormDesignerPalette/ marked with the position attribute: [DOI], but some are: [_Layouts_only_for_internal_use_, SwingContainers, SwingControls, SwingMenus, SwingWindows, AWT, Borders, Beans, J2EEComponents, LookAndFeels] WARNING [org.openide.filesystems.Ordering]: Not all children in FormDesignerPalette/ marked with the position attribute: [DOI], but some are: [_Layouts_only_for_internal_use_, SwingContainers, SwingControls, SwingMenus, SwingWindows, AWT, Borders, Beans, J2EEComponents, LookAndFeels] WARNING [org.netbeans.modules.editor.impl.KitsTracker]: Ambiguous mime types for editor kit implementation class: class org.netbeans.modules.xml.text.syntax.XMLKit; mime types: [text/xml, text/xml-external-parsed-entity, text/x-struts+xml, application/x-schema+xml, text/x-ant+xml, text/x-wsdl+xml, text/x-jsf+xml] INFO [org.netbeans.modules.editor.settings.storage.SettingsProvider]: Won't provide any settings for text/base It's been deprecated, use MimePath.EMPTY instead. WARNING [org.openide.loaders]: Should override getLookup() in class org.netbeans.modules.xml.core.XMLDataObject, e.g.: [MultiDataObject.this.]getCookieSet().getLookup() WARNING [org.netbeans.api.java.source.JavaSource]: JavaSource.runUserActionTask called in AWT event thread by: org.netbeans.api.java.source.ui.ElementOpen.getOffset(ElementOpen.java:171) WARNING [org.openide.util.actions.CallableSystemAction]: Warning - org.netbeans.modules.localhistory.ui.view.ShowLocalHistoryAction should override CallableSystemAction.asynchronous() to return false INFO: There isn't any DocumentModelProvider registered for text/plain mimetype! java.lang.IllegalStateException: There isn't any DocumentModelProvider registered for text/plain mimetype! at org.netbeans.modules.editor.structure.DocumentModelProviderFactory.getDocumentModelProvider(DocumentModelProviderFactory.java:95) at org.netbeans.modules.editor.structure.api.DocumentModel.getDocumentModel(DocumentModel.java:235) at org.netbeans.modules.xml.text.folding.XmlFoldManager.initFolds(XmlFoldManager.java:144) at org.netbeans.modules.editor.fold.FoldOperationImpl.initFolds(FoldOperationImpl.java:118) at org.netbeans.modules.editor.fold.FoldHierarchyExecution.rebuildManagers(FoldHierarchyExecution.java:665) at org.netbeans.modules.editor.fold.FoldHierarchyExecution.rebuild(FoldHierarchyExecution.java:598) at org.netbeans.modules.editor.fold.FoldHierarchyExecution$1.propertyChange(FoldHierarchyExecution.java:685) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276) at java.awt.Component.firePropertyChange(Component.java:7865) at javax.swing.text.JTextComponent.setDocument(JTextComponent.java:437) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView.setSource1(EditableDiffView.java:771) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView.access$400(EditableDiffView.java:97) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView$1.run(EditableDiffView.java:210) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView.(EditableDiffView.java:242) at org.netbeans.modules.diff.builtin.DefaultDiffControllerProvider.createDiffController(DefaultDiffControllerProvider.java:58) at org.netbeans.api.diff.DiffController.create(DiffController.java:90) at org.netbeans.modules.localhistory.ui.view.LocalHistoryDiffView$DiffPrepareTask$1.run(LocalHistoryDiffView.java:178) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) SEVERE [global] java.lang.NullPointerException at org.netbeans.modules.xml.text.folding.XmlFoldManager.initFolds(XmlFoldManager.java:145) at org.netbeans.modules.editor.fold.FoldOperationImpl.initFolds(FoldOperationImpl.java:118) at org.netbeans.modules.editor.fold.FoldHierarchyExecution.rebuildManagers(FoldHierarchyExecution.java:665) at org.netbeans.modules.editor.fold.FoldHierarchyExecution.rebuild(FoldHierarchyExecution.java:598) at org.netbeans.modules.editor.fold.FoldHierarchyExecution$1.propertyChange(FoldHierarchyExecution.java:685) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276) at java.awt.Component.firePropertyChange(Component.java:7865) at javax.swing.text.JTextComponent.setDocument(JTextComponent.java:437) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView.setSource1(EditableDiffView.java:771) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView.access$400(EditableDiffView.java:97) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView$1.run(EditableDiffView.java:210) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView.(EditableDiffView.java:242) at org.netbeans.modules.diff.builtin.DefaultDiffControllerProvider.createDiffController(DefaultDiffControllerProvider.java:58) at org.netbeans.api.diff.DiffController.create(DiffController.java:90) at org.netbeans.modules.localhistory.ui.view.LocalHistoryDiffView$DiffPrepareTask$1.run(LocalHistoryDiffView.java:178) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) [catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) INFO: There isn't any DocumentModelProvider registered for text/plain mimetype! java.lang.IllegalStateException: There isn't any DocumentModelProvider registered for text/plain mimetype! at org.netbeans.modules.editor.structure.DocumentModelProviderFactory.getDocumentModelProvider(DocumentModelProviderFactory.java:95) at org.netbeans.modules.editor.structure.api.DocumentModel.getDocumentModel(DocumentModel.java:235) at org.netbeans.modules.xml.text.folding.XmlFoldManager.initFolds(XmlFoldManager.java:144) at org.netbeans.modules.editor.fold.FoldOperationImpl.initFolds(FoldOperationImpl.java:118) at org.netbeans.modules.editor.fold.FoldHierarchyExecution.rebuildManagers(FoldHierarchyExecution.java:665) at org.netbeans.modules.editor.fold.FoldHierarchyExecution.rebuild(FoldHierarchyExecution.java:598) at org.netbeans.modules.editor.fold.FoldHierarchyExecution$1.propertyChange(FoldHierarchyExecution.java:685) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276) at java.awt.Component.firePropertyChange(Component.java:7865) at javax.swing.text.JTextComponent.setDocument(JTextComponent.java:437) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView.setSource1(EditableDiffView.java:771) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView.access$400(EditableDiffView.java:97) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView$1.run(EditableDiffView.java:210) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView.(EditableDiffView.java:242) at org.netbeans.modules.diff.builtin.DefaultDiffControllerProvider.createDiffController(DefaultDiffControllerProvider.java:58) at org.netbeans.api.diff.DiffController.create(DiffController.java:90) at org.netbeans.modules.localhistory.ui.view.LocalHistoryDiffView$DiffPrepareTask$1.run(LocalHistoryDiffView.java:178) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) SEVERE [global] java.lang.NullPointerException at org.netbeans.modules.xml.text.folding.XmlFoldManager.initFolds(XmlFoldManager.java:145) at org.netbeans.modules.editor.fold.FoldOperationImpl.initFolds(FoldOperationImpl.java:118) at org.netbeans.modules.editor.fold.FoldHierarchyExecution.rebuildManagers(FoldHierarchyExecution.java:665) at org.netbeans.modules.editor.fold.FoldHierarchyExecution.rebuild(FoldHierarchyExecution.java:598) at org.netbeans.modules.editor.fold.FoldHierarchyExecution$1.propertyChange(FoldHierarchyExecution.java:685) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276) at java.awt.Component.firePropertyChange(Component.java:7865) at javax.swing.text.JTextComponent.setDocument(JTextComponent.java:437) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView.setSource1(EditableDiffView.java:771) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView.access$400(EditableDiffView.java:97) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView$1.run(EditableDiffView.java:210) at org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView.(EditableDiffView.java:242) at org.netbeans.modules.diff.builtin.DefaultDiffControllerProvider.createDiffController(DefaultDiffControllerProvider.java:58) at org.netbeans.api.diff.DiffController.create(DiffController.java:90) at org.netbeans.modules.localhistory.ui.view.LocalHistoryDiffView$DiffPrepareTask$1.run(LocalHistoryDiffView.java:178) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) [catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) INFO [org.netbeans.modules.uihandler.Installer]: findIdentity: NB_JAVA_WEBEE0900aaa48-9d8e-4364-8e39-3a6a9578f327 INFO [org.netbeans.modules.editor.settings.storage.SettingsProvider]: Won't provide any settings for text/base It's been deprecated, use MimePath.EMPTY instead. WARNING [org.openide.loaders]: Should override getLookup() in class org.netbeans.modules.properties.PropertiesDataObject, e.g.: [MultiDataObject.this.]getCookieSet().getLookup() WARNING [org.netbeans.api.java.source.JavaSource]: JavaSource.runUserActionTask called in AWT event thread by: org.netbeans.modules.java.editor.imports.FastImportAction.actionPerformed(FastImportAction.java:107) WARNING [org.netbeans.api.java.source.JavaSource]: JavaSource.runModificationTask called in AWT event thread by: org.netbeans.modules.java.editor.imports.ImportClassPanel.importClass(ImportClassPanel.java:334) WARNING [org.netbeans.api.java.source.JavaSource]: JavaSource.runUserActionTask called in AWT event thread by: org.netbeans.api.java.source.JavaSource.runWhenScanFinished(JavaSource.java:733) INFO [org.netbeans.modules.editor.settings.storage.SettingsProvider]: Won't provide any settings for text/base It's been deprecated, use MimePath.EMPTY instead. INFO [org.netbeans.modules.java.source.usages.RepositoryUpdater] com.sun.tools.javac.util.CouplingAbort at com.sun.tools.javac.comp.MemberEnter.visitMethodDef(MemberEnter.java:650) at com.sun.tools.javadoc.JavadocMemberEnter.visitMethodDef(JavadocMemberEnter.java:65) at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:658) at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:416) at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:428) at com.sun.tools.javac.comp.MemberEnter.finishClass(MemberEnter.java:438) at com.sun.tools.javac.comp.MemberEnter.finish(MemberEnter.java:1112) at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:1079) at com.sun.tools.javac.code.Symbol.complete(Symbol.java:402) at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:785) at com.sun.tools.javac.comp.Enter.complete(Enter.java:581) at org.netbeans.api.java.source.JavaSource$ErrorHandlingJavadocEnter.main(JavaSource.java:1141) at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:840) at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:357) at org.netbeans.modules.java.source.TreeLoader.loadTreeFor(TreeLoader.java:99) Caused: java.lang.AssertionError: Coupling error: class file file:/home/gugrim/.netbeans/6.0rc1/var/cache/index/0.7/s1/classes/se/grim/doi/view/DoiBinderView.sig, source file file:/home/gugrim/projects/DOISuite4/trunk/DOI4/src/se/grim/doi/view/DoiBinderView.java ----- Sig file content: ------------------------------------------- GM401;Nse.grim.doi.view.DoiBinderView;;Lse.grim.doi.view.DoiTopView;;; AM40019;INFEATURE_FileExport;I10;; AM2;Lse.grim.doi.controller.DoiBinder;NitsBinder;X;; AM2;Lse.grim.doi.widget.DoiTextField;NitsNewLookupTarget;X;; AM40002;Ljava.util.Map;NitsOperViewMap;X;; EM1;N;()()V;; EM1;NgetBinder;()(Ljava.lang.IllegalStateException;)Lse.grim.doi.controller.DoiBinder;;; EM1;NgetBinderOrNull;()()Lse.grim.doi.controller.DoiBinder;;; EM1;NsetBinder;(M200000000;Lse.grim.doi.controller.DoiBinder;NpBinder;)()V;; EM1;NgetMasterController;()()Lse.grim.doi.controller.DoiMasterController;;; EM1;NgetNewLookupTarget;()()Lse.grim.doi.widget.DoiTextField;;; EM1;NsetNewLookupTarget;(M200000000;Lse.grim.doi.widget.DoiTextField;NpTarget;)()V;; EM1;NgetOperationView;(M200000000;Ljava.lang.String;NpOperationName;)()Lse.grim.doi.view.DoiOperationView;;; EM1;NaddOperationView;(M200000000;Lse.grim.doi.view.DoiOperationView;NpOperationView;)()Lse.grim.doi.view.DoiOperationView;;; EM1;NopenOperationView;(M200000000;Ljava.lang.String;NpOperationName;)(Ljava.io.IOException;)Lse.grim.doi.view.DoiOperationView;;; EM1;Npermitted;(M200000000;INpActionMask;)()Z;; EM1;NremoveOperationView;(M200000000;Lse.grim.doi.view.DoiOperationView;NpOperationView;)()Z;; EM1;NgetUserPreferences;()()REfiValueMap;;; EM4;NbookmarkSaved;(M200000000;Lse.grim.doi.bookmark.DoiBookmark;NpBookmark;)(Ljava.io.IOException;)V;; EM404;NbuildTitle;()()Ljava.lang.String;;; EM1;NcreateAction;(M200000000;Ljava.lang.String;NpActionName;M200000000;Ljava.lang.String;NpIconName;M200000000;Lse.grim.doi.action.DoiActionHandler;NpHandler;)()Lse.grim.doi.action.DoiAction;Ljava.lang.Override;;;; EM4;NcreateActionSet;()()Lse.grim.doi.action.DoiActionSet;Ljava.lang.Override;;;; EM4;NcreateBookmark;()(Ljava.io.IOException;)Lse.grim.doi.bookmark.DoiBookmark;;; EM4;NcreateMenuBarActionLists;()()Lse.grim.doi.action.DoiActionList;Ljava.lang.Override;;;; EM4;NcreateToolBarActionLists;()()Lse.grim.doi.action.DoiActionList;Ljava.lang.Override;;;; EM1;NdoActionBookmarkOpen;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;M200000000;Lse.grim.doi.bookmark.DoiBookmark;NpBookmark;)(Ljava.io.IOException;)V;; EM1;NdoActionBookmarkExport;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)V;; EM1;NdoActionBookmarkImport;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)V;; EM1;NdoActionBookmarkSave;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)V;; EM1;NdoActionBrowse;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;M200000000;INpBrowseDir;)(Ljava.io.IOException;)V;; EM1;NdoActionBrowseFirst;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)V;; EM1;NdoActionBrowsePrev;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)V;; EM1;NdoActionBrowseNext;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)V;; EM1;NdoActionBrowseLast;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)V;; EM1;NdoActionFileDelete;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)V;; EM1;NdoActionFileExport;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)V;; EM1;NdoActionFilePrint;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;M200000000;ZNpPreview;)(Ljava.io.IOException;)V;; EM1;NdoActionFilePrint;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)VLjava.lang.Override;;;; EM1;NdoActionFilePrintPreview;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)VLjava.lang.Override;;;; EM1;NdoActionViewCriteria;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)V;; EM1;NdoActionViewObject;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)V;; EM1;NdoActionViewSelection;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)V;; EM1;NexportObjects;(M200000000;Ljava.lang.String;NpExportType;M200000000;Ljava.io.OutputStream;NpOutput;M200000000;Ljava.lang.String;NpFileType;)(Ljava.io.IOException;)V;; EM1;NnewObjectFromSource;(M200000000;Lse.grim.doi.view.DoiBinderView;NpSourceView;)(Ljava.io.IOException;)V;; EM1;NreportCount;()()I;; EM1;NreportList;(M200000000;Lse.grim.doi.print.DoiPrintView;NpPrintView;)()Ljava.util.List;;; EM1;NrefreshActionState;()()VLjava.lang.Override;;;; EM1;NrefreshMenuActionList;(M200000000;Lse.grim.doi.action.DoiActionList;NpActionList;)()VLjava.lang.Override;;;; EM1;NrefreshTitle;()()V;; EM1;NshowException;(M200000000;Ljava.lang.Throwable;NpException;)()VLjava.lang.Override;;;; EM1;NviewClosed;()()VLjava.lang.Override;;;; EM1;NviewClosed;(M200000000;Lse.grim.doi.view.DoiTopView;NpView;)()VLjava.lang.Override;;;; W; ----- Source file content: ---------------------------------------- package se.grim.doi.view; import java.awt.*; import java.awt.event.*; import java.beans.*; import java.io.*; import java.util.*; import java.util.List; import javax.swing.*; import javax.swing.filechooser.*; import org.w3c.dom.*; import se.grim.doi.action.*; import se.grim.doi.bookmark.*; import se.grim.doi.bookmark.file.*; import se.grim.doi.controller.*; import se.grim.doi.model.*; import se.grim.doi.navigator.*; import se.grim.doi.print.*; import se.grim.doi.security.*; import se.grim.doi.util.*; import se.grim.doi.widget.*; import se.grim.effie.io.*; import se.grim.effie.logic.parser.*; import se.grim.effie.table.*; import se.grim.effie.value.*; import static se.grim.doi.controller.DoiObjectBrowsable.*; /** * A top level view that is usually associated with a binder. * * @author Copyright © Gunnar Grim * @since 4.0 * @version 4.4 */ public abstract class DoiBinderView extends DoiTopView { //////////////////////////////////////////////////////////////////////////////// // Constants and variables. /** * Feature constant indicating that the view should add the "FileExport" action to the File menu. * Initially false. * @since 4.0 */ public static final int FEATURE_FileExport = 10; /** * The binder. During desing time, this is null. * @since 4.0.0 */ private DoiBinder itsBinder; /** * A text field or table column that wishes to receive lookup data for a new object when this view is saved. */ private DoiTextField itsNewLookupTarget; /** * Operation views owned by this binder view, indexed by symbolic operation name. */ private Map itsOperViewMap = new HashMap(); //////////////////////////////////////////////////////////////////////////////// // Constructors. /** * Construct a new binder view. * @since 4.0 */ public DoiBinderView() { } //////////////////////////////////////////////////////////////////////////////// // Property accessors and mutators. /** * Return the binder that owns this view. * @return The binder. * @throws IllegalStateException If no binder has been attached. * @since 4.0 */ public DoiBinder getBinder() throws IllegalStateException { if (itsBinder == null) throw new IllegalStateException("No binder has been attached."); return itsBinder; } /** * Return the binder that owns this view, or null if none. * @return The binder, or null. * @since 4.2 */ public DoiBinder getBinderOrNull() { return itsBinder; } /** * Connect this view to the specified binder. The default icon for the view type is set. * @param pBinder The binder. * @see DoiBinder#getIconForViewType(String, int) * @since 4.0 */ public void setBinder(DoiBinder pBinder) { if (pBinder == null) throw new IllegalArgumentException("The binder is null."); DoiBinder oldBinder = itsBinder; itsBinder = pBinder; firePropertyChange("binder", oldBinder, itsBinder); setIcon(getBinder().getIconForViewType(getViewType(), 16)); } /** * Return the master controller, i e binder or application, that owns this view. * For application level operation views, no binder is available and the application is returned instead. * @since 4.2 */ public DoiMasterController getMasterController() { DoiBinder binder = getBinderOrNull(); return (binder != null) ? binder : getApp(); } /** * Set a text field or table column that wishes to receive lookup data for a new object when this view is saved. * @since 4.3 */ public DoiTextField getNewLookupTarget() { return itsNewLookupTarget; } /** * Set a text field or table column that wishes to receive lookup data for a new object when this view is saved. * @since 4.3 */ public void setNewLookupTarget(DoiTextField pTarget) { itsNewLookupTarget = pTarget; } /** * Return the operation view of the specified type. * @param pOperationName The symbolic operation name. * @return The view, or null if not attached. * @since 4.0 */ public DoiOperationView getOperationView(String pOperationName) { if (pOperationName == null) throw new IllegalArgumentException("The operation name is null."); return itsOperViewMap.get(pOperationName); } /** * Add (attach) an operation view. Invoked by {@link DoiOperationView#setOwnerView}. * @param pOperationView The operation view. * @return The previously attached view with the same operation name, or null. * @since 4.0 */ public DoiOperationView addOperationView(DoiOperationView pOperationView) { if (pOperationView == null) throw new IllegalArgumentException("The operation view is null."); DoiOperationView oldView = itsOperViewMap.put(pOperationView.getOperationName(), pOperationView); if (oldView == pOperationView) return pOperationView; if (oldView != null) oldView.setOwnerView(null); pOperationView.setOwnerView(this); return oldView; } /** * Open an operation view and bring it to top. If the operation view isn't already open it is created using * {@link DoiBinder#createOperationView(String, Class)} with null for the default class. * @param pOperationName The symbolic operation name. * @return The view. * @since 4.0 */ public DoiOperationView openOperationView(String pOperationName) throws IOException { DoiOperationView view = (DoiOperationView)getOperationView(pOperationName); if (view == null) { try { getApp().waitCursorOn(); view = (DoiOperationView)getBinder().createOperationView(pOperationName, null); view.setOwnerView(this); } finally { getApp().waitCursorOff(); } } view.showView(); return view; } /** * Test if the specified actions are permitted on this view. Frequently called to enable or disable actions. * The default implementation delegates to {@link DoiBinder#permitted(int)}. * @param pActionMask The action mask as {@link DoiObjectPermission#MASK_READ DoiObjectPermission.MASK} constants * combined with the |-operator. * @since 4.4 */ public boolean permitted(int pActionMask) { return getBinder().permitted(pActionMask); } /** * Remove (detach) an operation view. Invoked by {@link DoiOperationView#setOwnerView}. * @param pOperationView The operation view. * @return true if the operation view was removed. * @since 4.0 */ public boolean removeOperationView(DoiOperationView pOperationView) { if (pOperationView == null) throw new IllegalArgumentException("The operation view is null."); DoiOperationView attachedView = itsOperViewMap.get(pOperationView.getOperationName()); if (attachedView != pOperationView) return false; itsOperViewMap.remove(pOperationView.getOperationName()); pOperationView.setOwnerView(null); return true; } /** * Return the user preferences. Returns the node "View" in the binder * preferences, where "" is the symbolic view type name, e g "Object". * @return The preferences. * @since 4.0 * @changed 4.2 */ public EfiValueMap getUserPreferences() { return getMasterController().getUserPreferences().map(getViewType()+"View", true); } //////////////////////////////////////////////////////////////////////////////// // Operations. /** * Invoked by {@link #doActionBookmarkSave} after a bookmark has been successfully * saved. The default implementation delegates to {@link DoiBinder#bookmarkDeletedOrSaved} to * refresh the binder node in the navigator and the "Bookmark" menus for all views owned by * the binder. * Since the user can change the title * when saving, a view may need to override this method to update itself with the new title. * @param pBookmark The newly saved bookmark. * @throws IOException If an I/O error occurs. * @since 4.0 */ protected void bookmarkSaved(DoiBookmark pBookmark) throws IOException { itsBinder.bookmarkDeletedOrSaved(pBookmark, true); } /** * Build the view title. Invoked by {@link #refreshTitle}. * @return The title. * @since 4.0 */ protected abstract String buildTitle(); /** * Factory method that creates an action with a title fetched from a resource * bundle. The title resource name must be "cmdXxxx" where * Xxxx is the action name. * The icon is fetched from the application icon library. * Overridden to delegates to the binder, if available. * @param pActionName The symbolic action name, e g "FileSave". * @param pIconName The symbolic icon name, or null. * @param pHandler Action handler or null. See {@link DoiAction#setHandler}. * @return An icon. * @since 4.4 */ @Override public DoiAction createAction(String pActionName, String pIconName, DoiActionHandler pHandler) { if (itsBinder != null) return itsBinder.createAction(pActionName, pIconName, pHandler); else return getApp().createAction(pActionName, pIconName, pHandler); } /** * Create a set of actions for this view. Invoked by {@link DoiView#getActionSet} if * the actions hasn't been created yet. * @return A set of actions. * @since 4.0 */ @Override protected DoiActionSet createActionSet() { DoiActionSet actions = super.createActionSet(); if (Beans.isDesignTime()) return actions; DoiBinder binder = getBinderOrNull(); DoiAction action; action = createAction("BrowseFirst", "BrowseFirst", this); action.setEnabled(false); actions.add(action); action = createAction("BrowsePrev", "BrowsePrev", this); action.setEnabled(false); actions.add(action); action = createAction("BrowseNext", "BrowseNext", this); action.setEnabled(false); actions.add(action); action = createAction("BrowseLast", "BrowseLast", this); action.setEnabled(false); actions.add(action); if (binder != null) { action = binder.createActionForObject("FileDelete", null, this); action.setEnabled(false); actions.add(action); } action = createAction("FileExport", null, this); action.setEllipsis(true); actions.add(action); if (getApp().getPrintSupport().isPrintingSupported()) { action = createAction("FilePrint", "Print", this); action.setEnabled(false); actions.add(action); action = createAction("FilePrintPreview", "PrintPreview", this); action.setEnabled(false); actions.add(action); } action = createAction("ViewCriteria", "Criteria", this); action.setEnabled(false); actions.add(action); if (binder != null) { action = binder.createActionForObject("ViewObject", "Doc", this); action.setEnabled(false); actions.add(action); } action = createAction("ViewSelection", "Book", this); action.setEnabled(false); actions.add(action); action = createAction("BookmarkSave", null, this); action.setEllipsis(true); actions.add(action); action = createAction("BookmarkImport", null, this); action.setEllipsis(true); actions.add(action); action = createAction("BookmarkExport", null, this); action.setEllipsis(true); actions.add(action); return actions; } /** * Create a bookmark using the contents of this view. * @return A bookmark, or null if no bookmark can be created. * @throws IOException If an I/O error occurs. * @since 4.0 */ protected DoiBookmark createBookmark() throws IOException { return null; } /** * Create the menu bar action lists. Invoked by {@link DoiTopView#getMenuActionList} if the lists * hasn't been created yet. * Overridden to add additional menus. * @return A list containing menu action lists for each menu. * @since 4.0 */ @Override protected DoiActionList createMenuBarActionLists() { DoiActionList menuBarList = super.createMenuBarActionLists(); DoiActionList actionList; actionList = new DoiActionList("Bookmark", getApp().getTextString("cmdBookmark")); refreshMenuActionList(actionList); menuBarList.insertItemAfter("View", actionList, false, false); return menuBarList; } /** * Create the toolbar action lists. Invoked by {@link DoiTopView#getToolBarActionLists} if the lists * hasn't been created yet. * @return A list containing toolbar action lists for each group. * @see #getToolBarActionLists * @since 4.0 */ @Override protected DoiActionList createToolBarActionLists() { DoiActionList toolBarLists = super.createToolBarActionLists(); if (getApp().getPrintSupport().isPrintingSupported()) { DoiActionList fileGroupList = (DoiActionList)toolBarLists.getActionItem("File"); fileGroupList.addItem(getAction("FilePrint"), true); if (getApp().getPrintSupport().isPreviewSupported()) fileGroupList.addItem(getAction("FilePrintPreview")); } DoiActionList browseGroupList = new DoiActionList("Browse", getApp().getTextString("cmdBrowse")); browseGroupList.addItem(getAction("BrowseFirst")); browseGroupList.addItem(getAction("BrowsePrev")); browseGroupList.addItem(getAction("BrowseNext")); browseGroupList.addItem(getAction("BrowseLast")); toolBarLists.insertItemAfter("File", browseGroupList, false, false); if (itsBinder != null) { DoiActionList viewGroupList = (DoiActionList)toolBarLists.getActionItem("View"); viewGroupList.insertItemBefore("ViewRefresh", getAction("ViewObject"), true, true); viewGroupList.insertItemAfter("ViewObject", getAction("ViewSelection"), false, true); viewGroupList.insertItemAfter("ViewSelection", getAction("ViewCriteria"), false, true); } return toolBarLists; } /** * Open a bookmark in this view, or open a new view with the contents specified by the bookmark if the bookmark * type is not compatible with this view. * @param pEvent The action event. * @param pBookmark The bookmark to open. * @throws IOException If an I/O error occurs. * @since 4.0 */ public void doActionBookmarkOpen(ActionEvent pEvent, DoiBookmark pBookmark) throws IOException { } /** * Export a bookmark to an external XML file. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.4 */ public void doActionBookmarkExport(ActionEvent pEvent) throws IOException { DoiBookmark bookmark = createBookmark(); if (bookmark == null) return; String dir = getUserPreferences().getString("BookmarkExportDir"); JFileChooser chooser = new JFileChooser(dir); chooser.setDialogTitle(DoiLabel.removeDecoration(getApp().getTextString("cmdBookmarkExport"))); chooser.setFileFilter(new DoiExtensionFileFilter("DBX", getApp().getTextString("txtFileFilterDBX"))); Point pt = getLocationOnScreen(); pt.translate(20, 20); chooser.setLocation(pt); if (chooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) throw new DoiUserAbortException(); File file = chooser.getSelectedFile(); if (file == null) throw new DoiUserAbortException(); file = EfiFiles.defaultExtension(file, "dbx"); getUserPreferences().setString("BookmarkExportDir", file.getParent()); OutputStream output = new BufferedOutputStream(new FileOutputStream(file)); Document doc = EfiXml.createDocument(); bookmark.toDom(doc, (String)null); EfiXml.writeNode(doc, "ISO-8859-1", 4, output); output.close(); } /** * Import a bookmark from an external XML file and prompt the user to save it. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.4 */ public void doActionBookmarkImport(ActionEvent pEvent) throws IOException { String dir = getUserPreferences().getString("BookmarkImportDir"); if (dir == null && !(getApp().getBookmarkManager() instanceof DoiFileBookmarkManager)) { File bmdir = new DoiFileBookmarkManager().dir(DoiBookmark.STORAGE_User, getBinder()); if (bmdir.isDirectory()) dir = bmdir.getPath(); } JFileChooser chooser = new JFileChooser(dir); chooser.setDialogTitle(DoiLabel.removeDecoration(getApp().getTextString("cmdBookmarkImport"))); chooser.setFileFilter(new DoiExtensionFileFilter("DBX", getApp().getTextString("txtFileFilterDBX"))); Point pt = getLocationOnScreen(); pt.translate(20, 20); chooser.setLocation(pt); if (chooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) throw new DoiUserAbortException(); File file = chooser.getSelectedFile(); if (file == null) throw new DoiUserAbortException(); getUserPreferences().setString("BookmarkImportDir", file.getParent()); Document doc = EfiXml.parseDocument(file); DoiBookmark bookmark = getApp().getBookmarkManager().createBookmark(doc.getDocumentElement()); DoiBinder binder = bookmark.getBinder(); DoiSaveBookmarkDialog dialog = new DoiSaveBookmarkDialog(this); dialog.setBookmark(bookmark); dialog.show(); if (!dialog.isConfirmed()) throw new DoiUserAbortException(); getBinder().bookmarkDeletedOrSaved(bookmark, true); } /** * Save the current object, selection or criteria as a bookmark. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.0 */ public void doActionBookmarkSave(ActionEvent pEvent) throws IOException { DoiBookmark bookmark = createBookmark(); if (bookmark == null) return; try { getApp().waitCursorOn(); DoiSaveBookmarkDialog dialog = new DoiSaveBookmarkDialog(this); dialog.setBookmark(bookmark); dialog.show(); if (!dialog.isConfirmed()) throw new DoiUserAbortException(); bookmarkSaved(bookmark); } finally { getApp().waitCursorOff(); } } /** * Browse to some object. Invoked by the {@link #doActionBrowseFirst doActionBrowseXxx}-methods. * The default implementation does nothing. * @param pEvent The action event. * @param pBrowseDir One of the {@link DoiObjectBrowsable#BROWSE_First BROWSE}-constants. * @throws IOException If an I/O error occurs. * @since 4.0 */ public void doActionBrowse(ActionEvent pEvent, int pBrowseDir) throws IOException { } /** * Browse to the first object. * The default implementation does nothing. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.0 */ public void doActionBrowseFirst(ActionEvent pEvent) throws IOException { doActionBrowse(pEvent, BROWSE_First); } /** * Browse to the previous object. * The default implementation does nothing. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.0 */ public void doActionBrowsePrev(ActionEvent pEvent) throws IOException { doActionBrowse(pEvent, BROWSE_Prev); } /** * Browse to the next object. * The default implementation does nothing. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.0 */ public void doActionBrowseNext(ActionEvent pEvent) throws IOException { doActionBrowse(pEvent, BROWSE_Next); } /** * Browse to the last object. * The default implementation does nothing. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.0 */ public void doActionBrowseLast(ActionEvent pEvent) throws IOException { doActionBrowse(pEvent, BROWSE_Last); } /** * Delete some object. * The default implementation does nothing. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.0 */ public void doActionFileDelete(ActionEvent pEvent) throws IOException { } /** * Export the object or objects visible in this view. * The default implementation does nothing. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.0 */ public void doActionFileExport(ActionEvent pEvent) throws IOException { } /** * Print the contents of this view. * Prompts the user to save the view, then invokes {@link #printView} with wait cursor displayed. * @param pEvent The action event. * @param pPreview true to preview. * @throws IOException If an I/O error occurs. * @since 4.0 */ public void doActionFilePrint(ActionEvent pEvent, boolean pPreview) throws IOException { promptSaveView(); DoiPrintView printView = (DoiPrintView)getOperationView(DoiBinder.OPER_Print); if (printView == null) { printView = (DoiPrintView)getBinder().createOperationView("Print", DoiPrintView.class); printView.setOwnerView(this); } printView.refreshTitle(); printView.setDestType(pPreview ? DoiPrintSupport.DEST_Preview : DoiPrintSupport.DEST_Printer); printView.showView(); } /** * Print the contents of this view. * Delegates to {@link #doActionFilePrint} with false for the preview flag. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.0 */ @Override public void doActionFilePrint(ActionEvent pEvent) throws IOException { doActionFilePrint(pEvent, false); } /** * Print preview the contents of this view. * Delegates to {@link #doActionFilePrint} with true for the preview flag. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.0 */ @Override public void doActionFilePrintPreview(ActionEvent pEvent) throws IOException { doActionFilePrint(pEvent, true); } /** * Open or activate the criteria view. The default implementation does nothing. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.0 */ public void doActionViewCriteria(ActionEvent pEvent) throws IOException { } /** * Open or activate the object view. The default implementation does nothing. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.0 */ public void doActionViewObject(ActionEvent pEvent) throws IOException { } /** * Open or activate the selection view. The default implementation does nothing. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.0 */ public void doActionViewSelection(ActionEvent pEvent) throws IOException { } /** * Export the object or objects visible in this view. * The default implementation throws an UnsupportedOperationException. Override if the feature * {@link #FEATURE_FileExport} is supported. * @param pExportType Export type if applicable. Passed to {@link DoiBinder#exportObjects} and can be used to handle * exports with different amounts of data. * @param pOutput The target output stream. * @param pFileType The file type, e g "xml" or "csv". * @throws IOException If an I/O error occurs. * @since 4.0 */ public void exportObjects(String pExportType, OutputStream pOutput, String pFileType) throws IOException { throw new UnsupportedOperationException("exportObjects"); } /** * Invoked on a new or reused view when a new object is created from another view, after {@link #setNewLookupTarget} * has been called. * The default implementation does nothing. * Override to initialize the new view or row with relevant data from the source. * @param pSourceView The source object or selection view. * @since 4.4 */ public void newObjectFromSource(DoiBinderView pSourceView) throws IOException { } /** * Return the number of applicable reports for this view. * Invoked by {@link #refreshActionState} to determine if the print actiosn should be available. * The default implementation invokes {@link DoiBinder#getReportMap} and returns the size. * @return The number of available reports. * @since 4.4 */ public int reportCount() { return getBinder().getReportMap(getViewType()).size()+getBinder().getReportMap(DoiBinder.VIEWTYPE_Binder).size(); } /** * Create and return a list containing all applicable reports for this view. * Invoked when a {@link DoiPrintView} is created and possibly * whenever the selection is changed in this view. * The list contents may depend on the current selection. * The default implementation invokes {@link DoiBinder#getReportMap} and adds all reports * in the map for this view type. * @param pPrintView The print view that requests the list from the binder view, or null. * @return A list containing {@link DoiReport} objects. * @since 4.0 */ public List reportList(DoiPrintView pPrintView) { List resultList = new ArrayList(); resultList.addAll(getBinder().getReportMap(getViewType()).values()); resultList.addAll(getBinder().getReportMap(DoiBinder.VIEWTYPE_Binder).values()); return resultList; } /** * Refresh the enabled/disabled state of the actions of this view. * This implementation sets the state of the following actions: *
    *
  • FileSave - Enabled if dirty and the feature {@link #FEATURE_SaveDirty} is true.
  • *
  • FilePrint - Enabled if printing is supported, and at least one report has view type {@link DoiBinder#VIEWTYPE_Binder} * and source type {@link DoiReport#SOURCETYPE_Application}.
  • *
  • FilePrintPreview - Enabled if above condition is met and the print supports has preview capability.
  • *
. * @since 4.0 * @changed 4.4 */ @Override public void refreshActionState() { super.refreshActionState(); boolean refreshAppActions = false; DoiAction action; boolean oldState, newState; if (hasFeature(FEATURE_SaveDirty)) { if (itsBinder != null) { action = getAction("FileSave"); oldState = action.isEnabled(); newState = isDirty() && permitted(DoiObjectPermission.MASK_WRITE); if (oldState != newState) { action.setEnabled(newState); refreshAppActions = true; } } } DoiBinder binder = getBinderOrNull(); if (binder != null && getApp().getPrintSupport().isPrintingSupported()) { boolean print = false; if (reportCount() > 0 && binder.hasReport(DoiBinder.VIEWTYPE_Binder, DoiReport.SOURCETYPE_Application)) print = true; getAction("FilePrint").setEnabled(print); if (getApp().getPrintSupport().isPreviewSupported()) getAction("FilePrintPreview").setEnabled(print); } if (refreshAppActions) getApp().refreshActionState(); } /** * Refresh the specified menu action list. Invoked for each list when the menu is initially built and when a * single menu is refreshed. On entry, the list is empty. * This implementation augments the standard menus "File", through "Help", adding actions suitable * for binder views. * Subclasses should either override this method to handle additional menus. * @param pActionList The action list. * @since 4.0 * @todo Icon for Save Bookmark. */ @Override public void refreshMenuActionList(DoiActionList pActionList) { super.refreshMenuActionList(pActionList); String listName = pActionList.getName().intern(); if ("File" == listName) { DoiActionList browseMenuList = new DoiActionList("Browse", getApp().getTextString("cmdBrowse")); browseMenuList.addItem(getAction("BrowseFirst")); browseMenuList.addItem(getAction("BrowsePrev")); browseMenuList.addItem(getAction("BrowseNext")); browseMenuList.addItem(getAction("BrowseLast")); pActionList.insertItemBefore(null, getAction("FileNew"), false, false); pActionList.insertItemAfter("FileNew", getAction("FileOpen"), false, false); pActionList.insertItemAfter("FileOpen", browseMenuList, false, false); pActionList.insertItemBefore("FileCloseAll", getAction("FileClose"), true, false); pActionList.insertItemBefore("FileSaveAll", getAction("FileSave"), true, false); if (getApp().getPrintSupport().isPrintingSupported()) { if (getApp().getPrintSupport().isPreviewSupported()) { pActionList.insertItemAfter("FileSaveAll", getAction("FilePrint"), true, false); pActionList.insertItemAfter("FilePrint", getAction("FilePrintPreview"), false, true); } else { pActionList.insertItemAfter("FileSaveAll", getAction("FilePrint"), true, true); } } if (hasFeature(FEATURE_FileExport)) pActionList.insertItemAfter("FileSaveAll", getAction("FileExport"), true, true); return; } if ("Edit" == listName) { pActionList.addItem(getAction("EditPasteObjects")); } if (itsBinder != null && "View" == listName) { pActionList.insertItemBefore("ViewRefresh", getAction("ViewObject"), true, true); pActionList.insertItemAfter("ViewObject", getAction("ViewSelection"), false, true); pActionList.insertItemAfter("ViewSelection", getAction("ViewCriteria"), false, true); return; } if (itsBinder != null && "Bookmark" == listName) { try { Iterator it = itsBinder.getBookmarkList().iterator(); while (it.hasNext()) { DoiBookmark bookmark = (DoiBookmark)it.next(); DoiBookmarkAction action = new DoiBookmarkAction(bookmark, this); action.setIcon(bookmark.getIcon()); pActionList.addItem(action, false); } } catch (IOException ex) { showException(ex); } try { if (getApp().getBookmarkManager().saveBookmarkAllowed(DoiBookmark.STORAGE_User, getBinder())) { pActionList.addItem(getAction("BookmarkSave"), true); pActionList.addItem(getAction("BookmarkImport"), true); pActionList.addItem(getAction("BookmarkExport"), false); } } catch (IOException ex) { getApp().showException(ex); } return; } } /** * Refresh the view title. Should be invoked by subclasses when some property that affects the title * is changed. Invokes {@link #buildTitle} and {@link DoiView#setTitle}. * @since 4.0 */ public void refreshTitle() { setTitle(buildTitle()); } /** * Show an exception and request confirmation. Delegates to {@link DoiBinder#showException(Throwable)}. * @param pException The exception. * @since 4.0 */ @Override public void showException(Throwable pException) { // Determine if a specific component has caused this exception. DoiComponent comp = null; int pos = 0; if (pException instanceof EfiGenericIOException) pException = ((EfiGenericIOException)pException).getCause(); if (pException instanceof DoiValidationException) { DoiValidationException ex = (DoiValidationException)pException; comp = ex.getComponent(); pos = ex.getPosition(); } else if (pException instanceof DoiObjectException) { DoiObjectException ex = (DoiObjectException)pException; List path = ex.getPath(); if (!path.isEmpty()) { FoundComponent found = findComponent(path); comp = DoiComponentSupport.component(found.getComponent()); path = found.getRemainingPath(); if (!path.isEmpty()) { Object element = path.get(0); if (element instanceof Integer) { pos = ((Integer)element).intValue(); // Assume that a position right after a column points to the first dirty row. if (comp instanceof DoiTableColumn) { DoiTableColumn column = (DoiTableColumn)comp; EfiTableModel tm = column.getTable().getTableModel(); int rc = tm.getRowCount(); int dpos = pos; for (int i = 0; i < rc; ++i) { if (tm.isRowDirty(i)) { pos = i; break; } } } } } } } else if (pException instanceof EfiParseException) { EfiParseException ex = (EfiParseException)pException; Object context = ex.getContext(); if (context instanceof DoiComponent) comp = (DoiComponent)context; } // Make the component visible. final JComponent focus; DoiSubView subView = null; if (comp instanceof DoiTableColumn) { DoiTableColumn column = (DoiTableColumn)comp; DoiTable table = column.getTable(); focus = table.getFocusFirstInner(); if (pos >= 0 && pos < table.getRowCount()) { table.setSelectedRowNo(pos); table.setSelectedColumn(column); } } else if (comp != null) { focus = comp.getFocusFirstInner(); } else { focus = null; } subView = (DoiSubView)SwingUtilities.getAncestorOfClass(DoiSubView.class, focus); if (subView != null) subView.showView(); // Fetch its label and delegate to the binder. String label = null; if (comp != null) { label = comp.getLabelTextEffective(); label = DoiLabel.removeDecoration(label); } if (itsBinder != null) itsBinder.showException(pException, label); else DoiApplication.instance().showException(pException); // Focus the errant component. if (focus != null) { SwingUtilities.invokeLater(new Runnable() { public void run() { focus.requestFocus(); } }); } } /** * Invoked when the view has been closed. Notifies the binder, using * {@link DoiBinder#viewClosed}. * @since 4.0 */ @Override public void viewClosed() { super.viewClosed(); if (itsBinder != null) itsBinder.viewClosed(this); } /** * Invoked by the desktop when another view has been closed. * Overridden to clear the refreence to the text field or table column that wishes to receive lookup data when * this view is saved. * @param pView The view that was closed. * @since 4.3 */ @Override public void viewClosed(DoiTopView pView) { super.viewClosed(pView); if (itsNewLookupTarget != null) { DoiTopView view = itsNewLookupTarget.getAncestorView(DoiTopView.class); if (view == pView) itsNewLookupTarget = null; } } } ----- Tree: ------------------------------------------------------- public EfiValueMap getUserPreferences() { return getMasterController().getUserPreferences().map(getViewType() + "View", true); } at org.netbeans.modules.java.source.usages.RepositoryUpdater.couplingAbort(RepositoryUpdater.java:3142) at org.netbeans.modules.java.source.TreeLoader.loadTreeFor(TreeLoader.java:103) at com.sun.tools.javac.model.JavacElements.getTreeAndTopLevel(JavacElements.java:627) at com.sun.tools.javac.model.JavacElements.getTreeAndTopLevel(JavacElements.java:653) at com.sun.tools.javac.api.JavacTrees.getPath(JavacTrees.java:168) at com.sun.tools.javac.api.JavacTrees.getPath(JavacTrees.java:160) at org.netbeans.modules.editor.java.GoToSupport$1.run(GoToSupport.java:245) at org.netbeans.modules.editor.java.GoToSupport$1.run(GoToSupport.java:132) at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:613) at org.netbeans.modules.editor.java.GoToSupport.performGoTo(GoToSupport.java:131) at org.netbeans.modules.editor.java.GoToSupport.goTo(GoToSupport.java:296) at org.netbeans.modules.java.editor.hyperlink.JavaHyperlinkProvider.performClickAction(JavaHyperlinkProvider.java:79) at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.performAction(HyperlinkOperation.java:253) at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.mouseClicked(HyperlinkOperation.java:396) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252) at java.awt.Component.processMouseEvent(Component.java:6041) at javax.swing.JComponent.processMouseEvent(JComponent.java:3260) at java.awt.Component.processEvent(Component.java:5803) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4410) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3995) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916) at java.awt.Container.dispatchEventImpl(Container.java:2102) at java.awt.Window.dispatchEventImpl(Window.java:2429) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) WARNING [org.netbeans.api.java.source.JavaSource]: JavaSource.runUserActionTask called in AWT event thread by: org.netbeans.modules.j2ee.ejbcore._RetoucheUtil.getJavaClassFromNode(_RetoucheUtil.java:145) INFO [org.netbeans.modules.java.source.usages.RepositoryUpdater] com.sun.tools.javac.util.CouplingAbort at com.sun.tools.javac.comp.MemberEnter.visitVarDef(MemberEnter.java:711) at com.sun.tools.javadoc.JavadocMemberEnter.visitVarDef(JavadocMemberEnter.java:79) at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:714) at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:416) at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:428) at com.sun.tools.javac.comp.MemberEnter.finishClass(MemberEnter.java:438) at com.sun.tools.javac.comp.MemberEnter.finish(MemberEnter.java:1112) at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:1079) at com.sun.tools.javac.code.Symbol.complete(Symbol.java:402) at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:785) at com.sun.tools.javac.comp.Enter.complete(Enter.java:581) at org.netbeans.api.java.source.JavaSource$ErrorHandlingJavadocEnter.main(JavaSource.java:1141) at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:840) at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:357) at org.netbeans.modules.java.source.TreeLoader.loadTreeFor(TreeLoader.java:99) Caused: java.lang.AssertionError: Coupling error: class file file:/home/gugrim/.netbeans/6.0rc1/var/cache/index/0.7/s1/classes/se/grim/doi/controller/DoiMasterController.sig, source file file:/home/gugrim/projects/DOISuite4/trunk/DOI4/src/se/grim/doi/controller/DoiMasterController.java ----- Sig file content: ------------------------------------------- GM401;Nse.grim.doi.controller.DoiMasterController;;Ljava.lang.Object;Lse.grim.doi.action.DoiActionHandler;;; AM40009;Ljava.lang.String;NPROPERTY_TextBundle;X;; AM40009;Ljava.lang.String;NPROPERTY_Title;X;; AM2;Lse.grim.doi.action.DoiActionSet;NitsActionSet;X;; AM40002;Ljava.util.BitSet;NitsFeatures;X;; AM2;Ljava.util.logging.Logger;NitsLogger;X;; AM2;Ljava.util.ResourceBundle;NitsTextBundle;X;; AM2;Ljava.beans.PropertyChangeSupport;NitsPCS;X;; AM2;Ljava.util.List;>;NitsPreferencesPanelClassList;X;; AM2;Ljava.lang.String;NitsTitle;X;; AM2;REfiValueMap;NitsUserPreferences;X;; EM1;N;()()V;; EM1;NgetAction;(M200000000;Ljava.lang.String;NpCode;)(Ljava.util.NoSuchElementException;)Lse.grim.doi.action.DoiAction;;; EM1;NgetActionSet;()()Lse.grim.doi.action.DoiActionSet;;; EM1;NhasFeature;(M200000000;INpFeature;)()Z;; EM1;NsetFeature;(M200000000;INpFeature;M200000000;ZNpSupported;)()V;; EM1;NgetLogger;()()Ljava.util.logging.Logger;;; EM4;NhasPCS;()()Z;; EM4;NgetPCS;()()Ljava.beans.PropertyChangeSupport;;; EM1;NaddPreferencesPanelClass;(M200000000;Ljava.lang.Class<+Lse.grim.doi.preferences.DoiPreferencesPanel;>;NpClass;)()V;; EM1;NremovePreferencesPanelClass;(M200000000;Ljava.lang.Class<+Lse.grim.doi.preferences.DoiPreferencesPanel;>;NpClass;)()Z;; EM1;NgetPreferencesPanelClassList;()()Ljava.util.List;>;;; EM1;NgetTextBundle;()()Ljava.util.ResourceBundle;;; EM1;NsetTextBundle;(M200000000;Ljava.util.ResourceBundle;NpTextBundle;)()V;; EM1;NgetTextString;(M200000000;Ljava.lang.String;NpKey;)()Ljava.lang.String;;; EM1;NgetTitle;()()Ljava.lang.String;;; EM1;NsetTitle;(M200000000;Ljava.lang.String;NpTitle;)()V;; EM1;NgetUserPreferences;()()REfiValueMap;;; EM1;NaddPropertyChangeListener;(M200000000;Ljava.beans.PropertyChangeListener;NpListener;)()V;; EM1;NremovePropertyChangeListener;(M200000000;Ljava.beans.PropertyChangeListener;NpListener;)()V;; EM404;NbuildTitle;()()Ljava.lang.String;;; EM4;NcreateActionSet;()()Lse.grim.doi.action.DoiActionSet;;; EM4;NcreateLogger;()()Ljava.util.logging.Logger;;; EM1;NcreateTextBundle;()()Ljava.util.ResourceBundle;;; EM404;NcreateUserPreferences;()()REfiValueMap;;; EM1;NrefreshActionState;()()V;; EM1;NrefreshTitle;()()V;; EM1;NtoString;()()Ljava.lang.String;;; W; ----- Source file content: ---------------------------------------- package se.grim.doi.controller; import java.beans.*; import java.util.*; import java.util.logging.*; import java.util.prefs.*; import se.grim.doi.action.*; import se.grim.doi.preferences.*; import se.grim.effie.util.*; import se.grim.effie.value.*; import se.grim.effie.value.prefs.*; /** * The superclass of applications and binders. Contains the resource management * common to both these subclasses. The following resources are available: *
    *
  • An action set. See {@link #getActionSet}
  • *
  • An event logger. See {@link #getLogger}
  • *
  • A resource bundle containing localized strings. See {@link #getTextBundle}
  • *
  • User preferences. See {@link #getUserPreferences}
  • *
* * @author Copyright © Gunnar Grim * @since 4.0 * @version 4.4 */ public abstract class DoiMasterController implements DoiActionHandler { //////////////////////////////////////////////////////////////////////////////// // Constants and variables. /** * Property name for the text bundle. * @since 4.0 */ public static String PROPERTY_TextBundle = "textBundle"; /** * Property name for the title. * @since 4.0 */ public static String PROPERTY_Title = "title"; /** * The set of actions for this controller. Created when needed. */ private DoiActionSet itsActionSet; /** * The set of features supported by this controller. Feature constants are defined * by the concrete sublasses. */ private BitSet itsFeatures = new BitSet(); /** * The logger. */ private Logger itsLogger; /** * The resource bundle that contains localized strings. */ private ResourceBundle itsTextBundle; /** * The property change support. */ private PropertyChangeSupport itsPCS; /** * List of preferences panel classes. */ private List> itsPreferencesPanelClassList; /** * The title. */ private String itsTitle; /** * The user preferences. */ private EfiValueMap itsUserPreferences; //////////////////////////////////////////////////////////////////////////////// // Constructors. /** * Construct a new DoiMasterController. * @since 4.0 */ public DoiMasterController() { } //////////////////////////////////////////////////////////////////////////////// // Property accessors and mutators. /** * Return the specified action. * @param pCode The symbolic action code, e g "FileExit". * @return The action. * @throws NoSuchElementException If the action doesn't exist. * @since 4.0 */ public DoiAction getAction(String pCode) throws NoSuchElementException { return getActionSet().getAction(pCode); } /** * Return the action set, containing actions for this controller. If the actions * hasn't been created yet {@link #createActionSet} is invoked. * @return The action set. * @since 4.0 */ public DoiActionSet getActionSet() { if (itsActionSet == null) itsActionSet = createActionSet(); return itsActionSet; } /** * Test if a certain feature is supported. Feature constants are defined by the * concrete subclasses {@link DoiApplication} and {@link DoiBinder}. * @param pFeature One of the feature constants. * @return true if supported. * @since 4.0 */ public boolean hasFeature(int pFeature) { return itsFeatures.get(pFeature); } /** * Specify if a certain feature is supported. Usually invoked by the constructor. * Feature constants are defined by the concrete subclasses {@link DoiApplication} * and {@link DoiBinder}. * @param pFeature One of the feature constants. * @param pSupported true if supported. * @since 4.0 */ public void setFeature(int pFeature, boolean pSupported) { itsFeatures.set(pFeature, pSupported); } /** * Return the logger. If a logger hasn't been created yet, {@link #createLogger} * is invoked. * @return The logger. * @since 4.0 */ public Logger getLogger() { if (itsLogger == null) itsLogger = createLogger(); return itsLogger; } /** * Test if property change support is available, i e if any listener has * been registered. * @return true if available. * @see #getPCS * @since 4.0 */ protected boolean hasPCS() { return itsPCS != null; } /** * Return the property change support, or null if no listener has * been registered. * @return The support, or null. * @see #hasPCS * @since 4.0 */ protected PropertyChangeSupport getPCS() { return itsPCS; } /** * Add a preferences panel class to an internal list. This list is used when the * preferences view is created. * @param pClass A panel class. * @since 4.2 */ public void addPreferencesPanelClass(Class pClass) { getPreferencesPanelClassList().add(pClass); } /** * Remove a preferences panel class from an internal list. This list is used when the * preferences view is created. * @param pClass A panel class. * @return true if a panel was removed. * @since 4.4 */ public boolean removePreferencesPanelClass(Class pClass) { return getPreferencesPanelClassList().remove(pClass); } /** * Return the internal list of preferences panel classes. This list is used when the * preferences view is created. * @return A list of panel classes. * @since 4.2 */ public List> getPreferencesPanelClassList() { if (itsPreferencesPanelClassList == null) itsPreferencesPanelClassList = new ArrayList>(); return itsPreferencesPanelClassList; } /** * Return the resource bundle that contains localized strings. Invokes * {@link #createTextBundle} if the text bundle hasn't been set or created yet. * @return The text bundle. * @since 4.0 */ public ResourceBundle getTextBundle() { if (itsTextBundle == null) itsTextBundle = createTextBundle(); return itsTextBundle; } /** * Set the resource bundle that contains localized strings. * @param pTextBundle The new text bundle, or null to ensure that * {@link #createTextBundle} is invoked the next time the texts are needed. * @since 4.0 */ public void setTextBundle(ResourceBundle pTextBundle) { ResourceBundle old = itsTextBundle; itsTextBundle = pTextBundle; if (itsPCS != null) itsPCS.firePropertyChange(PROPERTY_TextBundle, old, pTextBundle); } /** * Return the specified text from the text bundle. * Shortcut to {@link #getTextBundle}.getString(key). * @param pKey The resource key. * @return The text. * @since 4.0 */ public String getTextString(String pKey) { return getTextBundle().getString(pKey); } /** * Return the title. This is the plain text name, displayed to the user, for this application * or binder. If a title hasn't been created yet, {@link #buildTitle} is invoked. * @return The title. * @since 4.0 */ public String getTitle() { if (itsTitle == null) setTitle(buildTitle()); return itsTitle; } /** * Set the title. * @param pTitle The new title, or null to ensure that * {@link #buildTitle} is invoked the next time the title is needed. * @since 4.0 */ public void setTitle(String pTitle) { String oldTitle = itsTitle; itsTitle = pTitle; if (itsPCS != null) itsPCS.firePropertyChange(PROPERTY_Title, oldTitle, itsTitle); } /** * Return the user preferences. If not created yet, {@link #createUserPreferences} * is invoked. * @return The preferences. * @since 4.0 */ public EfiValueMap getUserPreferences() { if (itsUserPreferences == null) itsUserPreferences = createUserPreferences(); return itsUserPreferences; } //////////////////////////////////////////////////////////////////////////////// // Operations. /** * Add a property change listener. * @param pListener The listener. * @since 4.0 */ public void addPropertyChangeListener(PropertyChangeListener pListener) { if (itsPCS == null) itsPCS = new PropertyChangeSupport(this); itsPCS.addPropertyChangeListener(pListener); } /** * Remove a property change listener. * @param pListener The listener. * @since 4.0 */ public void removePropertyChangeListener(PropertyChangeListener pListener) { if (itsPCS != null) itsPCS.removePropertyChangeListener(pListener); } /** * Build the title. Invoked by {@link #getTitle} if a title hasn't been created yet. * The default implementation retrieves a title from the property "txtTitle" in the * text bundle. If not defined, the title is set to "(name)" where name * is the unqualified class name of this class. * @return The title. * @since 4.0 */ protected abstract String buildTitle(); /** * Create a set of actions for this application. Invoked by {@link #getActionSet} * if the action set hasn't been created yet. * @return The action set. * @since 4.0 */ protected DoiActionSet createActionSet() { DoiActionSet actions = new DoiActionSet(); return actions; } /** * Create the logger. Invoked by {@link #getLogger} if a logger hasn't been created yet. * The default implementation retrieves a logger using the package name of the concrete * subclass of this controller, e g "com.company.app" for an application * controller, or "com.company.app.binder" for a binder. * @return The logger. * @since 4.0 * @changed 4.3 */ protected Logger createLogger() { String name = getClass().getName(); int p = name.lastIndexOf('.'); if (p != -1) name = name.substring(0, p); return Logger.getLogger(name); } /** * Create a text bundle. Invoked by {@link #getTextBundle} if a text bundle hasn't been * created yet. * The default implementation examines the inheritence hierarchy from this class and * upwards. For each class it creates a standard text bundle based on the current locale. * The bundle is assumed to be named "TextBundle" and placed in the same package as * the class. All such bundles are combined using {@link EfiLinkedResourceBundle}, in * such a way that the bundle corresponding to a more specific subclass will be * queried before the next more general. * @return The resource bundle. * @since 4.0 */ public ResourceBundle createTextBundle() { ResourceBundle foundBundle = null; Class refClass = getClass(); while (refClass != null) { String className = refClass.getName(); int p = className.lastIndexOf('.'); if (p == -1) className = "TextBundle"; else className = className.substring(0, p+1)+"TextBundle"; try { ResourceBundle bundle = ResourceBundle.getBundle(className, Locale.getDefault()); if (foundBundle != null) foundBundle = new EfiLinkedResourceBundle(foundBundle, bundle); else foundBundle = bundle; refClass = refClass.getSuperclass(); } catch (MissingResourceException ex) { refClass = refClass.getSuperclass(); if (refClass == null) if (foundBundle != null) return foundBundle; else throw ex; } } throw new IllegalStateException("Unreachable"); } /** * Create the user preferences. Invoked by {@link #getUserPreferences} if the * preferences hasn't been created yet. * @return The preferences. * @since 4.0 */ protected abstract EfiValueMap createUserPreferences(); /** * Refresh the enabled/disabled state of the controller actions. * The default implementation does nothing. * @since 4.0 */ public void refreshActionState() { } /** * Refresh the title. Should be invoked when some property that affects the title * is changed. Invokes {@link #buildTitle} and {@link #setTitle}. * @since 4.0 */ public void refreshTitle() { setTitle(buildTitle()); } /** * Return the String representation, which is the title. * @return The title. * @see #getTitle * @since 4.0 */ public String toString() { return getTitle(); } } ----- Tree: ------------------------------------------------------- private EfiValueMap itsUserPreferences at org.netbeans.modules.java.source.usages.RepositoryUpdater.couplingAbort(RepositoryUpdater.java:3142) at org.netbeans.modules.java.source.TreeLoader.loadTreeFor(TreeLoader.java:103) at com.sun.tools.javac.model.JavacElements.getTreeAndTopLevel(JavacElements.java:627) at com.sun.tools.javac.model.JavacElements.getTreeAndTopLevel(JavacElements.java:653) at com.sun.tools.javac.api.JavacTrees.getPath(JavacTrees.java:168) at com.sun.tools.javac.api.JavacTrees.getPath(JavacTrees.java:160) at org.netbeans.modules.editor.java.GoToSupport$1.run(GoToSupport.java:245) at org.netbeans.modules.editor.java.GoToSupport$1.run(GoToSupport.java:132) at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:613) at org.netbeans.modules.editor.java.GoToSupport.performGoTo(GoToSupport.java:131) at org.netbeans.modules.editor.java.GoToSupport.goTo(GoToSupport.java:296) at org.netbeans.modules.java.editor.hyperlink.JavaHyperlinkProvider.performClickAction(JavaHyperlinkProvider.java:79) at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.performAction(HyperlinkOperation.java:253) at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.mouseClicked(HyperlinkOperation.java:396) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252) at java.awt.Component.processMouseEvent(Component.java:6041) at javax.swing.JComponent.processMouseEvent(JComponent.java:3260) at java.awt.Component.processEvent(Component.java:5803) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4410) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3995) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916) at java.awt.Container.dispatchEventImpl(Container.java:2102) at java.awt.Window.dispatchEventImpl(Window.java:2429) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) SEVERE [global] java.lang.IllegalArgumentException at org.netbeans.api.java.source.ui.ElementOpen$1.run(ElementOpen.java:184) at org.netbeans.api.java.source.ui.ElementOpen$1.run(ElementOpen.java:176) at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:613) at org.netbeans.api.java.source.ui.ElementOpen.getOffset(ElementOpen.java:171) at org.netbeans.api.java.source.ui.ElementOpen.getOpenInfo(ElementOpen.java:120) at org.netbeans.api.java.source.ui.ElementOpen.getOpenInfo(ElementOpen.java:110) at org.netbeans.api.java.source.ui.ElementOpen.open(ElementOpen.java:73) at org.netbeans.modules.editor.java.GoToSupport$2.open(GoToSupport.java:722) at org.netbeans.modules.editor.java.GoToSupport$1.run(GoToSupport.java:283) at org.netbeans.modules.editor.java.GoToSupport$1.run(GoToSupport.java:132) at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:613) at org.netbeans.modules.editor.java.GoToSupport.performGoTo(GoToSupport.java:131) at org.netbeans.modules.editor.java.GoToSupport.goTo(GoToSupport.java:296) at org.netbeans.modules.java.editor.hyperlink.JavaHyperlinkProvider.performClickAction(JavaHyperlinkProvider.java:79) at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.performAction(HyperlinkOperation.java:253) at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.mouseClicked(HyperlinkOperation.java:396) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252) at java.awt.Component.processMouseEvent(Component.java:6041) at javax.swing.JComponent.processMouseEvent(JComponent.java:3260) at java.awt.Component.processEvent(Component.java:5803) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4410) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3995) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916) at java.awt.Container.dispatchEventImpl(Container.java:2102) at java.awt.Window.dispatchEventImpl(Window.java:2429) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) [catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) INFO [org.netbeans.modules.java.source.usages.RepositoryUpdater] com.sun.tools.javac.util.CouplingAbort at com.sun.tools.javac.comp.MemberEnter.visitMethodDef(MemberEnter.java:650) at com.sun.tools.javadoc.JavadocMemberEnter.visitMethodDef(JavadocMemberEnter.java:65) at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:658) at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:416) at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:428) at com.sun.tools.javac.comp.MemberEnter.finishClass(MemberEnter.java:438) at com.sun.tools.javac.comp.MemberEnter.finish(MemberEnter.java:1112) at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:1079) at com.sun.tools.javac.code.Symbol.complete(Symbol.java:402) at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:785) at com.sun.tools.javac.comp.Enter.complete(Enter.java:581) at org.netbeans.api.java.source.JavaSource$ErrorHandlingJavadocEnter.main(JavaSource.java:1141) at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:840) at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:357) at org.netbeans.modules.java.source.TreeLoader.loadTreeFor(TreeLoader.java:99) Caused: java.lang.AssertionError: Coupling error: class file file:/home/gugrim/.netbeans/6.0rc1/var/cache/index/0.7/s1/classes/se/grim/doi/widget/DoiTableColumn.sig, source file file:/home/gugrim/projects/DOISuite4/trunk/DOI4/src/se/grim/doi/widget/DoiTableColumn.java ----- Sig file content: ------------------------------------------- GM1;Nse.grim.doi.widget.DoiTableColumn;;Lse.grim.doi.widget.DoiTextField;;; AM2;Ljavax.swing.table.TableCellRenderer;NitsCellRenderer;X;; AM2;Lse.grim.doi.view.DoiComponent;NitsDetailComponent;X;; AM40002;INitsHorizontalAlignment;X;; AM2;INitsIdentificationLevel;X;; AM2;[Ljava.lang.String;NitsLabelLines;X;; AM2;ZNitsLocked;X;; AM40002;ZNitsResizable;X;; AM2;Lse.grim.doi.widget.DoiTableColumn;NitsSecondarySortColumn;X;; AM40002;ZNitsSortable;X;; AM2;Ljavax.swing.table.TableColumn;NitsSwingTableColumn;X;; AM2;Lse.grim.doi.widget.DoiTable;NitsTable;X;; AM2;INitsViewColNo;X;; AM2;INitsVisibleWidth;X;; EM1;N;()()V;; EM1;NgetCellRenderer;()()Ljavax.swing.table.TableCellRenderer;;; EM1;NsetCellRenderer;(M200000000;Ljavax.swing.table.TableCellRenderer;NpCellRenderer;)()V;; EM1;NgetCellRendererEffective;()()Ljavax.swing.table.TableCellRenderer;;; EM1;NisDesignTime;()()ZLjava.lang.Override;;;; EM1;NgetDetailComponent;()()Lse.grim.doi.view.DoiComponent;R;;;; EM1;NsetDetailComponent;(M200000000;Lse.grim.doi.view.DoiComponent;NpDetailComponent;)()V;; EM1;NisEditable;()()ZLjava.lang.Override;;;; EM1;NsetHidden;(M200000000;ZNpHidden;)()VLjava.lang.Override;;;; EM1;NgetHorizontalAlignment;()()IR;;;; EM1;NsetHorizontalAlignment;(M200000000;INpAlign;)()V;; EM1;NgetHorizontalAlignmentUsed;()()I;; EM1;NgetIdentificationLevel;()()IR;;;; EM1;NsetIdentificationLevel;(M200000000;INpLevel;)()V;; EM1;NgetLabelLine;(M200000000;INpLineNo;)()Ljava.lang.String;;; EM1;NgetLabelLineCount;()()I;; EM1;NgetLabelText;()()Ljava.lang.String;R;;Ljava.lang.Override;;;; EM1;NsetLabelText;(M200000000;Ljava.lang.String;NpText;)()VLjava.lang.Override;;;; EM1;NisLocked;()()ZR;;;; EM1;NsetLocked;(M200000000;ZNpLocked;)()V;; EM1;NgetLookupKeyColumn;()()Lse.grim.doi.widget.DoiTableColumn;R;;;; EM1;NsetLookupKeyColumn;(M200000000;Lse.grim.doi.widget.DoiTableColumn;NpKeyColumn;)()V;; EM1;NgetLookupKeyField;()()Lse.grim.doi.widget.DoiTextField;R;;Ljava.lang.Override;;;; EM1;NgetLookupKeyColumnEffective;()()Lse.grim.doi.widget.DoiTableColumn;;; EM1;NgetLookupNameColumn;()()Lse.grim.doi.widget.DoiTableColumn;R;;;; EM1;NsetLookupNameColumn;(M200000000;Lse.grim.doi.widget.DoiTableColumn;NpNameColumn;)()V;; EM1;NgetLookupNameField;()()Lse.grim.doi.widget.DoiTextField;R;;Ljava.lang.Override;;;; EM1;NgetModelColNo;()()I;; EM1;NsetModelColNo;(M200000000;INpColNo;)()V;; EM1;NgetModelColumn;()()REfiColumn;;; EM1;NisPrimaryKey;()()Z;; EM1;NsetPrimaryKey;(M200000000;ZNpPrimaryKey;)()V;; EM1;NisResizable;()()ZR;;;; EM1;NsetResizable;(M200000000;ZNpResizable;)()V;; EM1;NgetSecondarySortColumn;()()Lse.grim.doi.widget.DoiTableColumn;R;;;; EM1;NsetSecondarySortColumn;(M200000000;Lse.grim.doi.widget.DoiTableColumn;NpColumn;)()V;; EM1;NisSortable;()()ZR;;;; EM1;NsetSortable;(M200000000;ZNpSortable;)()V;; EM1;NsetState;(M200000000;INpState;)()ZLjava.lang.Override;;;; EM1;NgetSwingTableColumn;()()Ljavax.swing.table.TableColumn;;; EM1;NgetTable;()()Lse.grim.doi.widget.DoiTable;;; EM4;NsetTable;(M200000000;Lse.grim.doi.widget.DoiTable;NpTable;)()V;; EM1;NgetAncestorView;(M200000000;Ljava.lang.Class;NpClass;)()QT;Ljava.lang.Override;;Ljava.lang.SuppressWarnings;Nvalue;[Lunchecked;;;;; EM1;NaddTableCellTooltipEventListener;(M200000000;Lse.grim.doi.event.DoiTableCellTooltipEventListener;NpHandler;)()VR;;;; EM1;NremoveTableCellTooltipEventListener;(M200000000;Lse.grim.doi.event.DoiTableCellTooltipEventListener;NpHandler;)()V;; EM1;NhasValue;()()ZLjava.lang.Override;;;; EM1;NgetValue;()()Ljava.lang.Object;Ljava.lang.Override;;;; EM4;NsetValue;(M200000000;Ljava.lang.Object;NpValue;M200000000;INpState;M200000000;Ljava.util.EventObject;NpCausedByEvent;)()VLjava.lang.Override;;;; EM1;NsetValueClass;(M200000000;Ljava.lang.Class;NpClass;)()VLjava.lang.Override;;;; EM1;NgetVisibleWidth;()()IR;;;; EM1;NsetVisibleWidth;(M200000000;INpWidth;)()V;; EM4;NadjustWidths;(M200000000;INpCharWidth;)()V;; EM4;NaddToColumnModel;(M200000000;Ljavax.swing.table.TableColumnModel;NpColumnModel;)()V;; EM4;NcolumnWidths;(M200000000;INpCharWidth;)()I;; EM1;NconfigureColumnModel;(M200000000;REfiColumn;NpColumn;)()V;; EM1;NconfigureColumnView;(M200000000;REfiColumn;NpColumn;)()V;; EM1;NconfigureTextField;(M200000000;Lse.grim.doi.widget.DoiTextField;NpTextField;)()V;; EM4;NcreateDateDialog;()()Lse.grim.doi.view.DoiDateDialog;Ljava.lang.Override;;;; EM4;NcreateLookupDialog;(M200000000;REfiTableModel;NpTableModel;)()Lse.grim.doi.view.DoiLookupDialog;Ljava.lang.Override;;;; EM4;NcreateSwingTableColumn;()()Ljavax.swing.table.TableColumn;;; EM1;NeditingStopped;(M200000000;Lse.grim.doi.widget.DoiTable$TableView;NpTableView;M200000000;Ljava.lang.Object;NpOldValue;M200000000;Ljava.lang.Object;NpNewValue;)()V;; EM1;NfireValueChanged;(M200000000;Ljavax.swing.event.DocumentEvent;NpEvent;)()VLjava.lang.Override;;;; EM1;NfireValueChanged;(M200000000;Ljava.awt.event.ItemEvent;NpEvent;)()VLjava.lang.Override;;;; EM1;NfocusLostLookup;(M200000000;Ljava.awt.event.FocusEvent;NpEvent;)()VLjava.lang.Override;;;; EM4;NfocusSelect;(M200000000;Ljava.awt.event.FocusEvent;NpEvent;)()VLjava.lang.Override;;;; EM1;NopenWith;(M200000000;Lse.grim.doi.action.DoiOpenWithAction;NpAction;M200000000;Ljava.awt.event.ActionEvent;NpEvent;)(Ljava.io.IOException;)VLjava.lang.Override;;;; EM4;NrefreshDesignTimeRendering;()()ZLjava.lang.Override;;;; EM1;NtoolTipText;(M200000000;Lse.grim.doi.widget.DoiTable$TableView;NpTableView;M200000000;INpRowNo;M200000000;INpModelColNo;M200000000;INpViewColNo;)()Ljava.lang.String;;; WR;;; ----- Source file content: ---------------------------------------- package se.grim.doi.widget; import java.awt.*; import java.awt.event.*; import java.beans.*; import java.io.*; import java.util.*; import java.util.EventObject; import java.util.List; import javax.swing.*; import javax.swing.event.*; import javax.swing.table.*; import javax.swing.text.*; import se.grim.doi.action.*; import se.grim.doi.controller.*; import se.grim.doi.event.*; import se.grim.doi.model.*; import se.grim.doi.util.*; import se.grim.doi.view.*; import se.grim.doi.widget.table.*; import se.grim.effie.apt.beaninfo.*; import se.grim.effie.logic.*; import se.grim.effie.logic.operation.*; import se.grim.effie.table.*; import se.grim.effie.util.*; import se.grim.effie.value.*; /** * A table column for use inside a {@link DoiTable}. A table column is an extension * of {@link DoiTextField} but will not be visible on screen during runtime. For an * explanation on how table columns interact with their table, see the * documentation for {@link DoiTable}. * * @author Copyright © Gunnar Grim * @since 4.0 * @version 4.4 */ @EfiJavaBean( displayName="Table Column", shortDescription="Table column used inside a table.", inherit=true, defaultProperty="name", iconBase="beanicons/TableColumn") public class DoiTableColumn extends DoiTextField { //////////////////////////////////////////////////////////////////////////////// // Constants and variables. /** * The renderer used by the table view to draw cell values for this column. */ private TableCellRenderer itsCellRenderer; /** * The detail component associated with this column. */ private DoiComponent itsDetailComponent; /** * The horizontal alignment, or -1 to use the default for the value class. */ private int itsHorizontalAlignment = -1; /** * The identification level of this column. */ private int itsIdentificationLevel; /** * The separate lines of the label. */ private String[] itsLabelLines; /** * Indicates if this column is in the non horizontally scrolled part of the table. */ private boolean itsLocked; /** * Indicates if this column is user resizable. */ private boolean itsResizable = true; /** * The secondary sort column, used as secondary sort order when sorting the table * on this column. */ private DoiTableColumn itsSecondarySortColumn; /** * Indicates if this column is user sortable. */ private boolean itsSortable = true; /** * The real table column based on this template component, for inclusion * in a column model. */ private TableColumn itsSwingTableColumn; /** * The table containing this column. */ private DoiTable itsTable; /** * The column number withing the table view. */ private int itsViewColNo; /** * The preferred visible width in pixels, or 0 to use a calculated width based on the visible length * and font size. */ private int itsVisibleWidth; //////////////////////////////////////////////////////////////////////////////// // Constructors and initializers. /** * Construct a new DoiColumn. * @since 4.0 */ public DoiTableColumn() { setLabelSuffix(""); setLabelText(" "); setBorder( BorderFactory.createCompoundBorder( UIManager.getBorder("TableHeader.cellBorder"), BorderFactory.createEmptyBorder(0, 1, 0, 1))); getJLabel().setFont(UIManager.getFont("TableHeader.font")); getJLabel().setHorizontalAlignment(getHorizontalAlignmentUsed()); } //////////////////////////////////////////////////////////////////////////////// // Property accessors and mutators. /** * Return the renderer used by the table view to draw cell values for this column. * @return The cell renderer. * @see #setCellRenderer * @see TableColumn#getCellRenderer * @since 4.0 */ public TableCellRenderer getCellRenderer() { return itsCellRenderer; } /** * Set the renderer used by the table view to draw cell values for this column. * @param pCellRenderer The cell renderer. * @see #getCellRenderer * @since 4.0 */ public void setCellRenderer(TableCellRenderer pCellRenderer) { itsCellRenderer = pCellRenderer; if (itsSwingTableColumn != null) itsSwingTableColumn.setCellRenderer(itsCellRenderer); } /** * Return the effective renderer used by the table view to draw cell values for this column. * If no explicit renderer has been set, the renderer used by the Swing column is returned. * @return The cell renderer. * @since 4.4 */ public TableCellRenderer getCellRendererEffective() { if (itsCellRenderer != null) return itsCellRenderer; if (itsSwingTableColumn != null) return itsSwingTableColumn.getCellRenderer(); return null; } /** * Test for design time mode. * This implementation delegates to {@link DoiBeans#isDesignTime} with the table as the reference component. * @since 4.4 */ @Override public boolean isDesignTime() { return DoiBeans.isDesignTime(itsTable); } /** * Return the detail component associated with this column. * @return The detail component, or null. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Detail Component", shortDescription="Detail component for extended presentation and editing.", preferred=true) public DoiComponent getDetailComponent() { return itsDetailComponent; } /** * Set the detail component associated with this column. * @param pDetailComponent The detail component, or null. * @since 4.0 */ public void setDetailComponent(DoiComponent pDetailComponent) { if (itsDetailComponent == pDetailComponent) return; itsDetailComponent = pDetailComponent; refreshDesignTimeRendering(); } /** * Test if the component should be editable. A component is editable if the * set of reasons for being read only is empty. Overriden to return true * only if both the column and the parent table is editable. * @return true if the read only set is empty. * @see #setReadOnly * @since 4.0 */ @Override public boolean isEditable() { if (!super.isEditable()) return false; return (itsTable != null) ? itsTable.isEditable() : false; } /** * Specify that the table should hide this column. * @param pHidden true if the column should be hidden. * @since 4.0 */ @Override public void setHidden(boolean pHidden) { if (pHidden == isHidden()) return; super.setHidden(pHidden); if (itsTable != null) itsTable.setupTableViews(); } /** * Return the horizontal alignment, or -1 to use the default for the value class. * @return The horizontal alignment, or -1. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Horizontal Alignment", shortDescription="The horizontal alignment of header and values.", propertyEditor=DoiHorizontalAlignmentPropertyEditor.class, preferred=true) public int getHorizontalAlignment() { return itsHorizontalAlignment; } /** * Set the horizontal alignment. If set to -1, the default alignment for the value class * is used. * @param pAlign The horizontal alignment, or -1. * @since 4.0 */ public void setHorizontalAlignment(int pAlign) { if (itsHorizontalAlignment == pAlign) return; itsHorizontalAlignment = pAlign; getJLabel().setHorizontalAlignment(getHorizontalAlignmentUsed()); } /** * Return the actual horizontal alignment to use, based on the explicit setting or the * default for the value class. * @return The horizontal alignment. * @since 4.0 */ public int getHorizontalAlignmentUsed() { if (itsHorizontalAlignment != -1) return itsHorizontalAlignment; if (Number.class.isAssignableFrom(getValueClass()) && !isDropDown()) return TRAILING; else if (getValueClass() == Boolean.class) return CENTER; else return LEADING; } /** * Return the identification level of this column. * This property is propagated to any table model created by the table view, * and is used by the table model to determine when a cell is editable. Normally * a primary key column is only editable if the row is new. * @return The level, as one of the identification level * {@linkplain EfiColumn#IDL_None constants}. * @see #setIdentificationLevel * @since 4.0 */ @EfiJavaBeanProperty( displayName="Identification Level", shortDescription="The role this column has in identifying a row.", propertyEditor=DoiIdentificationLevelPropertyEditor.class, preferred=true) public int getIdentificationLevel() { return itsIdentificationLevel; } /** * Set the identification level of this column. * @param pLevel The level, as one of the identification level * {@linkplain EfiColumn#IDL_None constants}. * @see #getIdentificationLevel * @since 4.0 */ public void setIdentificationLevel(int pLevel) { if (itsIdentificationLevel == pLevel) return; itsIdentificationLevel = pLevel; refreshDesignTimeRendering(); } /** * Return the specified line in a multi line label. * @param pLineNo The 0-based line number. * @return The line extracted from the label. * @since 4.0 */ public String getLabelLine(int pLineNo) { return itsLabelLines[pLineNo]; } /** * Return the number of separate lines in a multi line label. If the column has * no label, the line count is 0. * @return The number of label lines. * @since 4.0 */ public int getLabelLineCount() { return itsLabelLines != null ? itsLabelLines.length : 0; } /** * Return the label text, with any mnemonic prefixed with the &-character. * For multi line labels, the |-symbol is used to separate the lines. * @return The text. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Label Text", shortDescription="The column header text.", preferred=true) @Override public String getLabelText() { return super.getLabelText(); } /** * Set the label text. Overridden to ensure that it is never null or empty, and * to handle multi line labels. * For multi line labels, the |-symbol is used to separate the lines. * @param pText The header text. * @since 4.0 */ @Override public void setLabelText(String pText) { if (pText == null || pText.length() == 0) pText = " "; super.setLabelText(pText); itsLabelLines = EfiStrings.splitString(getJLabel().getText(), '|', true); } /** * Test if this column is in the non horizontally scrolled part of the table. * @return true if the column is locked. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Locked", shortDescription="Placed in the non horizontally scrolled part of the table.", preferred=true) public boolean isLocked() { return itsLocked; } /** * Specify if this column is in the non horizontally scrolled part of the table. * @param pLocked true if the column should be locked. * @since 4.0 */ public void setLocked(boolean pLocked) { itsLocked = pLocked; } /** * Return the primary key column used for lookup and "Open With". Used on secondary key columns. * @return The key column, or null. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Lookup Key Column", shortDescription="The primary key column used for lookup and 'Open With'. Used on secondary key columns.", preferred=true) public DoiTableColumn getLookupKeyColumn() { return (DoiTableColumn)getLookupKeyField(); } /** * Set the primary key column used for lookup and "Open With". Used on secondary key columns. * @param pKeyColumn The key column, or null. * @since 4.0 */ public void setLookupKeyColumn(DoiTableColumn pKeyColumn) { setLookupKeyField(pKeyColumn); } /** * Return the associated key field used for lookup and "Open With". * Overridden for BeanInfo annotation. * @return The key field, or null. * @since 4.1 */ @EfiJavaBeanProperty( displayName="Lookup Key Field", shortDescription="Not used on columns. Use LookupKeyColumn instead.", hidden=true) @Override public DoiTextField getLookupKeyField() { return super.getLookupKeyField(); } /** * Return the effective primary key column used for lookup and "Open With". * Returns the one specified using {@link #setLookupKeyColumn} unless it is null, in which case this column is returned. * @return The key field. * @since 4.0 */ public DoiTableColumn getLookupKeyColumnEffective() { return (DoiTableColumn)getLookupKeyFieldEffective(); } /** * Return the name column used for lookup. * @return The key column, or null. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Lookup Name Column", shortDescription="The name column used for lookup. Usually set on a key column.", preferred=true) public DoiTableColumn getLookupNameColumn() { return (DoiTableColumn)getLookupNameField(); } /** * Set the name column used for lookup. * @param pNameColumn The name column, or null. * @since 4.0 */ public void setLookupNameColumn(DoiTableColumn pNameColumn) { setLookupNameField(pNameColumn); } /** * Return the name field used for lookup. * Overridden for BeanInfo annotation. * @return The key field, or null. * @since 4.1 */ @EfiJavaBeanProperty( displayName="Lookup Name Field", shortDescription="Not used on columns. Use LookupNameColumn instead.", hidden=true) @Override public DoiTextField getLookupNameField() { return super.getLookupNameField(); } /** * Return the column number in the current table model corresponding to this column. * @return The 0-based column number within the table model. * @since 4.0 */ public int getModelColNo() { return getSwingTableColumn().getModelIndex(); } /** * Set the column number for the column in the current table model that corresponds * to this column. Invoked by the table when a new table model is assigned. * @param pColNo A 0-based column number. * @since 4.0 */ public void setModelColNo(int pColNo) { getSwingTableColumn().setModelIndex(pColNo); } /** * Return the column in the current table model corresponding to this column. * @return The model column. * @since 4.4 */ public EfiColumn getModelColumn() { return getTable().getTableModel().getColumn(getModelColNo()); } /** * Test if this column is part of the primary. * @return true if the column is part of the primary key. * @see #getIdentificationLevel * @since 4.0 */ public boolean isPrimaryKey() { return getIdentificationLevel() == EfiColumn.IDL_Primary; } /** * Specify if this column is part of the primary key. * @param pPrimaryKey true if the column is part of the primary key. * @see #setIdentificationLevel * @since 4.0 */ public void setPrimaryKey(boolean pPrimaryKey) { setIdentificationLevel(EfiColumn.IDL_Primary); } /** * Test if this column is user resizable. * @return true if the column is resizable. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Resizable", shortDescription="Resizable by the user.", preferred=true) public boolean isResizable() { return itsResizable; } /** * Specify if this column should be user resizable. * @param pResizable true if the column should be resizable. * @since 4.0 */ public void setResizable(boolean pResizable) { if (itsResizable == pResizable) return; itsResizable = pResizable; refreshDesignTimeRendering(); } /** * Return the secondary sort column. * @return The column, or null. * @see DoiTable#sortByColumn(DoiTableColumn) * @since 4.0 */ @EfiJavaBeanProperty( displayName="Secondary Sort Column", shortDescription="The column used for secondary sort order when sorting the table on this column.", preferred=true) public DoiTableColumn getSecondarySortColumn() { return itsSecondarySortColumn; } /** * Set the secondary sort column. * @param pColumn The column. * @since 4.0 */ public void setSecondarySortColumn(DoiTableColumn pColumn) { itsSecondarySortColumn = pColumn; } /** * Test if this the user is allowed to sort the table on this column. * @return true if the column is sortable. * @since 4.4 */ @EfiJavaBeanProperty( displayName="Sortable", shortDescription="Sortable by the user.", preferred=true) public boolean isSortable() { return itsSortable; } /** * Specify if the user is allowed to sort the table on this column. * @param pSortable true if the column should be sortable. * @since 4.4 */ public void setSortable(boolean pSortable) { if (itsSortable == pSortable) return; itsSortable = pSortable; refreshDesignTimeRendering(); } /** * Set the state. Overridden to make the table dirty when the column becomes dirty due to editing of a cell. * @param pState The new state. * @return true if the state was changed. * @since 4.2 */ @Override public boolean setState(int pState) { if (!super.setState(pState)) return false; if (pState == DIRTY) itsTable.setState(DIRTY); return true; } /** * Return the table column that is based on this template component, for inclusion * in a JTable. * @return The column within the actual table view. * @since 4.0 */ public TableColumn getSwingTableColumn() { if (itsSwingTableColumn == null) itsSwingTableColumn = createSwingTableColumn(); return itsSwingTableColumn; } /** * Return the table containing this column. * @return The parent table. * @since 4.0 */ public DoiTable getTable() { return itsTable; } /** * Set the table containing this column. Invoked by the table when its internal * column container is committed. * @param pTable The parent table. * @since 4.0 */ protected void setTable(DoiTable pTable) { itsTable = pTable; } /** * Return the innermost ancestor view of the specified type. * Overridden to use the table as the reference component. * @param pClass The view type. * @since 4.3 */ @Override @SuppressWarnings("unchecked") public T getAncestorView(Class pClass) { return (T)SwingUtilities.getAncestorOfClass(pClass, getTable()); } /** * Install a handler for {@link #toolTipText}. * @param pHandler The handler. * @see #removeTableCellTooltipEventListener * @since 4.4 */ @EfiJavaBeanEvent( displayName="Handler for tooltipText", shortDescription="Handler invoked when a cell tooltip is beig retrieved.") public void addTableCellTooltipEventListener(DoiTableCellTooltipEventListener pHandler) { getSupport().addHandlerEventListener("tooltipText", pHandler); } /** * Uninstall a handler for {@link #toolTipText}. * @param pHandler The handler. * @see #addTableCellTooltipEventListener * @since 4.4 */ public void removeTableCellTooltipEventListener(DoiTableCellTooltipEventListener pHandler) { getSupport().removeHandlerEventListener("tooltipText", pHandler); } /** * Test if this column has a value. * This is a quick test that simply checks if anything is typed into the cell. * @since 4.4 */ @Override public boolean hasValue() { return getValue() != null; } /** * Return the current value. The type of the value depends on the value class. * @return The value. * @since 4.0 */ @Override public Object getValue() { if (itsTable == null) return null; int rowNo = itsTable.getContextRowNo(); EfiTableModel tableModel = itsTable.getTableModel(); if (rowNo < 0 || rowNo >= tableModel.getRowCount()) return null; return tableModel.getValueAt(rowNo, getModelColNo()); } /** * Set the value. The accepted types depend on the value class. Overridden to * ensure that the value is propagated to the context row of the table model. * @param pValue The new value or null. * @param pState The new state. See {@link DoiComponent#setValue}. * @param pCausedByEvent The event that caused this change, or null. * @see #setValueClass * @since 4.0 */ @Override protected void setValue(Object pValue, int pState, EventObject pCausedByEvent) { // Check if this value change is caused by a table model change. // If it is, we don't want propagation. if (!(pCausedByEvent instanceof TableModelEvent)) { // Propagate to table model after some sanity checks. if (itsTable != null) { int rowNo = itsTable.getContextRowNo(); EfiTableModel tableModel = itsTable.getTableModel(); if (rowNo >= 0 && rowNo < tableModel.getRowCount()) { boolean silent = itsTable.getSupport().setSilentTemp(true); try { tableModel.setValueAt(rowNo, getModelColNo(), pValue); } finally { itsTable.getSupport().setSilentTemp(silent); } if (!itsTable.isSilent()) getSupport().fireValueChanged(this, pCausedByEvent, pState); if (pState > itsTable.getState()) itsTable.setState(pState); } } } super.setValue(pValue, pState, pCausedByEvent); } /** * Set the class of values accepted and returned by this field. Overridden to * update the horizontal alignment of the label. * @param pClass The value class. * @since 4.0 */ @Override public void setValueClass(Class pClass) { super.setValueClass(pClass); getJLabel().setHorizontalAlignment(getHorizontalAlignmentUsed()); } /** * Return the preferred visible width in pixels, or 0 to use a calculated width based on the visible length * and font size. * @return The width, or 0 to use the VisibleLength property. * @see DoiTextField#getVisibleLength * @since 4.0 */ @EfiJavaBeanProperty( displayName="Visible Width", shortDescription="Visible width in pixels, or 0 to use Visible Length.", preferred=true) public int getVisibleWidth() { return itsVisibleWidth; } /** * Set the preferred visible width in pixels to use instead of a calculated width based on the visible length * and font size. * @param pWidth The width, or 0 to use the VisibleLength propoerty. * @since 4.0 */ public void setVisibleWidth(int pWidth) { itsVisibleWidth = pWidth; } //////////////////////////////////////////////////////////////////////////////// // Operations. /** * Adjust the width values of the column based on the specified character width. * @param pCharWidth The character width in pixels. * @since 4.0 */ protected void adjustWidths(int pCharWidth) { TableColumn swingColumn = getSwingTableColumn(); int width = columnWidths(pCharWidth); if (isLocked() || !isResizable()) { swingColumn.setMinWidth(width); swingColumn.setMaxWidth(width); swingColumn.setResizable(false); } swingColumn.setWidth(width); swingColumn.setPreferredWidth(width); } /** * Add this column to the specified column model. * @param pColumnModel The column model used by the Swing table view. * @since 4.0 */ protected void addToColumnModel(TableColumnModel pColumnModel) { itsViewColNo = pColumnModel.getColumnCount(); pColumnModel.addColumn(getSwingTableColumn()); } /** * Calculate the width value based based on the specified character width. * If the preferred size has been explicitly set, the character width is * ignored. * @param pCharWidth The character width in pixels. * @return The width in pixels. * @since 4.0 */ protected int columnWidths(int pCharWidth) { if (isPreferredSizeSet()) return getPreferredSize().width; else if (getVisibleWidth() != 0) return getVisibleWidth(); else return getVisibleLength()*pCharWidth; } /** * Configure a column model from this column component. Invoked when the column * container is converted to actual table views. * @param pColumn The column in the table model that is configured. * @since 4.0 */ public void configureColumnModel(EfiColumn pColumn) { pColumn.setName(getName()); pColumn.setEditable(isEditable()); pColumn.setIdentificationLevel(getIdentificationLevel()); pColumn.setLabelText(getLabelText()); pColumn.setValueClass(getValueClass()); if (isHidden()) pColumn.setVisibleLength(0); else pColumn.setVisibleLength(getVisibleLength()); } /** * Configure this column component from a column model. Invoked when the column * container is built from an existing column list. * @param pColumn The column in the column list. * @since 4.0 */ public void configureColumnView(EfiColumn pColumn) { setName(pColumn.getName()); setLabelText(pColumn.getLabelText()); setReadOnly(!pColumn.isEditable()); setIdentificationLevel(pColumn.getIdentificationLevel()); setValueClass(pColumn.getValueClass()); int w = pColumn.getVisibleLength(); if (w != -1) if (w == 0) setHidden(true); else setVisibleLength(w); } /** * Configure a text field from this column component. Invoked when a text field * needs to reflect a column. * @param pTextField The text field to be configured. * @since 4.0 */ public void configureTextField(DoiTextField pTextField) { pTextField.setName(getName()); pTextField.setReadOnly(isReadOnly()); pTextField.setLabelText(getLabelText()); pTextField.setValueClass(getValueClass()); pTextField.setVisibleLength(getVisibleLength()); pTextField.setHidden(isHidden()); } /** * Create and return a date selection dialog. * Overridden to use the cell editor component as the owner. * @return The dialog. * @since 4.0 */ @Override protected DoiDateDialog createDateDialog() { Object value; Component editor = itsTable.getCellEditorComponent(); if (editor != null) value = itsTable.getCellEditor().getCellEditorValue(); else value = getValue(); int rowNo = getTable().getContextRowNo(); if (rowNo == -1) rowNo = 0; int colNoModel = getSwingTableColumn().getModelIndex(); DoiTable.TableView tv = isLocked() ? itsTable.getLockedTableView() : itsTable.getScrolledTableView(); Rectangle rc = tv.getCellRect(rowNo, itsViewColNo, true); return new DoiDateDialog(tv, new Point(rc.x, rc.y+rc.height), getLabelText(), (Date)value); } /** * Create and return a lookup dialog. * Overridden to use the cell editor component as the owner. * @param pTableModel The table model containing the lookup result. * @return The dialog. * @since 4.0 */ @Override protected DoiLookupDialog createLookupDialog(EfiTableModel pTableModel) { Object value; Component editor = itsTable.getCellEditorComponent(); if (editor != null) value = itsTable.getCellEditor().getCellEditorValue(); else value = getValue(); int rowNo = getTable().getContextRowNo(); if (rowNo == -1) rowNo = 0; int colNoModel = getSwingTableColumn().getModelIndex(); DoiTable.TableView tv = isLocked() ? itsTable.getLockedTableView() : itsTable.getScrolledTableView(); Rectangle rc = tv.getCellRect(rowNo, itsViewColNo, true); return new DoiLookupDialog(tv, new Point(rc.x, rc.y+rc.height), getLabelText(), pTableModel, getLookupSchemaNameEffective(), value); } /** * Create a table column that is based on this template component, for inclusion * in a JTable. * @return The new column to use within the actual table view. * @since 4.0 */ protected TableColumn createSwingTableColumn() { TableColumn swingColumn = new TableColumn(); swingColumn.setHeaderValue(getJLabel().getText()); swingColumn.setResizable(itsResizable); // Set up the renderer. if (itsCellRenderer != null) { swingColumn.setCellRenderer(itsCellRenderer); } else if (isDropDown()) { swingColumn.setCellRenderer(new DoiTableCellDropDownRenderer(this)); } else if (itsTable.getTreeLabelColumn() == this) { swingColumn.setCellRenderer(new DoiTreeTableCellRenderer(this)); } else if (getValueClass() != Boolean.class && getFormatter() != null) { swingColumn.setCellRenderer(new DoiTableCellRenderer(this)); } // Set up the editor. if (isDropDown()) { swingColumn.setCellEditor(new DoiTableCellDropDownEditor(this, getJComboBox())); } else if (itsTable.getTreeLabelColumn() == this) { } else if (getValueClass() != Boolean.class) { JTextComponent tc = getJTextComponent(); if (tc instanceof JFormattedTextField) swingColumn.setCellEditor(new DoiTableCellEditor(this, (JFormattedTextField)tc)); } return swingColumn; } /** * Invoked when editing is finished. Handles automatic lookup. * @param pOldValue The old value. * @param pNewValue The new value. * @since 4.0 * @changed 4.3 */ public void editingStopped(DoiTable.TableView pTableView, Object pOldValue, Object pNewValue) { if (isLookupAutomatic()) { int style = DoiLookupEvent.LOOKUP_NoChoice; if (pTableView.isShowing()) style = DoiLookupEvent.LOOKUP_ChooseNotNull; if (pNewValue != null ? !pNewValue.equals(pOldValue) : pOldValue != null) { try { DoiApplication.instance().waitCursorOn(); lookup(style); } finally { DoiApplication.instance().waitCursorOff(); } } } } /** * Fire a value changed event. Invoked by the edit listener. Overridden to set the context row. * @param pEvent The document event. * @since 4.4 */ @Override public void fireValueChanged(DocumentEvent pEvent) { if (itsTable != null) { int rowNo = itsTable.getEditingRowNo(); if (rowNo != -1) itsTable.setContextRowNo(rowNo); } super.fireValueChanged(pEvent); } /** * Fire a value changed event. Invoked by the edit listener. Overridden to set the context row. * @param pEvent The item event. * @since 4.4 */ @Override public void fireValueChanged(ItemEvent pEvent) { int rowNo = itsTable.getEditingRowNo(); if (rowNo != -1) itsTable.setContextRowNo(rowNo); super.fireValueChanged(pEvent); } /** * Invoked by {@link DoiTextField#focusLost} when the inner component loses focus. * Overridden to do nothing, since lookup is handled by {@link #editingStopped}. * @param pEvent The focus event. * @since 4.3 */ @Override public void focusLostLookup(FocusEvent pEvent) { } /** * Invoked by {@link DoiTextField#focusGained} to select the text. Overridden to do nothing. * @param pEvent The focus event. * @since 4.1 */ @Override protected void focusSelect(FocusEvent pEvent) { final JTextComponent tc = getJTextComponent(); if (tc != null) { SwingUtilities.invokeLater(new Runnable() { public void run() { String text = tc.getText(); tc.setCaretPosition(text.length()); } }); } } /** * Invoked by a {@link DoiOpenWithAction} when the action is performed. * Builds an object key or a selection criteria using the selected value or * values and delegates to {@link DoiBinder#openObjectView} or * {@link DoiBinder#openSelectionView}. * @param pAction The action. * @param pEvent The action event. * @throws IOException If an I/O error occurs. * @since 4.0 */ @Override public void openWith(DoiOpenWithAction pAction, ActionEvent pEvent) throws IOException { int[] rowNos = itsTable.getSelectedRowNos(); if (rowNos.length == 1) { itsTable.setContextRowNo(rowNos[0]); super.openWith(pAction, pEvent); return; } EfiTableModel model = itsTable.getTableModel(); int colNo = getModelColNo(); List valueList = new ArrayList(rowNos.length); for (int i = 0; i < rowNos.length; ++i) { Object value = model.getValueAt(rowNos[i], colNo); if (value != null) valueList.add(value); } DoiBinder binder = pAction.getBinder(); binder.openWithSelectionView(pAction.getSchemaName(), getValueClass(), valueList); } /** * Set the font style based on column properties, if in design time mode. Used * to visually reflect various properties in the GUI painter. * @return true if design time and not custom editor. * @since 4.0 */ @Override protected boolean refreshDesignTimeRendering() { if (!super.refreshDesignTimeRendering()) return false; JLabel label = getJLabel(); if (label == null) return true; Font font = UIManager.getFont("TableHeader.font"); int style = 0; if (isHidden()) style |= Font.ITALIC; if (itsIdentificationLevel == EfiColumn.IDL_Primary) style |= Font.BOLD; font = font.deriveFont(style); label.setFont(font); return true; } /** * Return the tooltip text for the specified column. Invoked by {@link DoiTable#toolTipText(DoiTable.TableView, int, int, int)}. * If the cell renderer is a {@link DoiTableCellRenderer} it is asked to {@linkplain DoiTableCellRenderer#renderValue render} the value. * If not, the table's {@link DoiTable#toolTipText(int, int)} is called, which returns the string representation * of the cell value. * Then any installed handler is invoked. * @param pTableView The table view. * @param pRowNo The 0-based row number. * @param pModelColNo The 0-based column number withing the table model. * @param pViewColNo The 0-based column number withing the table model. * @return The text, or null. * @since 4.4 */ public String toolTipText(DoiTable.TableView pTableView, int pRowNo, int pModelColNo, int pViewColNo) { TableCellRenderer renderer = getCellRendererEffective(); String tooltip = null; if (renderer instanceof DoiTableCellRenderer) { Object value = itsTable.getTableModel().getValueAt(pRowNo, pModelColNo); Object rv = ((DoiTableCellRenderer)renderer).renderValue(value); if (rv != null) tooltip = rv.toString(); } else { tooltip = itsTable.toolTipText(pRowNo, pModelColNo); } DoiTableCellTooltipEventListener handler = (DoiTableCellTooltipEventListener)getSupport().getHandlerEventListener("tooltipText"); DoiTableCellTooltipEvent event = null; if (handler != null) { event = new DoiTableCellTooltipEvent(pTableView, pRowNo, pModelColNo, pViewColNo, tooltip); int cr = itsTable.getContextRowNo(); try { itsTable.setContextRowNo(pRowNo); handler.cellTooltip(event); } finally { itsTable.setContextRowNo(cr); } tooltip = event.getTooltip(); } return tooltip; } } ----- Tree: ------------------------------------------------------- public EfiColumn getModelColumn() { return getTable().getTableModel().getColumn(getModelColNo()); } at org.netbeans.modules.java.source.usages.RepositoryUpdater.couplingAbort(RepositoryUpdater.java:3142) at org.netbeans.modules.java.source.TreeLoader.loadTreeFor(TreeLoader.java:103) at com.sun.tools.javac.model.JavacElements.getTreeAndTopLevel(JavacElements.java:627) at com.sun.tools.javac.model.JavacElements.getTreeAndTopLevel(JavacElements.java:653) at com.sun.tools.javac.api.JavacTrees.getPath(JavacTrees.java:168) at com.sun.tools.javac.api.JavacTrees.getPath(JavacTrees.java:160) at org.netbeans.modules.editor.java.GoToSupport$1.run(GoToSupport.java:245) at org.netbeans.modules.editor.java.GoToSupport$1.run(GoToSupport.java:132) at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:613) at org.netbeans.modules.editor.java.GoToSupport.performGoTo(GoToSupport.java:131) at org.netbeans.modules.editor.java.GoToSupport.goTo(GoToSupport.java:296) at org.netbeans.modules.java.editor.hyperlink.JavaHyperlinkProvider.performClickAction(JavaHyperlinkProvider.java:79) at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.performAction(HyperlinkOperation.java:253) at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.mouseClicked(HyperlinkOperation.java:396) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252) at java.awt.Component.processMouseEvent(Component.java:6041) at javax.swing.JComponent.processMouseEvent(JComponent.java:3260) at java.awt.Component.processEvent(Component.java:5803) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4410) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3995) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916) at java.awt.Container.dispatchEventImpl(Container.java:2102) at java.awt.Window.dispatchEventImpl(Window.java:2429) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) INFO [org.netbeans.modules.editor.settings.storage.SettingsProvider]: Won't provide any settings for text/base It's been deprecated, use MimePath.EMPTY instead. INFO [org.netbeans.modules.java.source.usages.RepositoryUpdater] com.sun.tools.javac.util.CouplingAbort at com.sun.tools.javac.comp.MemberEnter.visitVarDef(MemberEnter.java:711) at com.sun.tools.javadoc.JavadocMemberEnter.visitVarDef(JavadocMemberEnter.java:79) at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:714) at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:416) at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:428) at com.sun.tools.javac.comp.MemberEnter.finishClass(MemberEnter.java:438) at com.sun.tools.javac.comp.MemberEnter.finish(MemberEnter.java:1112) at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:1079) at com.sun.tools.javac.code.Symbol.complete(Symbol.java:402) at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:785) at com.sun.tools.javac.comp.Enter.complete(Enter.java:581) at org.netbeans.api.java.source.JavaSource$ErrorHandlingJavadocEnter.main(JavaSource.java:1141) at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:840) at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:357) at org.netbeans.modules.java.source.TreeLoader.loadTreeFor(TreeLoader.java:99) Caused: java.lang.AssertionError: Coupling error: class file file:/home/gugrim/.netbeans/6.0rc1/var/cache/index/0.7/s1/classes/se/grim/doi/widget/DoiTable.sig, source file file:/home/gugrim/projects/DOISuite4/trunk/DOI4/src/se/grim/doi/widget/DoiTable.java ----- Sig file content: ------------------------------------------- GM1;Nse.grim.doi.widget.DoiTable;;Lse.grim.doi.widget.DoiLabeledComponent;Lse.grim.doi.controller.DoiObjectBrowsable;;NColumnContainer;Mc;NRowSelectionListener;M4;NMouseController;M4;NTableView;M1;NCellFocusListener;M2;NDndTarget;M2;; AM19;REfiComparator;NCELLCOMP;X;; AM40009;Ljava.lang.String;NPROPERTY_ContextRowNo;X;; AM40009;Ljava.lang.String;NPROPERTY_SelectedRowNo;X;; AM40009;Ljava.lang.String;NPROPERTY_RowDeleteAllowed;X;; AM40009;Ljava.lang.String;NPROPERTY_RowInsertAllowed;X;; AM40009;Ljava.lang.String;NPROPERTY_RowMoveAllowed;X;; AM40002;ZNitsChangedRowsEdited;X;; AM2;Lse.grim.doi.widget.DoiTable$ColumnContainer;NitsColumnContainer;X;; AM2;[Lse.grim.doi.widget.DoiTableColumn;NitsColumns;X;; AM2;[Lse.grim.doi.widget.DoiTableColumn;NitsColumnsByModelColNo;X;; AM2;Ljava.util.Map;NitsColumnMap;X;; AM40002;INitsContextRowNo;X;; AM40002;ZNitsDeletedRowsReadOnly;X;; AM2;Lse.grim.doi.widget.DoiTableDetailPanel;NitsDetailPanel;X;; AM2;ZNitsFocusIndicator;X;; AM40002;ZNitsFocusCyclicWhenEditable;X;; AM40002;ZNitsFocusCyclicWhenReadOnly;X;; AM2;Lse.grim.doi.widget.DoiTableColumn;NitsInitialSortColumn;X;; AM2;Ljava.lang.String;NitsKeyColumnBinderName;X;; AM2;Lse.grim.doi.widget.DoiTable$MouseController;NitsMouseController;X;; AM2;Lse.grim.doi.widget.DoiTableColumn;NitsTreeKeyColumn;X;; AM2;Lse.grim.doi.widget.DoiTableColumn;NitsTreeLabelColumn;X;; AM2;Lse.grim.doi.widget.DoiTableColumn;NitsTreeParentColumn;X;; AM2;ZNitsSingleSelect;X;; AM2;ZNitsRowActivateSupported;X;; AM2;ZNitsRowDeleteAllowed;X;; AM2;ZNitsRowInsertAllowed;X;; AM2;ZNitsRowMoveAllowed;X;; AM2;Ljava.lang.String;NitsRowName;X;; AM2;Lse.grim.doi.widget.DoiTable$RowSelectionListener;NitsRowSelectionListener;X;; AM40002;INitsSelectedRowNo;X;; AM40002;ZNitsSortAllowed;X;; AM2;Lse.grim.doi.widget.DoiTableColumn;NitsSortColumn;X;; AM2;ZNitsSortDescending;X;; AM2;Ljavax.swing.event.TableModelListener;NitsTableModelListener;X;; AM40002;INitsVisibleRowCount;X;; AM40002;ZNitsVisibleRowFlags;X;; AM40002;ZNitsVisibleColumnHeader;X;; AM40002;Ljava.awt.Dimension;NitsIntercellSpacing;X;; AM2;Lse.grim.doi.widget.DoiTable$TableView;NitsLockedTableView;X;; AM2;Lse.grim.doi.widget.DoiTable$TableView;NitsScrolledTableView;X;; AM2;ZNitsSingleClickRowActivationSuppressed;X;; AM2;Ljavax.swing.JScrollPane;NitsScrollPane;X;; AM2;REfiTableModel;NitsTableModel;X;; AM40002;ZNitsVisibleHorizontalLines;X;; AM40002;ZNitsVisibleVerticalLines;X;; EM1;N;()()V;; EM1;N;(M200000000;REfiTableModel;NpTableModel;)()V;; EM1;NaddCanPasteEventListener;(M200000000;Lse.grim.doi.event.DoiCanPasteEventListener;NpHandler;)()VR;;;; EM1;NremoveCanPasteEventListener;(M200000000;Lse.grim.doi.event.DoiCanPasteEventListener;NpHandler;)()V;; EM1;NisCellEditable;(M200000000;Lse.grim.doi.widget.DoiTable$TableView;NpTableView;M200000000;INpRowNo;M200000000;INpViewColNo;)()Z;; EM1;NgetCellEditor;()()Ljavax.swing.table.TableCellEditor;;; EM1;NgetCellEditorComponent;()()Ljava.awt.Component;;; EM1;NisChangedRowsEdited;()()ZR;;;; EM1;NsetChangedRowsEdited;(M200000000;ZNpFlagEdited;)()V;; EM1;NgetColumn;(M200000000;INpIndex;)()Lse.grim.doi.widget.DoiTableColumn;;; EM1;NgetColumnContainer;()()Ljavax.swing.JPanel;R;;;; EM1;NgetColumnCount;()()I;; EM1;NgetColumnByModelColNo;(M200000000;INpIndex;)()Lse.grim.doi.widget.DoiTableColumn;;; EM1;NgetColumnByViewColNo;(M200000000;Lse.grim.doi.widget.DoiTable$TableView;NpTableView;M200000000;INpViewColNo;)()Lse.grim.doi.widget.DoiTableColumn;;; EM1;NgetColumnClass;(M200000000;Lse.grim.doi.widget.DoiTable$TableView;NpTableView;M200000000;INpViewColNo;)()Ljava.lang.Class;;; EM1;NgetContextRowNo;()()I;; EM1;NsetContextRowNo;(M200000000;INpRowNo;)()V;; EM1;NisDeletedRowsReadOnly;()()ZR;;;; EM1;NsetDeletedRowsReadOnly;(M200000000;ZNpRO;)()V;; EM1;NgetDetailPanel;()()Lse.grim.doi.widget.DoiTableDetailPanel;R;;;; EM1;NsetDetailPanel;(M200000000;Lse.grim.doi.widget.DoiTableDetailPanel;NpDetailPanel;)()V;; EM1;NgetEditingColumn;()()Lse.grim.doi.widget.DoiTableColumn;;; EM1;NgetEditingRowNo;()()I;; EM1;NgetInitialSortColumn;()()Lse.grim.doi.widget.DoiTableColumn;R;;;; EM1;NsetInitialSortColumn;(M200000000;Lse.grim.doi.widget.DoiTableColumn;NpColumn;)()V;; EM1;NgetIntercellSpacing;()()Ljava.awt.Dimension;R;;;; EM1;NsetIntercellSpacing;(M200000000;Ljava.awt.Dimension;NpSpacing;)()V;; EM1;NgetKeyColumnBinderName;()()Ljava.lang.String;R;;;; EM1;NsetKeyColumnBinderName;(M200000000;Ljava.lang.String;NpBinderName;)()V;; EM1;NgetLockedTableView;()()Lse.grim.doi.widget.DoiTable$TableView;;; EM1;NgetObjectKey;(M200000000;INpRowNo;)()Lse.grim.doi.model.DoiObjectKey;;; EM1;NgetObjectKey;(M200000000;Lse.grim.doi.controller.DoiBinder;NpBinder;M200000000;INpRowNo;)()Lse.grim.doi.model.DoiObjectKey;;; EM1;NisFocusCyclicWhenEditable;()()ZR;;;; EM1;NsetFocusCyclicWhenEditable;(M200000000;ZNpCyclic;)()V;; EM1;NisFocusCyclicWhenReadOnly;()()ZR;;;; EM1;NsetFocusCyclicWhenReadOnly;(M200000000;ZNpCyclic;)()V;; EM1;NhasFocusIndicator;()()Z;; EM1;NaddObjectPasteEventListener;(M200000000;Lse.grim.doi.event.DoiObjectPasteEventListener;NpHandler;)()VR;;;; EM1;NremoveObjectPasteEventListener;(M200000000;Lse.grim.doi.event.DoiObjectPasteEventListener;NpHandler;)()V;; EM1;NisRowActivateSupported;()()ZR;;;; EM1;NsetRowActivateSupported;(M200000000;ZNpSupported;)()V;; EM1;NgetRowCount;()()I;; EM1;NisRowDeleteAllowed;()()ZR;;;; EM1;NsetRowDeleteAllowed;(M200000000;ZNpAllowed;)()V;; EM1;NisRowInsertAllowed;()()ZR;;;; EM1;NsetRowInsertAllowed;(M200000000;ZNpAllowed;)()V;; EM1;NisRowMoveAllowed;()()ZR;;;; EM1;NsetRowMoveAllowed;(M200000000;ZNpAllowed;)()V;; EM1;NgetRowName;()()Ljava.lang.String;R;;;; EM1;NsetRowName;(M200000000;Ljava.lang.String;NpRowName;)()V;; EM1;NgetScrolledTableView;()()Lse.grim.doi.widget.DoiTable$TableView;;; EM1;NgetSelectedObjectKey;()()Lse.grim.doi.model.DoiObjectKey;;; EM1;NgetSelectedObjectKeys;()()[Lse.grim.doi.model.DoiObjectKey;;; EM1;NgetSelectedRowCount;()()I;; EM1;NgetSelectedRowMap;()()REfiRowMap;;; EM1;NgetSelectedRowNo;()()I;; EM1;NgetSelectedRowNos;()()[I;; EM1;NsetSelectedColumn;(M200000000;Lse.grim.doi.widget.DoiTableColumn;NpColumn;)()V;; EM1;NsetSelectedRowNo;(M200000000;INpRowNo;)()V;; EM1;NisSingleClickRowActivationSuppressed;()()ZR;;;; EM1;NsetSingleClickRowActivationSuppressed;(M200000000;ZNpSupress;)()V;; EM1;NisSingleSelect;()()ZR;;;; EM1;NsetSingleSelect;(M200000000;ZNpSingleSelect;)()V;; EM1;NisSortAllowed;()()ZR;;;; EM1;NsetSortAllowed;(M200000000;ZNpAllowed;)()V;; EM1;NgetSortColumn;()()Lse.grim.doi.widget.DoiTableColumn;;; EM1;NsetSortColumn;(M200000000;Lse.grim.doi.widget.DoiTableColumn;NpColumn;)()V;; EM1;NisSortDescending;()()Z;; EM1;NsetSortDescending;(M200000000;ZNpDescending;)()V;; EM1;NsetState;(M200000000;INpState;)()ZLjava.lang.Override;;;; EM1;NgetTableModel;()()REfiTableModel;;; EM1;NsetTableModel;(M200000000;REfiTableModel;NpTableModel;)()V;; EM1;NgetStatusBar;()()Lse.grim.doi.widget.table.DoiTableStatusBar;;; EM1;NisStatusBarVisible;()()ZR;;;; EM1;NsetStatusBarVisible;(M200000000;ZNpVisible;)()V;; EM1;NaddTableCellEditableEventListener;(M200000000;Lse.grim.doi.event.DoiTableCellEditableEventListener;NpHandler;)()VR;;;; EM1;NremoveTableCellEditableEventListener;(M200000000;Lse.grim.doi.event.DoiTableCellEditableEventListener;NpHandler;)()V;; EM1;NaddTableCellRendererEventListener;(M200000000;Lse.grim.doi.event.DoiTableCellRendererEventListener;NpHandler;)()VR;;;; EM1;NremoveTableCellRendererEventListener;(M200000000;Lse.grim.doi.event.DoiTableCellRendererEventListener;NpHandler;)()V;; EM1;NaddTableCellTooltipEventListener;(M200000000;Lse.grim.doi.event.DoiTableCellTooltipEventListener;NpHandler;)()VR;;;; EM1;NremoveTableCellTooltipEventListener;(M200000000;Lse.grim.doi.event.DoiTableCellTooltipEventListener;NpHandler;)()V;; EM1;NaddTableRowActivationEventListener;(M200000000;Lse.grim.doi.event.DoiTableRowActivationEventListener;NpHandler;)()VR;;;; EM1;NremoveTableRowActivationEventListener;(M200000000;Lse.grim.doi.event.DoiTableRowActivationEventListener;NpHandler;)()V;; EM1;NaddTableRowSelectionEventListener;(M200000000;Lse.grim.doi.event.DoiTableRowSelectionEventListener;NpHandler;)()VR;;;; EM1;NremoveTableRowSelectionEventListener;(M200000000;Lse.grim.doi.event.DoiTableRowActivationEventListener;NpHandler;)()V;; EM1;NaddTableRowStateEventListener;(M200000000;Lse.grim.doi.event.DoiTableRowStateEventListener;NpHandler;)()VR;;;; EM1;NremoveTableRowStateEventListener;(M200000000;Lse.grim.doi.event.DoiTableRowStateEventListener;NpHandler;)()V;; EM1;NgetTreeKeyColumn;()()Lse.grim.doi.widget.DoiTableColumn;R;;;; EM1;NsetTreeKeyColumn;(M200000000;Lse.grim.doi.widget.DoiTableColumn;NpColumn;)()V;; EM1;NgetTreeLabelColumn;()()Lse.grim.doi.widget.DoiTableColumn;R;;;; EM1;NsetTreeLabelColumn;(M200000000;Lse.grim.doi.widget.DoiTableColumn;NpColumn;)()V;; EM1;NgetTreeParentColumn;()()Lse.grim.doi.widget.DoiTableColumn;R;;;; EM1;NsetTreeParentColumn;(M200000000;Lse.grim.doi.widget.DoiTableColumn;NpColumn;)()V;; EM1;NgetValue;(M200000000;ZNpChangesOnly;)()Ljava.lang.Object;;; EM1;NsetValue;(M200000000;Ljava.lang.Object;NpValue;M200000000;INpState;)()V;; EM4;NnewCopy;(M200000000;REfiTableModel;NpTableModel;)()V;; EM4;NnewCopyRow;(M200000000;REfiTableModel;NpTableModel;M200000000;INpRowNo;M200000000;Ljava.util.List;NpClearedColNos;)()V;; EM1;NgetValueClass;()()Ljava.lang.Class;;; EM1;NsetValueClass;(M200000000;Ljava.lang.Class;NpClass;)(Ljava.lang.IllegalArgumentException;)V;; EM1;NgetVisibleRowCount;()()IR;;;; EM1;NsetVisibleRowCount;(M200000000;INpRowCount;)()V;; EM1;NisVisibleRowFlags;()()ZR;;;; EM1;NsetVisibleRowFlags;(M200000000;ZNpVisible;)()V;; EM1;NisVisibleColumnHeader;()()ZR;;;; EM1;NsetVisibleColumnHeader;(M200000000;ZNpVisible;)()V;; EM1;NisVisibleHorizontalLines;()()ZR;;;; EM1;NsetVisibleHorizontalLines;(M200000000;ZNpShow;)()V;; EM1;NisVisibleVerticalLines;()()ZR;;;; EM1;NsetVisibleVerticalLines;(M200000000;ZNpShow;)()V;; EM1;NgetZonked;()()Ljava.lang.String;R;;;; EM1;NaddNotify;()()VLjava.lang.Override;;;; EM1;NcanCopyObjects;()()Lse.grim.doi.controller.DoiObjectCopyInfo;Ljava.lang.Override;;;; EM1;NcanPasteObjects;(M200000000;Lse.grim.doi.controller.DoiObjectClipboard;NpClipboard;)()ZLjava.lang.Override;;;; EM1;NcommitColumnContainer;()()V;; EM1;NcommitColumnContainer;(M200000000;ZNpForce;)()V;; EM1;NcommitEdits;()()VLjava.lang.Override;;;; EM1;NcontextMenuRequested;(M200000000;Ljava.awt.event.InputEvent;NpEvent;)()Lse.grim.doi.action.DoiActionList;Ljava.lang.Override;;;; EM1;NcopyObjects;(M200000000;Lse.grim.doi.controller.DoiObjectClipboard;NpClipboard;)(Ljava.io.IOException;)VLjava.lang.Override;;;; EM4;NcreateActionSet;()()Lse.grim.doi.action.DoiActionSet;Ljava.lang.Override;;;; EM1;NcreateColumnModelList;()()REfiColumnList;;; EM4;NcreateTableView;(M200000000;Ljavax.swing.table.TableColumnModel;NpColumnModel;M200000000;ZNpLocked;)()Lse.grim.doi.widget.DoiTable$TableView;;; EM1;NcreateTableModel;()()REfiTableModel;;; EM4;NcreateToolBarActionList;()()Lse.grim.doi.action.DoiActionList;Ljava.lang.Override;;;; EM1;NdoActionRowActivate;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)()V;; EM1;NdoActionEditRowDelete;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)()V;; EM1;NdoActionEditRowInsert;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)()V;; EM1;NdoActionEditRowInsertAfter;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)()V;; EM1;NdoActionEditRowInsertBefore;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)()V;; EM1;NdoActionEditRowMoveDown;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)()V;; EM1;NdoActionEditRowMoveUp;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)()V;; EM1;NdoActionLookup;(M200000000;Ljava.awt.event.ActionEvent;NpEvent;)()V;; EM4;NeditableStateChanged;(M200000000;ZNpEditable;)()VLjava.lang.Override;;;; EM1;NeditingStarted;(M200000000;Lse.grim.doi.widget.DoiTable$TableView;NpTableView;M200000000;INpColNo;)()V;; EM1;NeditingStopped;(M200000000;Lse.grim.doi.widget.DoiTable$TableView;NpTableView;)()V;; EM1;NfindObjectRowNo;(M200000000;Lse.grim.doi.model.DoiObjectKey;NpObjectKey;)()I;; EM1;NfindObjectRowNo;(M200000000;Lse.grim.doi.controller.DoiBinder;NpBinder;M200000000;Lse.grim.doi.model.DoiObjectKey;NpObjectKey;)()I;; EM1;NfindObjectRowNo;(M200000000;Lse.grim.doi.controller.DoiBinder;NpBinder;M200000000;INpStartRowNo;M200000000;INpBrowseDir;)()I;; EM1;NfindRowNo;(M200000000;REfiValueMap;NpValueMap;)()I;; EM1;NfindRowNo;(M200000000;Ljava.lang.String;NpColumnName;M200000000;Ljava.lang.Object;NpValue;)()I;; EM1;NfocusGained;(M200000000;Ljava.awt.event.FocusEvent;NpEvent;)()VLjava.lang.Override;;;; EM1;NfocusLost;(M200000000;Ljava.awt.event.FocusEvent;NpEvent;)()VLjava.lang.Override;;;; EM1;NshowFocus;(M200000000;ZNpFocus;)()V;; EM1;NinsertAndEditRow;(M200000000;INpRowNo;)()V;; EM1;NmoveSelectedRows;(M200000000;ZNpDown;)()Z;; EM1;NpasteObjects;(M200000000;Lse.grim.doi.controller.DoiObjectClipboard;NpClipboard;)(Ljava.io.IOException;)VLjava.lang.Override;;;; EM4;NprepareCellRenderer;(M200000000;Lse.grim.doi.widget.DoiTable$TableView;NpTableView;M200000000;Ljavax.swing.table.TableCellRenderer;NpRenderer;M200000000;Ljava.awt.Component;NpComponent;M200000000;INpRowNo;M200000000;INpViewColNo;)()V;; EM1;NrefreshActionState;()()VLjava.lang.Override;;;; EM1;NrefreshLookupIndicator;()()V;; EM1;NrefreshStatusBar;()()V;; EM1;NrowActivated;(M200000000;INpRowNo;M200000000;Ljava.awt.event.ActionEvent;NpEvent;)()V;; EM4;NrowSelected;(M200000000;Ljavax.swing.event.ListSelectionEvent;NpEvent;)()V;; EM1;NscrollRowToVisible;(M200000000;INpRowNo;)()V;; EM4;NsetupTableViews;()()V;; EM1;Nsort;(M200000000;[Ljava.lang.String;NpColumnNames;M200000000;[ZNpDescending;)()V;; EM1;NsortByColumn;(M200000000;Lse.grim.doi.widget.DoiTableColumn;NpColumn;)()Z;; EM4;NtableChanged;(M200000000;Ljavax.swing.event.TableModelEvent;NpEvent;)()V;; EM1;NtoolTipText;(M200000000;Lse.grim.doi.widget.DoiTable$TableView;NpTableView;M200000000;Ljava.awt.event.MouseEvent;NpEvent;)()Ljava.lang.String;;; EM1;NtoolTipText;(M200000000;INpRowNo;M200000000;INpColNo;)()Ljava.lang.String;;; EM1;NtoolTipText;(M200000000;Lse.grim.doi.widget.DoiTable$TableView;NpTableView;M200000000;INpRowNo;M200000000;INpModelColNo;M200000000;INpViewColNo;)()Ljava.lang.String;;; EM1;NvalidateValue;()(Lse.grim.doi.controller.DoiValidationException;Ljava.io.IOException;)VLjava.lang.Override;;;; WR;;; ----- Source file content: ---------------------------------------- package se.grim.doi.widget; import java.awt.*; import java.awt.dnd.*; import java.awt.event.*; import java.beans.Beans; import java.io.*; import java.text.*; import java.util.*; import java.util.List; import javax.swing.*; import javax.swing.border.*; import javax.swing.border.Border; import javax.swing.event.*; import javax.swing.plaf.UIResource; import javax.swing.table.*; import se.grim.doi.action.*; import se.grim.doi.controller.*; import se.grim.doi.event.*; import se.grim.doi.model.*; import se.grim.doi.security.*; import se.grim.doi.util.*; import se.grim.doi.view.*; import se.grim.doi.widget.table.*; import se.grim.doi.widget.table.DoiRowFlagsRenderer; import se.grim.effie.apt.beaninfo.*; import se.grim.effie.table.*; import se.grim.effie.table.EfiTableModel; import se.grim.effie.value.*; import se.grim.effie.util.*; /** * A table for displaying and optionally editing an {@link EfiTableModel}. * During GUI design, the table looks and behaves as a container for {@linkplain * DoiTableColumn table columns} to allow the designer to easily add columns and * set properties for them. During runtime, these columns are used to create real * table views, and the column container is detached from the table. The column * objects are still very much alive and can be used to access and update cell * values. The table model row affected by such operations are known as the * {@linkplain #getContextRowNo context row}, which is set automatically when the * user selects a row or starts editing a cell. The context row can also be set * programmatically. * *

Row activation

> * When a row is activated, either though double click or the Enter key, the action * RowActivate is executed. This action is part of the action set for the table * but has initially no handler. If the view using this table need to be notified, it * should install iself as a handler and call {@link #setRowActivateSupported}. * * @author Copyright © Gunnar Grim * @since 4.0 * @version 4.4 */ @EfiJavaBean( displayName="Table", shortDescription="Table with rows and columns.", isContainer=true, defaultProperty="name", iconBase="beanicons/Table") public class DoiTable extends DoiLabeledComponent implements DoiObjectBrowsable { //////////////////////////////////////////////////////////////////////////////// // Constants and variables. /** * Default cell comparator. * @since 4.4 */ public static final EfiComparator CELLCOMP; static { CELLCOMP = EfiComparator.forCells(EfiComparator.Option.Localized, EfiComparator.Option.Natural); CELLCOMP.setImmutable(); } /** * Property name for the bound "contextRowNo" property. * @since 4.0 */ public static String PROPERTY_ContextRowNo = "contextRowNo"; /** * Property name for the bound "selectedRowNo" property. * @since 4.0 */ public static String PROPERTY_SelectedRowNo = "selectedRowNo"; /** * Property name for the bound "rowDeleteAllowed" property. * @since 4.0 */ public static String PROPERTY_RowDeleteAllowed = "rowDeleteAllowed"; /** * Property name for the bound "rowInsertAllowed" property. * @since 4.0 */ public static String PROPERTY_RowInsertAllowed = "rowInsertAllowed"; /** * Property name for the bound "rowMoveAllowed" property. * @since 4.0 */ public static String PROPERTY_RowMoveAllowed = "rowMoveAllowed"; /** * Indicates if changed rows should automatically be flagged as edited. */ private boolean itsChangedRowsEdited = true; /** * The column container used during design time. */ private ColumnContainer itsColumnContainer; /** * The columns used during runtime, in the order they were added. */ private DoiTableColumn[] itsColumns; /** * The list of {@link DoiTableColumn} instances used during runtime, * by model index. */ private DoiTableColumn[] itsColumnsByModelColNo; /** * The map of {@link DoiTableColumn} instances used during runtime, with the * symbolic component name of the column as the key. */ private Map itsColumnMap; /** * The row number of the context row. This is the row used when accessing values * through the table column components. It is set automatically before * change events are propagated to the column. */ private int itsContextRowNo = -1; /** * Indicates if deleted rows should be locked, i e not editable. */ private boolean itsDeletedRowsReadOnly = true; /** * The table detail panel used, or null. */ private DoiTableDetailPanel itsDetailPanel; /** * Indicates if the table focus indicator should be displayed. */ private boolean itsFocusIndicator; /** * Indicates if focus is cyclic within the table when it is editable. * Initially true. */ private boolean itsFocusCyclicWhenEditable = true; /** * Indicates if focus is cyclic within the table when it isn't editable. * Initially true. */ private boolean itsFocusCyclicWhenReadOnly = true; /** * The initial sort column. */ private DoiTableColumn itsInitialSortColumn; /** * The name of the binder that handles objects identified with the primary key column or columns. */ private String itsKeyColumnBinderName; /** * The controller for mouse events. */ private MouseController itsMouseController; /** * The column that holds the node key for the tree column, or null to use the row number. */ private DoiTableColumn itsTreeKeyColumn; /** * The column that holds the node label for the tree column, or null if no tree column is used. */ private DoiTableColumn itsTreeLabelColumn; /** * The column that holds the parent node key or row number for the tree column, or null. */ private DoiTableColumn itsTreeParentColumn; /** * Indicates if only a single row can be selected. */ private boolean itsSingleSelect; /** * Indicates if row activation using double click or Enter is supported. */ private boolean itsRowActivateSupported; /** * Indicates if rows can be marked for deletion by the user, if the table is editable. */ private boolean itsRowDeleteAllowed; /** * Indicates if rows can be inserted by the user, if the table is editable. */ private boolean itsRowInsertAllowed; /** * Indicates if rows can be moved by the user, if the table is editable. * Allowing this forbids sorting. */ private boolean itsRowMoveAllowed; /** * The symbolic name of a row. */ private String itsRowName; /** * The row selection listener for the table views. */ private RowSelectionListener itsRowSelectionListener; /** * The row number of the selected row. */ private int itsSelectedRowNo = -1; /** * Indicates if the table can be sorted by clicking on the column header. Ignored if row move is allowed. */ private boolean itsSortAllowed = true; /** * The column on which the table is currently sorted, or null. */ private DoiTableColumn itsSortColumn; /** * Indicates that the table is sorted in descending order. */ private boolean itsSortDescending; /** * The table model listener. */ private TableModelListener itsTableModelListener; /** * The preferred number of visible rows. */ private int itsVisibleRowCount = 10; /** * Indicates if column 0 of the table model, which is reserved for row flags, is * visible. */ private boolean itsVisibleRowFlags = true; /** * Indicates if the column header should be visible. */ private boolean itsVisibleColumnHeader = true; /** * The horizontal and vertical space between cells. The default spacing is (1, 1), * which provides room to draw the grid. */ private Dimension itsIntercellSpacing = new Dimension(1, 1); /** * The locked view. */ private TableView itsLockedTableView; /** * The horizontally scrollable view. */ private TableView itsScrolledTableView; /** * Indicates that single click row activation is not used even if selected as global application preferences. */ private boolean itsSingleClickRowActivationSuppressed; private JScrollPane itsScrollPane; private EfiTableModel itsTableModel; private boolean itsVisibleHorizontalLines = true; private boolean itsVisibleVerticalLines = true; //////////////////////////////////////////////////////////////////////////////// // Constructors. /** * Create a new empty table with a column container instead of a scroll pane with * table views. * This constructor is intended to be used by GUI builder code, that specifies the * table structure by adding columns to the column container. The table views are * created by {@link #commitColumnContainer} which is invoked by {@link #addNotify}. * @since 4.0 */ public DoiTable() { int padding = DoiComponentSupport.getPadding(); setBorder(BorderFactory.createEmptyBorder(padding, padding, padding, padding)); setFocusable(false); itsColumnContainer = new ColumnContainer(); setInnerComponent(itsColumnContainer); itsMouseController = new MouseController(); itsTableModelListener = new TableModelListener() { public void tableChanged(TableModelEvent pEvent) { DoiTable.this.tableChanged(pEvent); } }; refreshActionState(); } /** * Create a new table with columns based on the specified table model. The table * model is also used initially to represent data. * @param pTableModel The table model. * @since 4.0 */ public DoiTable(EfiTableModel pTableModel) { this(); if (pTableModel == null) throw new IllegalArgumentException("The table model is null."); for (int i = 1; i < pTableModel.getColumnCount(); ++i) { EfiColumn columnModel = pTableModel.getColumn(i); DoiTableColumn columnView = new DoiTableColumn(); columnView.configureColumnView(columnModel); getColumnContainer().add(columnView); } setTableModel(pTableModel); } //////////////////////////////////////////////////////////////////////////////// // Property accessors and mutators. /** * Install a handler for {@link #canPasteObjects}. * @param pHandler The handler. * @see #removeCanPasteEventListener * @since 4.4 */ @EfiJavaBeanEvent( displayName="Handler for canPasteObjects", shortDescription="Handler invoked to decide if objects can be pasted into the table.") public void addCanPasteEventListener(DoiCanPasteEventListener pHandler) { getSupport().addHandlerEventListener("canPasteObjects", pHandler); } /** * Uninstall the handler for {@link #canPasteObjects}. * @param pHandler The handler. * @see #addCanPasteEventListener * @since 4.4 */ public void removeCanPasteEventListener(DoiCanPasteEventListener pHandler) { getSupport().removeHandlerEventListener("canPasteObjects", pHandler); } /** * Test if the specified cell is editable. Used by the inner table view. * to determine if the user should be allowed to edit the value. * The default implementation delegates to the table model. * @param pRowNo The 0-based row number. * @param pTableView The table view. * @param pViewColNo The 0-based column number within the view. * @return true if the cell should be editable. * @since 4.4 */ public boolean isCellEditable(TableView pTableView, int pRowNo, int pViewColNo) { int modelColNo = pTableView.convertColumnIndexToModel(pViewColNo); boolean editable = getTableModel().isCellEditable(pRowNo, modelColNo); DoiTableCellEditableEventListener handler = (DoiTableCellEditableEventListener)getSupport().getHandlerEventListener("isCellEditable"); DoiTableCellEditableEvent event = null; if (handler != null) { event = new DoiTableCellEditableEvent(pTableView, pRowNo, modelColNo, pViewColNo, editable); setContextRowNo(pRowNo); handler.cellEditable(event); editable = event.isEditable(); } return editable; } /** * Return the current cell editor, if a cell is beeing edited. * @return A cell editor, or null. * @since 4.0 */ public TableCellEditor getCellEditor() { for (int i = 0; i < 2; ++i) { JTable tv = i == 0 ? itsScrolledTableView : itsLockedTableView; if (tv != null) { TableCellEditor editor = tv.getCellEditor(); if (editor != null) return editor; } } return null; } /** * Return the current cell editor component, if a cell is beeing edited. * @return A editor component, or null. * @since 4.0 */ public Component getCellEditorComponent() { for (int i = 0; i < 2; ++i) { JTable tv = i == 0 ? itsScrolledTableView : itsLockedTableView; if (tv != null) { if (!tv.isEditing()) return null; Component editor = tv.getEditorComponent(); if (editor != null) return editor; } } return null; } /** * Test if changed rows should automatically be flagged as edited. * Initially true. * @since 4.4 */ @EfiJavaBeanProperty( displayName="Changed Rows Edited", shortDescription="Changed rows are automatically flagged as edited.", preferred=false) public boolean isChangedRowsEdited() { return itsChangedRowsEdited; } /** * Specify if changed rows should automatically be flagged as edited. * Initially true. * @param pFlagEdited true to flag them. * @since 4.4 */ public void setChangedRowsEdited(boolean pFlagEdited) { itsChangedRowsEdited = pFlagEdited; } /** * Return the column with the specified index. The index is the 0-based order * in which the column was added to the table. The flag column is not included * in this sequence, since it is never explicitly added, but hidden columns are. * @param pIndex The 0-based column index. * @return The column. * @since 4.0 */ public DoiTableColumn getColumn(int pIndex) { if (itsColumnContainer != null) return (DoiTableColumn)itsColumnContainer.getComponent(pIndex); else return itsColumns[pIndex]; } /** * Return the container for the columns, used during design. * @return The column container. * @since 4.0 */ @EfiJavaBeanContainerDelegate public JPanel getColumnContainer() { return itsColumnContainer; } /** * Return the column count, including hidden columns but not the flag column. * @return The column count. * @since 4.0 */ public int getColumnCount() { if (itsColumnContainer != null) return itsColumnContainer.getComponentCount(); else return itsColumns.length; } /** * Return the column with the specified column number within the current table * model. * @param pIndex The 0-based column number. * @return The column, or null if not found. * @since 4.0 */ public DoiTableColumn getColumnByModelColNo(int pIndex) { if (itsColumnsByModelColNo == null) return null; if (pIndex > 0 && pIndex < itsColumnsByModelColNo.length) return itsColumnsByModelColNo[pIndex]; else return null; } /** * Return the column with the specified column number within the specified table view. * @param pTableView The table view. * @param pViewColNo The 0-based column number within the view. * @return The column, or null if not found. * @since 4.0 */ public DoiTableColumn getColumnByViewColNo(TableView pTableView, int pViewColNo) { return getColumnByModelColNo(pTableView.convertColumnIndexToModel(pViewColNo)); } /** * Return the column class for the specified column. Delegates to * {@link EfiTableModel#getColumnClass}. * @param pTableView The table view. * @param pViewColNo The 0-based column number within the view. * @return The column class. * @since 4.4 */ public Class getColumnClass(TableView pTableView, int pViewColNo) { return getTableModel().getColumnClass(pTableView.convertColumnIndexToModel(pViewColNo)); } /** * Return the row number of the context row. This is the row used when accessing values * through the table column components. It is set automatically before * change events are propagated to the column. * @return The row number, or -1 if there is currently no context row. * @since 4.0 */ public int getContextRowNo() { return itsContextRowNo; } /** * Set the row number of the context row. This is the row used when accessing values * through the table column components. It is set automatically before * change events are propagated to the column. * @param pRowNo The row number, or -1 if there is currently no context row. * @since 4.0 */ public void setContextRowNo(int pRowNo) { int old = itsContextRowNo; itsContextRowNo = pRowNo; firePropertyChange(PROPERTY_ContextRowNo, old, pRowNo); } /** * Test if deleted rows should be read only. * Initially true. * @since 4.4 */ @EfiJavaBeanProperty( displayName="Deleted Rows Read Only", shortDescription="Deleted rows are read only.", preferred=false) public boolean isDeletedRowsReadOnly() { return itsDeletedRowsReadOnly; } /** * Specify if deleted rows should be read only. * Initially true. * @param pRO true to make them read only. * @since 4.4 */ public void setDeletedRowsReadOnly(boolean pRO) { itsDeletedRowsReadOnly = pRO; } /** * Return the detail panel used by this table. * @return The detail panel, or null. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Detail panel", shortDescription="Detail panel for extended presentation and editing.", preferred=true) public DoiTableDetailPanel getDetailPanel() { return itsDetailPanel; } /** * Set the detail panel used by this table. * @param pDetailPanel The detail panel, or null. * @since 4.0 */ public void setDetailPanel(DoiTableDetailPanel pDetailPanel) { if (itsDetailPanel == pDetailPanel) return; if (itsDetailPanel != null) itsDetailPanel.setTable(null); itsDetailPanel = pDetailPanel; itsDetailPanel.setTable(this); if (pDetailPanel != null && !DoiBeans.isDesignTime(this)) { Border border = getBorder(); if (border instanceof EmptyBorder) { EmptyBorder eb = (EmptyBorder)border; Insets ins = eb.getBorderInsets(); setBorder(BorderFactory.createEmptyBorder(ins.top, ins.left, 0, ins.right)); } } } /** * Return the column that is currently being edited, or null if none. * @return The column, or null. * @since 4.0 */ public DoiTableColumn getEditingColumn() { for (int i = 0; i < 2; ++i) { TableView tv = i == 0 ? itsScrolledTableView : itsLockedTableView; if (tv != null) { if (!tv.isEditing()) return null; int colNo = tv.getEditingColumn(); if (colNo != -1) { return getColumnByViewColNo(tv, colNo); } } } return null; } /** * Return the row number of the row that is currently being edited, or -1 if none. * @return The row number, or -1. * @since 4.0 */ public int getEditingRowNo() { if (itsTableModel == null) return -1; for (int i = 0; i < 2; ++i) { TableView tv = i == 0 ? itsScrolledTableView : itsLockedTableView; if (tv != null) { if (!tv.isEditing()) return -1; int rowNo = tv.getEditingRow(); if (rowNo != -1 && rowNo < itsTableModel.getRowCount()) return rowNo; } } return -1; } /** * Return the initial sort column. * @return The column, or null for none. * @since 4.4 */ @EfiJavaBeanProperty( displayName="Initial Sort Column", shortDescription="The column controlling initial sort order.", preferred=true) public DoiTableColumn getInitialSortColumn() { return itsInitialSortColumn; } /** * Set the initial sort column. * @param pColumn The column, or null for none. * @since 4.4 */ public void setInitialSortColumn(DoiTableColumn pColumn) { if (itsInitialSortColumn == pColumn) return; itsInitialSortColumn = pColumn; setSortColumn(pColumn); refreshDesignTimeRendering(); } /** * Return the horizontal and vertical space between cells. The default spacing is (1, 1), * which provides room to draw the grid. * @return The spacing, or null for default. * @since 4.0 */ @EfiJavaBeanProperty( shortDescription="The horizontal and vertical space between cells.", preferred=false) public Dimension getIntercellSpacing() { return itsIntercellSpacing; } /** * Set the horizontal and vertical space between cells. The default spacing is (1, 1), * which provides room to draw the grid. * @param pSpacing The spacing, or null for default. * @since 4.0 */ public void setIntercellSpacing(Dimension pSpacing) { if (pSpacing == null) pSpacing = new Dimension(1, 1); Dimension old = itsIntercellSpacing; itsIntercellSpacing = pSpacing; firePropertyChange("intercellSpacing", old, pSpacing); if (itsLockedTableView != null) itsLockedTableView.setIntercellSpacing(itsIntercellSpacing); if (itsScrolledTableView != null) itsScrolledTableView.setIntercellSpacing(itsIntercellSpacing); } /** * Return the symbolic name of the binder that handles objects identified with the primary key column or columns. * Used to support object clipboard operations. * @return The binder name. * @since 4.3 */ @EfiJavaBeanProperty( displayName="Key Column Binder Name", shortDescription="Symbolic name of the binder that handles objects associated with the primary key column or columns.", preferred=true) public String getKeyColumnBinderName() { return itsKeyColumnBinderName; } /** * Set the symbolic name of the binder that handles objects identified with the primary key column or columns. * Used to support object clipboard operations. * @param pBinderName The binder name. * @see #getKeyColumnBinderName * @since 4.3 */ public void setKeyColumnBinderName(String pBinderName) { itsKeyColumnBinderName = pBinderName; } /** * Return the locked view. * @since 4.0 */ public TableView getLockedTableView() { return itsLockedTableView; } /** * Create and return an object key from the specified row. * @param pRowNo The 0-based row number. * @return The object key, or null if there are no primary key columns or the row number is out * of range. * @since 4.0 */ public DoiObjectKey getObjectKey(int pRowNo) { if (pRowNo < -0 || pRowNo >= getRowCount()) return null; DoiObjectKey key = new DoiObjectKey(itsTableModel, pRowNo); if (key.isEmpty()) return null; return key; } /** * Create and return an object key from the specified row. * @param pBinder The binder. Not used by this implementation. * @param pRowNo The 0-based row number. * @return The object key, or null if there is no key on the row or the row number is out * of range. * @since 4.0 */ public DoiObjectKey getObjectKey(DoiBinder pBinder, int pRowNo) { return getObjectKey(pRowNo); } /** * Test if focus should be cyclic within the table when it is editable. * Initially true. * @return true if always cyclic. * @since 4.4 */ @EfiJavaBeanProperty( displayName="Focus Cyclic When Editable", shortDescription="Focus is cyclic within the table when it is editable.", preferred=false) public boolean isFocusCyclicWhenEditable() { return itsFocusCyclicWhenEditable; } /** * Specify if focus should be cyclic within the table when it is editable. * @param pCyclic true if cyclic. * @since 4.4 */ public void setFocusCyclicWhenEditable(boolean pCyclic) { itsFocusCyclicWhenEditable = pCyclic; } /** * Test if focus should be cyclic within the table when it isn't editable. * Initially true. * @return true if cyclic. * @since 4.0 * @changed 4.4 */ @EfiJavaBeanProperty( displayName="Focus Cyclic When Read Only", shortDescription="Focus is cyclic within the table when it isn't editable.", preferred=false) public boolean isFocusCyclicWhenReadOnly() { return itsFocusCyclicWhenReadOnly; } /** * Specify if focus should be cyclic within the table even when it isn't editable. * @param pCyclic true if always cyclic. * @since 4.0 */ public void setFocusCyclicWhenReadOnly(boolean pCyclic) { itsFocusCyclicWhenReadOnly = pCyclic; } /** * Test if the focus indicator should be visible. Used by {@link DoiTableHeaderRenderer}. * @since 4.0 */ public boolean hasFocusIndicator() { return itsFocusIndicator; } /** * Install a handler for {@link #pasteObjects}. * @param pHandler The handler. * @see #removeTableRowActivationEventListener * @since 4.3 */ @EfiJavaBeanEvent( displayName="Handler for pasteObjects", shortDescription="Handler invoked when objects are being pasted into the table.") public void addObjectPasteEventListener(DoiObjectPasteEventListener pHandler) { getSupport().addHandlerEventListener("pasteObjects", pHandler); } /** * Uninstall the handler for {@link #pasteObjects}. * @param pHandler The handler. * @see #addObjectPasteEventListener * @since 4.4 */ public void removeObjectPasteEventListener(DoiObjectPasteEventListener pHandler) { getSupport().removeHandlerEventListener("pasteObjects", pHandler); } /** * Test if the user can activate/open a row using double click or Enter. * @return true if row activation is supported. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Row Activate Supported", shortDescription="Activation/opening of rows supported.", preferred=true) public boolean isRowActivateSupported() { return itsRowActivateSupported; } /** * Specify if the user can activate a row using double click or Enter. * @param pSupported true if row activation is supported. * @since 4.0 */ public void setRowActivateSupported(boolean pSupported) { if (itsRowActivateSupported == pSupported) return; itsRowActivateSupported = pSupported; refreshActionState(); refreshToolBar(); } /** * Return the number of rows. * @return The row count. * @since 4.0 */ public int getRowCount() { return getTableModel().getRowCount(); } /** * Test if rows can be marked for deletion by the user, when the table is editable. * @return true if row deletion is allowed. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Row Delete Allowed", shortDescription="Rows can be marked for deletion by the user.", preferred=true) public boolean isRowDeleteAllowed() { return itsRowDeleteAllowed; } /** * Specify if rows can be marked for deletion by the user, when the table is editable. * @param pAllowed true to allow. * @since 4.0 */ public void setRowDeleteAllowed(boolean pAllowed) { if (itsRowDeleteAllowed == pAllowed) return; itsRowDeleteAllowed = pAllowed; refreshActionState(); refreshToolBar(); firePropertyChange(PROPERTY_RowDeleteAllowed, !pAllowed, pAllowed); } /** * Test if rows can be inserted by the user, when the table is editable. * @return true if row insertion is allowed. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Row Insert Allowed", shortDescription="Rows can be inserted by the user.", preferred=true) public boolean isRowInsertAllowed() { return itsRowInsertAllowed; } /** * Specify if rows can be inserted by the user, when the table is editable. * @param pAllowed true to allow. * @since 4.0 */ public void setRowInsertAllowed(boolean pAllowed) { if (itsRowInsertAllowed == pAllowed) return; itsRowInsertAllowed = pAllowed; refreshActionState(); refreshToolBar(); firePropertyChange(PROPERTY_RowDeleteAllowed, !pAllowed, pAllowed); } /** * Test if rows can be moved by the user, when the table is editable. * If this is allowed, sorting is forbidden. * @return true if row reordering is allowed. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Row Move Allowed", shortDescription="Rows can be moved by the user.", preferred=true) public boolean isRowMoveAllowed() { return itsRowMoveAllowed; } /** * Specify if rows can be moved by the user, when the table is editable. * If this is allowed, sorting is forbidden. * @param pAllowed true to allow. * @since 4.0 */ public void setRowMoveAllowed(boolean pAllowed) { if (itsRowMoveAllowed == pAllowed) return; itsRowMoveAllowed = pAllowed; refreshActionState(); refreshToolBar(); firePropertyChange(PROPERTY_RowMoveAllowed, !pAllowed, pAllowed); } /** * Return the symbolic name of a row. If specified it will be used as the row name of table models created by * this component and also checked agains the row name of any table model that is set on it. * @return The row name. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Row Name", shortDescription="Symbolic row name", preferred=true) public String getRowName() { return itsRowName; } /** * Set the symbolic name of a row. * @param pRowName The row name. * @see #getRowName * @since 4.0 */ public void setRowName(String pRowName) { itsRowName = pRowName; } /** * Return the horizontally scrollable view. * @since 4.0 */ public TableView getScrolledTableView() { return itsScrolledTableView; } /** * Create and return an object key from the currently selected row. * @return The object key, or null if no row is selected. * @see #getSelectedObjectKeys * @see #getSelectedRowNo * @since 4.0 */ public DoiObjectKey getSelectedObjectKey() { int rowNo = getSelectedRowNo(); if (rowNo == -1) return null; return new DoiObjectKey(itsTableModel, rowNo); } /** * Create and return an array of object key from the currently selected rows. * @return The object keys, or an empty array if no row is selected. * @see #getSelectedObjectKey * @see #getSelectedRowNos * @since 4.0 */ public DoiObjectKey[] getSelectedObjectKeys() { int[] rowNos = getSelectedRowNos(); int n = rowNos.length; if (n == 0) return new DoiObjectKey[0]; int[] colNos = itsTableModel.findColNosByIDL(EfiColumn.IDL_Primary); DoiObjectKey[] keys = new DoiObjectKey[n]; for (int i = 0; i < n; ++i) keys[i] = new DoiObjectKey(itsTableModel, rowNos[i], colNos); return keys; } /** * Return the number of selected rows. * @return The row count. * @since 4.0 */ public int getSelectedRowCount() { if (itsScrolledTableView == null) return 0; else return Math.min(itsScrolledTableView.getSelectedRowCount(), getTableModel().getRowCount()); } /** * Return a row map representing the selected row, or null if no rows * are selected. * @return A row map view of the selected row, or null. * @see #getSelectedRowNo * @since 4.0 */ public EfiRowMap getSelectedRowMap() { int rowNo = getSelectedRowNo(); if (rowNo == -1) return null; return itsTableModel.rowAsMap(rowNo); } /** * Return the row number of the selected row, or -1 if no rows are selected. * If more than one row is selected, the anchor selection index is used * if that row is selected, otherwise -1. * @return The 0-based row number, or -1. * @since 4.0 */ public int getSelectedRowNo() { if (itsScrolledTableView == null) return -1; ListSelectionModel sm = itsScrolledTableView.getSelectionModel(); int rowNo = -1; if (itsScrolledTableView.getSelectedRowCount() <= 1) rowNo = itsScrolledTableView.getSelectedRow(); else rowNo = itsScrolledTableView.getSelectionModel().getAnchorSelectionIndex(); if (rowNo >= getTableModel().getRowCount() || !sm.isSelectedIndex(rowNo)) rowNo = -1; return rowNo; } /** * Return the row numbers of all selected rows, or an empty array if no rows are selected. * @return An array containing 0-based ro numbers. * @since 4.0 */ public int[] getSelectedRowNos() { if (itsScrolledTableView == null) return new int[0]; int[] rowNos = itsScrolledTableView.getSelectedRows(); // Return only rows that actually exist. Workaround for a bug in JTable or the selection model. int rowCount = itsScrolledTableView.getRowCount(); int ix = 0; for (int i = 0; i < rowNos.length; ++i) { int rowNo = rowNos[i]; if (rowNo < rowCount) rowNos[ix++] = rowNo; } if (ix == rowNos.length) return rowNos; int[] rowNos1 = new int[ix]; System.arraycopy(rowNos, 0, rowNos1, 0, ix); return rowNos1; } /** * Select the specified column. * @param pColumn The column to select. * @since 4.2 */ public void setSelectedColumn(DoiTableColumn pColumn) { if (pColumn == null) throw new IllegalArgumentException("The column is null."); TableColumn stc = pColumn.getSwingTableColumn(); for (int vi = 0; vi < 2; ++vi) { TableView tv = vi == 0 ? itsLockedTableView : itsScrolledTableView; if (tv == null) continue; TableColumnModel cm = tv.getColumnModel(); int cc = cm.getColumnCount(); for (int i = 0; i < cc; ++i) if (cm.getColumn(i) == stc) { tv.setColumnSelectionInterval(i, i); return; } } } /** * Select the specified row. Use -1 to clear the selection. * @param pRowNo The 0-based row number, or -1. * @since 4.0 */ public void setSelectedRowNo(int pRowNo) { if (itsScrolledTableView == null) return; ListSelectionModel sm = itsScrolledTableView.getSelectionModel(); if (pRowNo < 0 || pRowNo > getRowCount()) sm.clearSelection(); else sm.setSelectionInterval(pRowNo, pRowNo); } /** * Test if single click row activation is suppressed even if selected as global application preferences. * @return true if double click is required. * @since 4.2 */ @EfiJavaBeanProperty( displayName="Single Click Row Activation Suppressed", shortDescription="Double click is required for row activation even if single click is specified in application preferences.", preferred=false) public boolean isSingleClickRowActivationSuppressed() { return itsSingleClickRowActivationSuppressed; } /** * Specify if single click row activation is suppressed even if selected as global application preferences. * @param pSupress true if double click is required. * @since 4.2 */ public void setSingleClickRowActivationSuppressed(boolean pSupress) { itsSingleClickRowActivationSuppressed = pSupress; } /** * Test if only a single row can be selected. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Single Select", shortDescription="Only a single line can be selected at a time.", preferred=false) public boolean isSingleSelect() { return itsSingleSelect; } /** * Specify if only a single row can be selected. * @since 4.0 */ public void setSingleSelect(boolean pSingleSelect) { itsSingleSelect = pSingleSelect; if (itsScrolledTableView != null) itsScrolledTableView.getSelectionModel().setSelectionMode( pSingleSelect ? ListSelectionModel.SINGLE_SELECTION : ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); } /** * Test if the table can be sorted by clicking on the column header. Ignored if row move is allowed. * @return true if column click sorting is allowed. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Sort Allowed", shortDescription="The table can be sorted by the user, if editable and row move is not allowed.", preferred=true) public boolean isSortAllowed() { return itsSortAllowed; } /** * Specify if the table can be sorted by clicking on the column header. Ignored if row move is allowed. * @param pAllowed true to allow column click sorting. * @since 4.0 */ public void setSortAllowed(boolean pAllowed) { if (itsSortAllowed == pAllowed) return; itsSortAllowed = pAllowed; refreshActionState(); refreshToolBar(); } /** * Return the column on which the table is currently sorted, or null if the * initial sort order of the table model is used. * @return The column. * @see #isSortDescending * @since 4.0 */ public DoiTableColumn getSortColumn() { return itsSortColumn; } /** * Set the column on which the table is currently sorted, or null if the * initial sort order of the table model is used. * Note that this does not sort the table, it only affects the sort indicators in the header. * @param pColumn The column. * @see #setSortDescending * @since 4.0 */ public void setSortColumn(DoiTableColumn pColumn) { itsSortColumn = pColumn; if (itsLockedTableView != null) itsLockedTableView.getTableHeader().repaint(); if (itsScrolledTableView != null) itsScrolledTableView.getTableHeader().repaint(); } /** * Return true if the table is sorted descending on the current sort column. * @return true if descending. * @see #getSortColumn * @since 4.0 */ public boolean isSortDescending() { return itsSortDescending; } /** * Specify if the table is sorted descending on the current sort column. * Note that this does not sort the table, it only affects the sort indicators in the header. * @param pDescending true if descending. * @see #setSortColumn * @since 4.0 */ public void setSortDescending(boolean pDescending) { itsSortDescending = pDescending; if (itsLockedTableView != null) itsLockedTableView.getTableHeader().repaint(); if (itsScrolledTableView != null) itsScrolledTableView.getTableHeader().repaint(); } /** * Set the state. Overridden to propagate the state to all columns. * @param pState The new state. * @return true if the state was changed. * @since 4.0 */ @Override public boolean setState(int pState) { boolean changed = super.setState(pState); int n = getColumnCount(); for (int i = 0; i < n; ++i) getColumn(i).setState(pState); return changed; } /** * Return the table model that holds the data for this view. * @return A table model. * @since 4.0 */ public EfiTableModel getTableModel() { commitColumnContainer(); if (itsTableModel == null) setTableModel(null); return itsTableModel; } /** * Set the table model to use. * @param pTableModel A table model, or null to create * and use a new empty table model. * @since 4.0 */ public void setTableModel(EfiTableModel pTableModel) { commitColumnContainer(); if (pTableModel == null) pTableModel = createTableModel(); pTableModel.setChangedRowsEdited(itsChangedRowsEdited); pTableModel.setDeletedRowsLocked(itsDeletedRowsReadOnly); // Associate model columns with visual columns and propagate or check properties. itsColumnsByModelColNo = new DoiTableColumn[pTableModel.getColumnCount()]; pTableModel.setTableEditable(isEditable()); for (int i = 0; i < itsColumns.length; ++i) { DoiTableColumn column = itsColumns[i]; String name = column.getName(); int midx = pTableModel.getColNo(name); if (midx < 0) throw new IllegalArgumentException("Column "+name+" not found in the table model."); itsColumnsByModelColNo[midx] = column; column.setModelColNo(midx); pTableModel.setColumnEditable(midx, !column.isReadOnly(RO_Static)); pTableModel.setColumnSilent(midx, column.isSilent()); pTableModel.setColumnIdentificationLevel(midx, column.getIdentificationLevel()); Class vc = column.getValueClass(); if (!vc.isAssignableFrom(pTableModel.getColumnClass(midx))) throw new IllegalArgumentException( "Column "+name+" is of class "+pTableModel.getColumnClass(midx)+ " in the model, but of class "+column.getValueClass()+" in the view."); } if (itsTableModel != null) itsTableModel.removeTableModelListener(itsTableModelListener); itsTableModel = pTableModel; itsTableModel.addTableModelListener(itsTableModelListener); if (itsLockedTableView != null) { itsLockedTableView.setModel(pTableModel); itsLockedTableView.clearSelection(); } if (itsScrolledTableView != null) { itsScrolledTableView.setModel(pTableModel); itsScrolledTableView.clearSelection(); } if (itsDetailPanel != null) itsDetailPanel.showRow(-1); refreshStatusBar(); } /** * Return the status bar, if visible. * @return The status bar, or null. * @since 4.3 */ public DoiTableStatusBar getStatusBar() { JComponent fc = getFooterComponent(); if (fc instanceof DoiTableStatusBar) return (DoiTableStatusBar)fc; else return null; } /** * Test if the table has a visible status bar. * @return true if the status bar is visible. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Status Bar Visible", shortDescription="The table has a status bar that shows row count and truncation info.", preferred=false) public boolean isStatusBarVisible() { return getFooterComponent() != null; } /** * Specify if the table should have a visible status bar. * @param pVisible true if the status bar should be visible. * @since 4.0 */ public void setStatusBarVisible(boolean pVisible) { if (isStatusBarVisible() == pVisible) return; if (pVisible) setFooterComponent(new DoiTableStatusBar(this)); else setFooterComponent(null); } /** * Install a handler for {@link #isCellEditable}. * @param pHandler The handler. * @see #removeTableCellEditableEventListener * @since 4.4 */ @EfiJavaBeanEvent( displayName="Handler for isCellEditable", shortDescription="Handler invoked when a cell is tested for editability.") public void addTableCellEditableEventListener(DoiTableCellEditableEventListener pHandler) { getSupport().addHandlerEventListener("isCellEditable", pHandler); } /** * Uninstall a handler for {@link #isCellEditable}. * @param pHandler The handler. * @see #addTableCellEditableEventListener * @since 4.4 */ public void removeTableCellEditableEventListener(DoiTableCellEditableEventListener pHandler) { getSupport().removeHandlerEventListener("isCellEditable", pHandler); } /** * Install a handler for {@link #prepareCellRenderer}. * @param pHandler The handler. * @see #removeTableCellRendererEventListener * @since 4.4 */ @EfiJavaBeanEvent( displayName="Handler for prepareCellRenderer", shortDescription="Handler invoked when a cell renderer is being prepared.") public void addTableCellRendererEventListener(DoiTableCellRendererEventListener pHandler) { getSupport().addHandlerEventListener("prepareCellRenderer", pHandler); } /** * Uninstall a handler for {@link #prepareCellRenderer}. * @param pHandler The handler. * @see #addTableCellRendererEventListener * @since 4.4 */ public void removeTableCellRendererEventListener(DoiTableCellRendererEventListener pHandler) { getSupport().removeHandlerEventListener("prepareCellRenderer", pHandler); } /** * Install a handler for {@link #toolTipText}. * @param pHandler The handler. * @see #removeTableCellEditableEventListener * @since 4.4 */ @EfiJavaBeanEvent( displayName="Handler for toolTipText", shortDescription="Handler invoked when a cell tooltip is beig retrieved.") public void addTableCellTooltipEventListener(DoiTableCellTooltipEventListener pHandler) { getSupport().addHandlerEventListener("toolTipText", pHandler); } /** * Uninstall a handler for {@link #isCellEditable}. * @param pHandler The handler. * @see #addTableCellEditableEventListener * @since 4.4 */ public void removeTableCellTooltipEventListener(DoiTableCellTooltipEventListener pHandler) { getSupport().removeHandlerEventListener("toolTipText", pHandler); } /** * Install a handler for {@link #rowActivated}. * @param pHandler The handler. * @see #removeTableRowActivationEventListener * @since 4.0 */ @EfiJavaBeanEvent( displayName="Handler for rowActivated", shortDescription="Handler invoked when a row is activated, if row activation is supported.") public void addTableRowActivationEventListener(DoiTableRowActivationEventListener pHandler) { getSupport().addHandlerEventListener("rowActivated", pHandler); } /** * Uninstall the handler for {@link #rowActivated}. * @param pHandler The handler. * @see #addTableRowActivationEventListener * @since 4.0 */ public void removeTableRowActivationEventListener(DoiTableRowActivationEventListener pHandler) { getSupport().removeHandlerEventListener("rowActivated", pHandler); } /** * Install a handler for {@link #rowSelected}. * @param pHandler The handler. * @see #removeTableRowActivationEventListener * @since 4.3 */ @EfiJavaBeanEvent( displayName="Handler for rowSelected", shortDescription="Handler invoked when one or more rows are selecte dor deselected.") public void addTableRowSelectionEventListener(DoiTableRowSelectionEventListener pHandler) { getSupport().addHandlerEventListener("rowSelected", pHandler); } /** * Uninstall the handler for {@link #rowSelected}. * @param pHandler The handler. * @see #addTableRowActivationEventListener * @since 4.3 */ public void removeTableRowSelectionEventListener(DoiTableRowActivationEventListener pHandler) { getSupport().removeHandlerEventListener("rowSelected", pHandler); } /** * Install a handler for row state changes. * @param pHandler The handler. * @see #removeTableRowStateEventListener * @since 4.4 */ @EfiJavaBeanEvent( displayName="Handler for rowState", shortDescription="Handler invoked when a row changes state flags.") public void addTableRowStateEventListener(DoiTableRowStateEventListener pHandler) { getSupport().addHandlerEventListener("rowState", pHandler); } /** * Uninstall the handler for row state changes. * @param pHandler The handler. * @see #addTableRowStateEventListener * @since 4.4 */ public void removeTableRowStateEventListener(DoiTableRowStateEventListener pHandler) { getSupport().removeHandlerEventListener("rowState", pHandler); } /** * Return the column that holds the node key for the tree column. * @return The column, or null to use the row number. * @since 4.3 */ @EfiJavaBeanProperty( displayName="Tree Key Column", shortDescription="The column that holds the node key for the tree column, or null to use the row number.", preferred=false) public DoiTableColumn getTreeKeyColumn() { return itsTreeKeyColumn; } /** * Set the column that holds the node key for the tree column. * @param pColumn The column, or null to use the row number. * @since 4.3 */ public void setTreeKeyColumn(DoiTableColumn pColumn) { itsTreeKeyColumn = pColumn; } /** * Return the column that holds the node label for the tree column. * @return The column, or null if no tree column is used. * @since 4.3 */ @EfiJavaBeanProperty( displayName="Tree Label Column", shortDescription="The column that holds the node label for the tree colum.", preferred=false) public DoiTableColumn getTreeLabelColumn() { return itsTreeLabelColumn; } /** * Set the column that holds the node label for the tree column. * @param pColumn The column, or null if no tree column is used. * @since 4.3 */ public void setTreeLabelColumn(DoiTableColumn pColumn) { itsTreeLabelColumn = pColumn; } /** * Return the column that holds the parent node key or row number for the tree column. * @return The column, or null to use the row number. * @since 4.3 */ @EfiJavaBeanProperty( displayName="Tree Parent Column", shortDescription="The column that holds the parent node key or row number for the tree column, or null.", preferred=false) public DoiTableColumn getTreeParentColumn() { return itsTreeParentColumn; } /** * Set the column that holds the parent node key or row number for the tree column. * @param pColumn The column, or null to use the row number. * @since 4.3 */ public void setTreeParentColumn(DoiTableColumn pColumn) { itsTreeParentColumn = pColumn; } /** * Return the value of this component. This implementation returns a new * table model with the same structure and contents as the one used by this * component, but without any listeners. The cell values themselves are cloned * only if they implement {@link EfiClonable}, i e immutable value objects * such as Strings are not cloned. * @param pChangesOnly Indicates that only changed rows are copied, as specified * by {@link EfiTableModel#COPY_ForUpdate}. * @return A table model. * @since 4.0 */ public Object getValue(boolean pChangesOnly) { DoiGetValueEventListener handler = (DoiGetValueEventListener)getSupport().getHandlerEventListener("getValue"); DoiGetValueEvent event = null; if (handler != null) { event = new DoiGetValueEvent(this, pChangesOnly); handler.beforeGetValue(event); if (event.isConsumed()) return event.getValue(); pChangesOnly = event.isChangesOnly(); } int copy = pChangesOnly ? EfiTableModel.COPY_ForUpdate : EfiTableModel.COPY_All; Object value = new EfiDefaultTableModel(getTableModel(), copy); if (event != null) { event.setValue(value); handler.afterGetValue(event); value = event.getValue(); } return value; } /** * Set the value of this component. * @param pValue An instance of {@link EfiTableModel} or null to create * and use a new empty table model. * @param pState The new state. See {@link DoiComponent#setValue}. * @since 4.0 */ public void setValue(Object pValue, int pState) { // Ignore a value map that has been propagated here because the name is null. if (getName() == null && pValue instanceof EfiValueMap) return; DoiSetValueEventListener handler = (DoiSetValueEventListener)getSupport().getHandlerEventListener("setValue"); DoiSetValueEvent event = null; if (handler != null) { event = new DoiSetValueEvent(this, pValue, pState); handler.beforeSetValue(event); pValue = event.getValue(); pState = event.getState(); } EfiTableModel table; int nc = getColumnCount(); for (int i = 0; i < nc; ++i) getColumn(i).setReadOnly(RO_NewCopyLocked, false); if (pValue == null) { table = createTableModel(); } else { try { table = (EfiTableModel)pValue; } catch (ClassCastException ex) { throw new IllegalArgumentException( "A table can only accept values of type EfiTableModel, not "+ pValue.getClass().getName()); } if (getSupport().isLoadingNewCopy()) newCopy(table); } setTableModel(table); sortByColumn(itsSortColumn); if (pState > getState()) setState(pState); if (!isSilent() && getState() != VOID) getSupport().fireValueChanged(this, null, pState); if (event != null) handler.afterSetValue(event); } /** * Invoked by {@link #setValue(Object, int)} when preparing a new copy. The default implementation * does the following: *
    *
  1. Sets columns with {@link DoiComponent#NC_Locked} to read only.
  2. *
  3. Clears all values from columns whose "new copy" rule is {@link DoiComponent#NC_Cleared}.
  4. *
  5. Marks all rows as new if row insert is allowed.
  6. *
  7. Marks all rows as edited.
  8. *
* The last three steps are delegated to {@link #newCopyRow}. * @since 4.4 */ protected void newCopy(EfiTableModel pTableModel) { List clearedModelColNos = new ArrayList(); int nc = getColumnCount(); for (int i = 0; i < nc; ++i) { DoiTableColumn column = getColumn(i); switch (column.getNewCopy()) { case NC_Cleared : String name = column.getName(); int midx = pTableModel.getColNo(name); if (midx != -1) clearedModelColNos.add(midx); break; case NC_Locked : column.setReadOnly(RO_NewCopyLocked, true); break; } } int rc = pTableModel.getRowCount(); for (int i = 0; i < rc; ++i) newCopyRow(pTableModel, i, clearedModelColNos); } /** * Invoked by {@link #newCopy(EfiTableModel)} when preparing a new copy. The default implementation * does the following: *
    *
  1. Marks all rows as new if row insert is allowed.
  2. *
  3. Marks all rows as edited.
  4. *
  5. Clears all values from columns in the column number list.
  6. *
* @see #newCopy * @since 4.4 */ protected void newCopyRow(EfiTableModel pTableModel, int pRowNo, List pClearedColNos) { int cc = pClearedColNos.size(); if (isRowInsertAllowed()) pTableModel.setRowFlag(pRowNo, EfiRow.INSERTED, true); pTableModel.setRowFlag(pRowNo, EfiRow.EDITED, true); for (int ci = 0; ci < cc; ++ci) pTableModel.setValueAt(pRowNo, pClearedColNos.get(ci), null); } /** * Return the class of values accepted and returned by this field. * This implementation always returns {@link EfiTableModel}. * @return The value class. * @see #setValueClass * @since 4.0 */ public Class getValueClass() { return EfiTableModel.class; } /** * Set the class of values accepted and returned by this field. * This implementation accepts only {@link EfiTableModel}. * @param pClass The value class. * @throws IllegalArgumentException If the class is not accepted. * accepted. * @since 4.0 */ public void setValueClass(Class pClass) throws IllegalArgumentException { if (pClass != EfiTableModel.class) throw new IllegalArgumentException("Invalid value class."); } /** * Return the preferred number of visible rows. * @return The row count. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Visible Row Count", shortDescription="Preferred number of visible rows.", preferred=true) public int getVisibleRowCount() { return itsVisibleRowCount; } /** * Set the preferred number of visible rows. * @param pRowCount The row count. * @since 4.0 */ public void setVisibleRowCount(int pRowCount) { itsVisibleRowCount = Math.max(2, pRowCount); } /** * Test if column 0 of the table model, which is reserved for row flags, is * visible. * @return true if row flags are visible. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Visible Row Flags", shortDescription="Show column 0, which is reserved for row flags.", preferred=true) public boolean isVisibleRowFlags() { return itsVisibleRowFlags; } /** * Specify if column 0 of the table model, which is reserved for row flags, should * be visible. * @param pVisible true if row flags are visible. * @since 4.0 */ public void setVisibleRowFlags(boolean pVisible) { boolean old = itsVisibleRowFlags; itsVisibleRowFlags = pVisible; firePropertyChange("visibleRowFlags", old, pVisible); setupTableViews(); } /** * Test if the column header should be visible. * @return true if the column header should be visible. * @since 4.0 */ @EfiJavaBeanProperty( displayName="Visible Column Header", shortDescription="Show the column header.", preferred=false) public boolean isVisibleColumnHeader() { return itsVisibleColumnHeader; } /** * Specify if the column header should be visible. * @param pVisible true if the column header should be visible. * @since 4.0 */ public void setVisibleColumnHeader(boolean pVisible) { boolean old = itsVisibleColumnHeader; itsVisibleColumnHeader = pVisible; firePropertyChange("visibleColumnHeader", old, pVisible); setupTableViews(); } /** * Test if horizontal lines should be drawn between the table rows. * @return boolean * @since 4.0 */ @EfiJavaBeanProperty( displayName="Visible Horizontal Lines", shortDescription="Horizontal lines between rows.", preferred=false) public boolean isVisibleHorizontalLines() { return itsVisibleHorizontalLines; } /** * Specify if horizontal lines should be drawn between the table rows. * @param pShow true to draw lines. * @since 4.0 */ public void setVisibleHorizontalLines(boolean pShow) { boolean old = itsVisibleHorizontalLines; itsVisibleHorizontalLines = pShow; firePropertyChange("visibleHorizontalLines", old, pShow); if (itsLockedTableView != null) itsLockedTableView.setShowHorizontalLines(pShow); if (itsScrolledTableView != null) itsScrolledTableView.setShowHorizontalLines(pShow); } /** * Test if vertical lines should be drawn between the table columns. * @return boolean * @since 4.0 */ @EfiJavaBeanProperty( displayName="Visible Vertical Lines", shortDescription="Vertical lines between columns.", preferred=false) public boolean isVisibleVerticalLines() { return itsVisibleVerticalLines; } /** * Specify if vertical lines should be drawn between the table columns. * @param pShow true to draw lines. * @since 4.0 */ public void setVisibleVerticalLines(boolean pShow) { boolean old = itsVisibleVerticalLines; itsVisibleVerticalLines = pShow; firePropertyChange("visibleVerticalLines", old, pShow); if (itsLockedTableView != null) itsLockedTableView.setShowVerticalLines(pShow); if (itsScrolledTableView != null) itsScrolledTableView.setShowVerticalLines(pShow); } /** * Test if the table has received inconsistent (possibly unhealthy) properties. * If so, a warning string is returned. * @return The warning string, or null if consistent. * @since 4.3 */ @EfiJavaBeanProperty( displayName="Zonked", shortDescription="Indicates if the table has inconsistent properties.", preferred=true, readOnly=true) public String getZonked() { if (itsTreeLabelColumn != null && itsTreeParentColumn == null) return "Tree label column requires tree parent column."; if (itsTreeKeyColumn != null && itsTreeParentColumn != null) if (itsTreeKeyColumn.getValueClass() != itsTreeParentColumn.getValueClass()) return "Tree key and parent columns have different value classes."; return null; } //////////////////////////////////////////////////////////////////////////////// // Operations. /** * Invoked when this table is added to some container. * Calls {@link #commitColumnContainer}. * @since 4.0 */ @Override public void addNotify() { super.addNotify(); commitColumnContainer(); } /** * Test if this component can copy contained or selected object or objects to an object clipboard. * This implementation returns a non null value if a key column binder name has been set, the table * has a denoted primary key column and at least one row is selected. * @return Information about binder and object count, or null. * @since 4.3 * @changed 4.4 */ @Override public DoiObjectCopyInfo canCopyObjects() { if (itsKeyColumnBinderName == null) return null; DoiBinder binder = DoiApplication.instance().getBinderOrNull(itsKeyColumnBinderName); if (binder == null) return null; int rc = getSelectedRowCount(); if (rc == 0) return null; boolean anyPK = false; int cc = itsTableModel.getColumnCount(); for (int i = 1; i < cc; ++i) { if (itsTableModel.getColumnIdentificationLevel(i) == EfiColumn.IDL_Primary) { anyPK = true; break; } } if (!anyPK) return null; return new DoiObjectCopyInfo(this, binder, rc); } /** * Test if this component can paste the contents of the specified object clipboard. * This implementation returns true if a key column binder name has been set and at least * one object of this type is placed in the clipboard. * @param pClipboard The clipboard. * @return true if the object can be pasted. * @since 4.3 */ @Override public boolean canPasteObjects(DoiObjectClipboard pClipboard) { if (pClipboard.getObjectCount() == 0) return false; Boolean canPaste = null; DoiCanPasteEventListener handler = (DoiCanPasteEventListener)getSupport().getHandlerEventListener("canPasteObjects"); DoiObjectPasteEvent event = null; if (handler != null) { event = new DoiObjectPasteEvent(this, pClipboard); handler.beforeCanPasteObjects(event); canPaste = event.getCanPaste(); if (canPaste != null) return canPaste.booleanValue(); } canPaste = Boolean.FALSE; if (itsKeyColumnBinderName != null) { DoiBinder binder = pClipboard.getBinder(); if (binder != null && binder.getName().equals(itsKeyColumnBinderName)) if (itsRowInsertAllowed && isEditable()) canPaste = Boolean.TRUE; } if (handler != null) { event.setCanPaste(canPaste); handler.afterCanPasteObjects(event); canPaste = event.getCanPaste(); } return Boolean.TRUE.equals(canPaste); } /** * Create table views and place them in a scroll pane that is added to this table. * @see #commitColumnContainer(boolean) * @since 4.0 */ public void commitColumnContainer() { commitColumnContainer(false); } /** * Create table views and place them in a scroll pane that is added to this table. * If the table was created using the constructor that takes a table model, the views * are based on that table model. * If instead it was created using the default constructor, a column model is built * using the columns in the column container. In this case the column container is * removed before the views are added. * * If no column model exists or the column container is empty, this method returns * immediately. This means that it is safe to call it before any columns have been * added. It is also safe to call it multiple times. * * When the table is added to some container, {@link #addNotify} will invoke this * method. * @param pForce true to commit even if design time. * @since 4.0 */ public void commitColumnContainer(boolean pForce) { // Some safety measures. if (!pForce && DoiBeans.isDesignTime(this)) return; if (itsScrollPane != null) return; if (itsColumnContainer == null) return; // Transfer all columns from the column container to the column list and map. int ccc = itsColumnContainer.getComponentCount(); itsColumns = new DoiTableColumn[ccc]; itsColumnMap = new LinkedHashMap(); for (int i = 0; i < ccc; ++i) { DoiTableColumn column = itsColumnContainer.getColumn(i); itsColumns[i] = column; String name = column.getName(); if (name == null) throw new IllegalStateException("Column "+(i+1)+" has no component name."); if (name != null && name.length() > 0) itsColumnMap.put(name, column); column.setTable(this); if (column.getDetailComponent() != null) column.getDetailComponent().setName(column.getName()); } // Replace the column container with a scroll pane remove(itsColumnContainer); itsColumnContainer = null; itsScrollPane = new JScrollPane(); itsScrollPane.setFocusable(false); DoiContextMenuController.instance().installOn(itsScrollPane); setInnerComponent(itsScrollPane); // Set an initial table model created from the column list and set up the table views. TableModel tm = new DefaultTableModel(0, ccc); setTableModel(null); setupTableViews(); } /** * Commit any ongoing edits to the value model. This implementation stops or cancels * cell editing and clears the selection. If the table isn't editable it does nothing * and the selection remains. * @since 4.0 */ @Override public void commitEdits() { if (!isEditable()) return; TableCellEditor editor = getCellEditor(); if (editor != null) if (!editor.stopCellEditing()) editor.cancelCellEditing(); setSelectedRowNo(-1); } /** * Prepare the component for displaying a context menu, and return a list of * actions used to build the menu. Invoked by the context menu controller when * the user requests a context menu. This implementation ensures that the row * under the cursor is selected and returns a list with relevant actions. * @param pEvent The triggering event. * @return A list of action items. * @since 4.0 */ @Override public DoiActionList contextMenuRequested(InputEvent pEvent) { DoiActionList list = new DoiActionList(); DoiTopView view = (DoiTopView)SwingUtilities.getAncestorOfClass(DoiTopView.class, this); if (view == null) return list; int rowNo = -1, colNo = -1; DoiTableColumn column = null; requestFocusInWindow(); // Select row if mouse clicked on unselected. if (pEvent instanceof MouseEvent && pEvent.getComponent() instanceof TableView) { Point pt = ((MouseEvent)pEvent).getPoint(); TableView tv = (TableView)pEvent.getComponent(); rowNo = tv.rowAtPoint(pt); if (rowNo >= 0) { if (!tv.isRowSelected(rowNo)) tv.getSelectionModel().setSelectionInterval(rowNo, rowNo); } colNo = tv.columnAtPoint(pt); if (colNo >= 0) column = getColumnByViewColNo(tv, colNo); } else { rowNo = getSelectedRowNo(); column = getEditingColumn(); } // Invoke before-handler. DoiContextMenuEventListener handler = (DoiContextMenuEventListener)getSupport().getHandlerEventListener("contextMenuRequested"); DoiContextMenuEvent event = null; if (handler != null) { event = new DoiContextMenuEvent(this, pEvent, list); handler.beforeContextMenu(event); if (event.isConsumed()) return event.getActionList(); } // Create an action list and add enabled actions. DoiActionSet actions = getActionSet(); list.addItemIfEnabled(actions.getAction("EditRowInsert"), false); list.addItemIfEnabled(actions.getAction("EditRowInsertBefore"), false); list.addItemIfEnabled(actions.getAction("EditRowInsertAfter"), false); list.addItemIfEnabled(actions.getAction("EditRowDelete"), false); list.addItemIfEnabled(actions.getAction("EditRowMoveUp"), true); list.addItemIfEnabled(actions.getAction("EditRowMoveDown"), false); view.setLastFocusedComponent(this); boolean sep = true; if (canCopyObjects() != null) sep = !list.addItemIfEnabled(view.getAction("EditCopyObjects"), true); list.addItemIfEnabled(view.getAction("EditPasteObjects"), sep); if (column != null && rowNo != -1) { if (column.isLookupAvailable()) { list.addItem(getAction("Lookup"), true); DoiBinder lookupBinder = column.getLookupBinder(); if (lookupBinder != null && lookupBinder.permitted(DoiObjectPermission.MASK_CREATE)) { DoiAction action = column.getAction("NewLookup"); String typeName = lookupBinder.getTextString("titleObject"); String cmdNewLookup = lookupBinder.getTextString("cmdEditNewLookup"); action.setTitle(MessageFormat.format(cmdNewLookup, new Object[] { typeName })); list.addItem(action); } } boolean multiple = getSelectedRowCount() > 1; DoiTableColumn lookupColumn = column.getLookupKeyColumnEffective(); String[] names = lookupColumn.getLookupSchemaNames(); DoiApplication.instance().appendOpenWithActionList(list, names, lookupColumn, multiple); } // Invoke after-handler. if (handler != null) handler.afterContextMenu(event); return list; } /** * Copy selected object or objects to the specified object clipboard. * This implementation copies rows if a key column binder name has been set and at least * one row is selected. * @param pClipboard The clipboard. * @throws IOException If an I/O error occurs. * @since 4.3 */ @Override public void copyObjects(DoiObjectClipboard pClipboard) throws IOException { if (itsKeyColumnBinderName == null) return; DoiBinder binder = DoiApplication.instance().getBinderOrNull(itsKeyColumnBinderName); if (binder == null) return; int[] rowNos = getSelectedRowNos(); EfiTableModel source = getTableModel(); EfiTableModel target = new EfiDefaultTableModel(source, EfiTableModel.COPY_Structure); for (int i = 0; i < rowNos.length; ++i) { EfiRow row = source.getRow(rowNos[i]); target.addRow(row, true); } pClipboard.copyObjects(binder, target); } /** * Create the actions for this component. Invoked by {@link #getActionSet} if * the actions hasn't been created yet. * @return A set of actions. * @since 4.0 */ @Override protected DoiActionSet createActionSet() { DoiActionSet actions = super.createActionSet(); DoiApplication app = DoiApplication.instance(); DoiAction action; action = new DoiAction("RowActivate", app.getTextString("cmdActivate"), this); actions.add(action); action = app.createAction("EditRowDelete", "RowDelete", this); actions.add(action); action = app.createAction("EditRowInsert", "RowInsert", this); actions.add(action); action = app.createAction("EditRowInsertAfter", "RowInsertAfter", this); actions.add(action); action = app.createAction("EditRowInsertBefore", "RowInsertBefore", this); actions.add(action); action = app.createAction("EditRowMoveDown", "RowMoveDown", this); actions.add(action); action = app.createAction("EditRowMoveUp", "RowMoveUp", this); actions.add(action); action = new DoiAction("Lookup", DoiApplication.instance().getTextString("cmdEditLookup"), this); action.setEllipsis(true); actions.add(action); return actions; } /** * Create an {@link EfiColumnList} with column models configured from the * column components. * @return A column list for use in a table model. * @since 4.0 */ public EfiColumnList createColumnModelList() { int n = getColumnCount(); EfiColumnList columnList = new EfiColumnList(n+1); for (int i = 0; i < n; ++i) { DoiTableColumn columnView = getColumn(i); EfiColumn columnModel = columnList.getColumn(i+1); columnView.configureColumnModel(columnModel); } return columnList; } /** * Create an internal table view, and equip it with table header, listeners etc. * @param pColumnModel The column model to use. * @param pLocked Indicates that the view is intended for the locked part of the table. * @return A table view. * @since 4.0 */ protected TableView createTableView(TableColumnModel pColumnModel, boolean pLocked) { return new TableView(itsTableModel, pColumnModel, pLocked); } /** * Create a table model based on the columns in this view. * @return A new empty table. * @see #createTableModel * @since 4.0 */ public EfiTableModel createTableModel() { EfiTableModel table = new EfiDefaultTableModel(createColumnModelList(), false); if (itsRowName != null) table.setRowName(itsRowName); return table; } /** * Create the toolbar action list for this component. Invoked by {@link #getToolBarActionList} * if an action list for the toolbar hasn't been created yet. This implementation returns * list containing actions for adding, deleting and moving rows, depending on what is allowed. * @return The toolbar action list. * @since 4.0 */ @Override protected DoiActionList createToolBarActionList() { DoiActionList list = super.createToolBarActionList(); if (itsRowMoveAllowed) { list.addItem(getAction("EditRowMoveUp")); list.addItem(getAction("EditRowMoveDown")); } if (itsRowDeleteAllowed) list.addItem(getAction("EditRowDelete"), true); if (itsRowInsertAllowed) list.addItem(getAction("EditRowInsert")); return list; } /** * Activate the selected row. Checks if row activation is supported and invokes {@link #rowActivated} * if a row is selected. * @param pEvent The action event. * @since 4.0 */ public void doActionRowActivate(ActionEvent pEvent) { if (!itsRowActivateSupported) return; int rowNo = getSelectedRowNo(); if (rowNo < 0 || rowNo >= getRowCount()) return; rowActivated(rowNo, pEvent); } /** * Mark selected rows for deletion. * @param pEvent The action event. * @since 4.0 */ public void doActionEditRowDelete(ActionEvent pEvent) { if (!itsRowDeleteAllowed) return; int[] rowNos = getSelectedRowNos(); boolean newState = !itsTableModel.anyRowFlags(rowNos, EfiRow.DELETED); itsTableModel.setRowFlags(rowNos, EfiRow.DELETED, newState); refreshActionState(); } /** * Insert a new row in the table. * @param pEvent The action event, or null. * @since 4.0 */ public void doActionEditRowInsert(ActionEvent pEvent) { if (!itsRowInsertAllowed) return; insertAndEditRow(getRowCount()); } /** * Insert a new row in the table, after the selected. * @param pEvent The action event, or null. * @since 4.4 */ public void doActionEditRowInsertAfter(ActionEvent pEvent) { if (!itsRowInsertAllowed || !itsRowMoveAllowed) return; int rowNo = Math.min(getSelectedRowNo()+1, getRowCount()); insertAndEditRow(rowNo); } /** * Insert a new row in the table, before the selected. * @param pEvent The action event, or null. * @since 4.4 */ public void doActionEditRowInsertBefore(ActionEvent pEvent) { if (!itsRowInsertAllowed || !itsRowMoveAllowed) return; int rowNo = Math.max(getSelectedRowNo(), 0); insertAndEditRow(rowNo); } /** * Move selected rows downwards. * @param pEvent The action event. * @since 4.0 */ public void doActionEditRowMoveDown(ActionEvent pEvent) { moveSelectedRows(true); } /** * Move selected rows upwards. * @param pEvent The action event. * @since 4.0 */ public void doActionEditRowMoveUp(ActionEvent pEvent) { moveSelectedRows(false); } /** * Look up a value for the edited column. Delegates to the column. * @param pEvent The action event. * @since 4.0 * @changed 4.3 */ public void doActionLookup(ActionEvent pEvent) { if (!isEditable()) return; // Find the view and column. TableView view = null; int colNo = -1; for (int i = 0; i < 2; ++i) { TableView tv = i == 0 ? itsScrolledTableView : itsLockedTableView; if (tv != null) { colNo = tv.getEditingColumn(); if (colNo != -1) { view = tv; break; } colNo = tv.getSelectedColumn(); if (colNo != -1) { view = tv; break; } } } DoiTableColumn column = null; if (view != null && colNo != -1) column = getColumnByViewColNo(view, colNo); if (column == null) return; int rowNo = getEditingRowNo(); if (rowNo != -1) { if (!column.isLookupInlineWord()) { commitEdits(); setSelectedRowNo(rowNo); } } else { rowNo = getSelectedRowNo(); } setContextRowNo(rowNo); column.doActionLookup(pEvent); view.setRowSelectionInterval(rowNo, rowNo); } /** * Invoked when the editable state was changed as a result of adding or removing reasons * for the component to be read only. * @param pEditable The new editable state. * @since 4.0 */ @Override protected void editableStateChanged(boolean pEditable) { if (itsTableModel != null) itsTableModel.setTableEditable(pEditable); refreshActionState(); } /** * Invoked when cell editing is started. * @param pTableView The table view. * @param pColNo The column number within the view. * @since 4.0 */ public void editingStarted(TableView pTableView, int pColNo) { showFocus(true); DoiTableColumn column = getColumnByViewColNo(pTableView, pColNo); column.setState(CLEAN); } /** * Invoked when cell editing is finished. * @param pTableView The table view. * @since 4.0 */ public void editingStopped(TableView pTableView) { } /** * Find the row containing the specified object. The search starts with the selected row, or in the middle if * no row is selected, and continues outwards from that position. * The method delegates to the generic {@link #findRowNo(EfiValueMap)}. * @param pObjectKey The object key. If null or empty -1 is returned without any search. * @return The 0-based row number, or -1 if not found. * @since 4.0 */ public int findObjectRowNo(DoiObjectKey pObjectKey) { return findRowNo(pObjectKey); } /** * Find the row containing the specified object. * @param pBinder The binder whose objects we are looking for. Not used by this implementation. * @param pObjectKey The object key. * @return The 0-based row number, or -1 if not found. * @since 4.0 */ public int findObjectRowNo(DoiBinder pBinder, DoiObjectKey pObjectKey) { return findRowNo(pObjectKey); } /** * Find a row containing a complete object key. * @param pBinder The binder whose objects we are looking for. Not used by this implementation. * @param pStartRowNo The first row to check. * @param pBrowseDir Search direction as one of {@link DoiObjectBrowsable#BROWSE_Next} or {@link DoiObjectBrowsable#BROWSE_Prev}. * @return The 0-based row number, or -1 if not found. * @since 4.0 */ public int findObjectRowNo(DoiBinder pBinder, int pStartRowNo, int pBrowseDir) { if (Math.abs(pBrowseDir) != 1) throw new IllegalArgumentException("Invalid browse direction: "+pBrowseDir); int endRowNo; if (pBrowseDir > 0) { endRowNo = getRowCount()-1; if (pStartRowNo < 0 || pStartRowNo > endRowNo) return -1; } else { endRowNo = 0; if (pStartRowNo >= getRowCount() || pStartRowNo < 0) return -1; } EfiTableModel tm = getTableModel(); do { DoiObjectKey key = new DoiObjectKey(tm, pStartRowNo); if (key.isComplete()) return pStartRowNo; pStartRowNo += pBrowseDir; } while (pStartRowNo != endRowNo); return -1; } /** * Find the row containing the specified mappings. The search starts with the selected row, or in the middle if * no row is selected, and continues outwards from that position. * @param pValueMap The mappings to search for. If null or empty -1 is returned without any search. * @return The 0-based row number, or -1 if not found. * @since 4.0 */ public int findRowNo(EfiValueMap pValueMap) { if (pValueMap == null) return -1; int rowNo = getSelectedRowNo(); int rowCount = getRowCount(); if (rowNo == -1) rowNo = rowCount/2; EfiRowMap rowMap = null; for (int offset = 0; offset < rowCount; ++offset) { for (int sign = -1; sign < 2; sign += 2) { int rn = rowNo+offset*sign; if (rn < 0 || rn >= rowCount) continue; rowMap = getTableModel().rowAsMap(rn, rowMap); if (EfiValues.contains(rowMap, pValueMap)) return rn; } } return -1; } /** * Find the row containing the specified value. * @param pColumnName The column name. * @param pValue The value. * @return The 0-based row number, or -1 if not found. * @since 4.0 */ public int findRowNo(String pColumnName, Object pValue) { return getTableModel().findRowNo(pColumnName, pValue, -1); } /** * Invoked when the inner component gets focus. Refreshes the lookup indicator and selects the first row if no rows are selected. * @param pEvent The focus event. * @since 4.0 * @changed 4.2 */ @Override public void focusGained(FocusEvent pEvent) { super.focusGained(pEvent); showFocus(true); refreshLookupIndicator(); if (getSelectedRowNo() == -1 && getEditingRowNo() == -1 && getRowCount() > 0) { if (!isEditable()) { setSelectedRowNo(0); } else { TableView tv = getScrolledTableView(); int rowNo = 0; int colNo = 0; int rc = getRowCount(); int cc = tv.getColumnCount(); findCell: for (int ri = 0; ri < rc; ++ri) for (int ci = 0; ci < cc; ++ci) if (tv.isCellEditable(ri, ci)) { rowNo = ri; colNo = ci; break findCell; } // setSelectedRowNo(0); tv.changeSelection(rowNo, colNo, false, false); } } } /** * Invoked when the inner component loses focus. * @param pEvent The focus event. * @since 4.0 */ @Override public void focusLost(FocusEvent pEvent) { if (!pEvent.isTemporary()) { Component opposite = pEvent.getOppositeComponent(); if (opposite == null || !SwingUtilities.isDescendingFrom(opposite, pEvent.getComponent())) showFocus(false); } super.focusLost(pEvent); } /** * Show focus indicator. * @param pFocus Indicates if the table has focus. * @since 4.0 */ public void showFocus(boolean pFocus) { itsFocusIndicator = pFocus; JTableHeader th = itsLockedTableView.getTableHeader(); if (th != null) th.repaint(); } /** * Insert a new row in the table. Any ongoing cell editing is stopped, the row is inserted * and the first editable cell is opened for editing. * @param pRowNo The row # of the new row. * @since 4.4 */ public void insertAndEditRow(int pRowNo) { TableCellEditor editor = getCellEditor(); if (editor != null) if (!editor.stopCellEditing()) return; itsTableModel.insertRow(pRowNo); scrollRowToVisible(pRowNo); for (int tvi = 0; tvi < 2; ++tvi) { JTable tv = tvi == 0 ? itsLockedTableView : itsScrolledTableView; tv.getSelectionModel().setSelectionInterval(pRowNo, pRowNo); for (int i = 0; i < tv.getColumnCount(); ++i) { if (tv.isCellEditable(pRowNo, i)) { tv.setColumnSelectionInterval(i, i); tv.editCellAt(pRowNo, i); Component ec = tv.getEditorComponent(); if (ec != null) ec.requestFocus(); break; } } } refreshActionState(); } /** * Move selected rows. * @param pDown true to move down, false to move up. * @return if any rows were moved. * @since 4.0 */ public boolean moveSelectedRows(boolean pDown) { if (!itsRowMoveAllowed) return false; TableCellEditor editor = getCellEditor(); if (editor != null) if (!editor.stopCellEditing()) return false; int[] selected = getSelectedRowNos(); if (selected.length == 0) return false; int firstRowNo = selected[0]; int lastRowNo = selected[selected.length-1]; int rowCount = lastRowNo-firstRowNo+1; if (rowCount != selected.length) return false; if (pDown) { if (lastRowNo >= itsTableModel.getRowCount()-1) return false; itsTableModel.moveRow(lastRowNo+1, firstRowNo); itsScrolledTableView.getSelectionModel().setSelectionInterval(firstRowNo+1, lastRowNo+1); } else { if (firstRowNo <= 0) return false; itsTableModel.moveRow(firstRowNo-1, lastRowNo); itsScrolledTableView.getSelectionModel().setSelectionInterval(firstRowNo-1, lastRowNo-1); } return true; } /** * Paste the contents of the specified object clipboard into this component. * @param pClipboard The clipboard. * @throws IOException If an I/O error occurs. * @since 4.3 */ @Override public void pasteObjects(DoiObjectClipboard pClipboard) throws IOException { // Safety check and stop editing. if (!canPasteObjects(pClipboard)) return; TableCellEditor editor = getCellEditor(); if (editor != null) if (!editor.stopCellEditing()) return; // Build a list of columns for the source table. int cc = itsTableModel.getColumnCount(); EfiColumnList cols = new EfiColumnList(); for (int i = 1; i < cc; ++i) { DoiTableColumn viewColumn = getColumnByModelColNo(i); EfiColumn modelColumn = cols.addColumn(itsTableModel.getColumn(i)); if (viewColumn != null) modelColumn.setName(viewColumn.getLookupSchemaNameEffective()); } // Allow handler to override how the clipboard table is read. EfiTableModel tm = null; DoiObjectPasteEventListener handler = (DoiObjectPasteEventListener)getSupport().getHandlerEventListener("pasteObjects"); DoiObjectPasteEvent event = null; if (handler != null) { event = new DoiObjectPasteEvent(this, pClipboard); event.setColumnList(cols); handler.beforePasteTable(event); event.throwException(); // Return immediately if the handler has consumed the event. if (event.isConsumed()) return; tm = event.getTableModel(); } if (tm == null) tm = pClipboard.readTable(cols); // Add the rows. int firstRowNo = itsTableModel.getRowCount(); int rc = tm.getRowCount(); for (int i = 0; i < rc; ++i) { EfiRow row = tm.getRow(i); row.setFlag(EfiRow.INSERTED, true); row.setFlag(EfiRow.EDITED, true); int rowNo = itsTableModel.addRow(row, false); } int lastRowNo = itsTableModel.getRowCount()-1; // Invoke handler. if (handler != null) { event.setRowNos(firstRowNo, lastRowNo); handler.afterPasteTable(event); } // Select and make visible. getScrolledTableView().getSelectionModel().setSelectionInterval(firstRowNo, lastRowNo); scrollRowToVisible(lastRowNo); refreshActionState(); } /** * Prepare the cell renderer. Invoked by {@link TableView#prepareCellRenderer}. * The default implementation does nothing. Override to change renderer properties. * @param pTableView The table for which a cell is being rendered. * @param pRenderer The renderer. Usually a subclass of {@link DefaultTableCellRenderer}. * @param pComponent The actual renderer component. * @param pRowNo The 0-based row number. * @param pViewColNo The 0-based column number within the view. See {@link #getColumnByViewColNo}. * @since 4.2 */ protected void prepareCellRenderer(TableView pTableView, TableCellRenderer pRenderer, Component pComponent, int pRowNo, int pViewColNo) { DoiTableCellRendererEventListener handler = (DoiTableCellRendererEventListener)getSupport().getHandlerEventListener("prepareCellRenderer"); DoiTableCellRendererEvent event = null; if (handler != null) { int modelColNo = pTableView.convertColumnIndexToModel(pViewColNo); event = new DoiTableCellRendererEvent(pTableView, pRowNo, modelColNo, pViewColNo, pRenderer, pComponent); handler.preparingCellRenderer(event); } } /** * Refresh the state of all component actions based on the current component state. * @since 4.0 */ @Override public void refreshActionState() { int count = getSelectedRowCount(); boolean editable = isEditable(); boolean moveDown = false; boolean moveUp = false; if (count > 0 && itsRowMoveAllowed && editable) { int[] rows = itsScrolledTableView.getSelectedRows(); if (rows.length == count) { int first = rows[0]; int last = rows[count-1]; if (last-first+1 == count) { moveDown = last < itsTableModel.getRowCount()-1; moveUp = first > 0; } } } boolean insert = itsRowInsertAllowed && editable; getActionSet().getAction("RowActivate").setEnabled(count == 1 && itsRowActivateSupported); getActionSet().getAction("EditRowInsert").setEnabled(insert); getActionSet().getAction("EditRowInsertBefore").setEnabled(insert && itsRowMoveAllowed); getActionSet().getAction("EditRowInsertAfter").setEnabled(insert && itsRowMoveAllowed); getActionSet().getAction("EditRowDelete").setEnabled(count > 0 && itsRowDeleteAllowed && editable); getActionSet().getAction("EditRowMoveUp").setEnabled(moveUp); getActionSet().getAction("EditRowMoveDown").setEnabled(moveDown); } /** * Refresh the lookup indicator on the application status bar based on lookup availability for this component. * @since 4.0 */ public void refreshLookupIndicator() { if (itsScrolledTableView != null) { int colNo = itsScrolledTableView.getSelectedColumn(); if (colNo != -1) { DoiTableColumn column = getColumnByViewColNo(itsScrolledTableView, colNo); if (column != null) { column.refreshLookupIndicator(); return; } } } resetLookupIndicator(); } /** * Refresh the status bar. * @since 4.0 */ public void refreshStatusBar() { DoiTableStatusBar bar = (DoiTableStatusBar)getFooterComponent(); if (bar != null) bar.refreshTableInfo(); } /** * Invoked when the user activates a row using double click or Enter. * The default implementation delegates to the handler if registered. * @param pRowNo The 0-based row number. * @param pEvent The event that caused the activation. * @since 4.0 */ public void rowActivated(int pRowNo, ActionEvent pEvent) { DoiTableRowActivationEventListener handler = (DoiTableRowActivationEventListener)getSupport().getHandlerEventListener("rowActivated"); if (handler != null) { DoiTableRowActivationEvent event = new DoiTableRowActivationEvent(this, pRowNo, pEvent); handler.rowActivated(event); } } /** * Invoked when a row is selected or deselected. * The default implementation does the following: *
    *
  1. The context row is {@linkplain #setContextRowNo set}.
  2. *
  3. If a detail panel is attached, it is {@linkplain DoiTableDetailPanel#showRow notified}.
  4. *
  5. The state of selection dependent actions are {@linkplain #refreshActionState refreshed}. *
* @param pEvent The selection event. * @since 4.0 * @changed 4.3 */ protected void rowSelected(ListSelectionEvent pEvent) { if (pEvent.getValueIsAdjusting()) return; int rowNo = getSelectedRowNo(); int old = itsSelectedRowNo; itsSelectedRowNo = rowNo; // Change context row to the selected unless the selection is cleared and the context row // is the one being edited. if (rowNo != -1 || getEditingRowNo() != itsContextRowNo) setContextRowNo(rowNo); DoiTableRowSelectionEventListener handler = (DoiTableRowSelectionEventListener)getSupport().getHandlerEventListener("rowSelected"); if (handler != null) { DoiTableRowSelectionEvent event = new DoiTableRowSelectionEvent(this, itsContextRowNo, pEvent); handler.rowSelected(event); } if (itsDetailPanel != null) itsDetailPanel.showRow(itsContextRowNo); refreshActionState(); firePropertyChange(PROPERTY_SelectedRowNo, old, rowNo); } /** * Scroll the table view to make the specified row visible. * @param pRowNo The 0-based row number. * @since 4.0 */ public void scrollRowToVisible(int pRowNo) { if (pRowNo < 0 || pRowNo >= getRowCount() || itsScrolledTableView == null) return; Rectangle rc = itsScrolledTableView.getCellRect(pRowNo, 0, true); itsScrolledTableView.scrollRectToVisible(rc); } /** * Create table views based on the template column model. If this * method is invoked before {@link #commitColumnContainer} it returns immediately. * @since 4.0 */ protected void setupTableViews() { if (itsScrollPane == null) return; Font font = UIManager.getFont("Table.font"); FontMetrics metrics = getFontMetrics(font); int charWidth = metrics.charWidth('m'); TableColumnModel lockedColMod = new DefaultTableColumnModel(); TableColumnModel scrolledColMod = new DefaultTableColumnModel(); // Create and add the flag column. if (itsVisibleRowFlags) { int w = 16; TableColumn flagColumn = new TableColumn(0, w, new DoiRowFlagsRenderer(this), null); flagColumn.setMinWidth(w); flagColumn.setMaxWidth(w); flagColumn.setResizable(false); lockedColMod.addColumn(flagColumn); } // Add all ordinary columns. for (int i = 0; i < itsColumns.length; ++i) { DoiTableColumn column = itsColumns[i]; if (column.isHidden()) continue; column.adjustWidths(charWidth); if (column.isLocked()) column.addToColumnModel(lockedColMod); else column.addToColumnModel(scrolledColMod); } if (itsRowSelectionListener != null) itsRowSelectionListener.dispose(); if (itsLockedTableView == null) { itsLockedTableView = createTableView(lockedColMod, true); itsLockedTableView.addFocusListener(getFocusListener()); } else { itsLockedTableView.setColumnModel(lockedColMod); } itsLockedTableView.setShowHorizontalLines(itsVisibleHorizontalLines); itsLockedTableView.setShowVerticalLines(itsVisibleVerticalLines); if (itsScrolledTableView == null) { itsScrolledTableView = createTableView(scrolledColMod, false); itsScrolledTableView.addFocusListener(getFocusListener()); } else { itsScrolledTableView.setColumnModel(scrolledColMod); } itsScrolledTableView.setShowHorizontalLines(itsVisibleHorizontalLines); itsScrolledTableView.setShowVerticalLines(itsVisibleVerticalLines); itsScrolledTableView.getSelectionModel().setSelectionMode( itsSingleSelect ? ListSelectionModel.SINGLE_SELECTION : ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); if (lockedColMod.getColumnCount() <= 1) { // A single flag column. itsLockedTableView.setFocusable(false); setLabelFor(itsScrolledTableView); } else { setLabelFor(itsLockedTableView); } itsRowSelectionListener = new RowSelectionListener(itsLockedTableView, itsScrolledTableView); if (lockedColMod.getColumnCount() > 0) itsScrollPane.setRowHeaderView(itsLockedTableView); else itsScrollPane.setRowHeaderView(null); if (itsVisibleColumnHeader) { itsLockedTableView.setTableHeader(new DoiTableHeader(this, lockedColMod, true)); itsScrolledTableView.setTableHeader(new DoiTableHeader(this, scrolledColMod, false)); itsScrollPane.setCorner(JScrollPane.UPPER_LEFT_CORNER, itsLockedTableView.getTableHeader()); itsScrollPane.setColumnHeaderView(itsScrolledTableView.getTableHeader()); } else { itsLockedTableView.setTableHeader(null); itsScrolledTableView.setTableHeader(null); itsScrollPane.setCorner(JScrollPane.UPPER_LEFT_CORNER, null); itsScrollPane.setColumnHeaderView(null); } itsScrollPane.setViewportView(itsScrolledTableView); Dimension hvdim; hvdim = new Dimension(lockedColMod.getTotalColumnWidth(), 100); itsLockedTableView.setPreferredScrollableViewportSize(hvdim); hvdim = new Dimension(scrolledColMod.getTotalColumnWidth(), 100); itsScrolledTableView.setPreferredScrollableViewportSize(hvdim); Border border = itsScrollPane.getBorder(); if (border == null || border instanceof UIResource) itsScrollPane.setBorder(UIManager.getBorder("Table.scrollPaneBorder")); } /** * Sort the table on the specified columns. * @param pColumnNames An array of column names, or null to clear the sort indicators. * @param pDescending An array that indicates which of the above columns are sorted descending, or null. * @since 4.0 */ public void sort(String[] pColumnNames, boolean[] pDescending) { if (pColumnNames != null && pColumnNames.length > 0 && itsTableModel != null) { int cc = pColumnNames.length; int colNo = itsTableModel.getColNo(pColumnNames[0]); itsSortColumn = getColumnByModelColNo(colNo); if (pDescending != null && pDescending.length > 0) itsSortDescending = pDescending[0]; else itsSortDescending = false; Comparator[] comparators = EfiGenerics.cast(new Comparator[cc]); for (int ci = 0; ci < cc; ++ci) comparators[ci] = CELLCOMP; boolean silent = setSilentTemp(true); try { // Save selection state. int anchorRowNo = getSelectedRowNo(); EfiRow anchorRow = anchorRowNo != -1 ? itsTableModel.getRow(anchorRowNo) : null; int[] selectedRowNos = getSelectedRowNos(); IdentityHashMap selectedRows = new IdentityHashMap(selectedRowNos.length); for (int i = 0; i < selectedRowNos.length; ++i) if (selectedRowNos[i] != anchorRowNo) selectedRows.put(itsTableModel.getRow(selectedRowNos[i]), null); // Sort the table. itsTableModel.sort(pColumnNames, pDescending, comparators); // Restore selection state. ListSelectionModel sm = itsScrolledTableView.getSelectionModel(); sm.clearSelection(); int rowCount = itsTableModel.getRowCount(); anchorRowNo = -1; for (int i = 0; i < rowCount; ++i) { EfiRow row = itsTableModel.getRow(i); if (row == anchorRow) anchorRowNo = i; else if (selectedRows.containsKey(row)) { sm.addSelectionInterval(i, i); selectedRows.remove(row); if (anchorRowNo != -1 && selectedRows.size() == 0) break; } } if (anchorRowNo != -1) { sm.addSelectionInterval(anchorRowNo, anchorRowNo); scrollRowToVisible(anchorRowNo); } } finally { setSilentTemp(silent); } } else { itsSortColumn = null; itsSortDescending = false; } if (itsLockedTableView != null) itsLockedTableView.getTableHeader().repaint(); if (itsScrolledTableView != null) itsScrolledTableView.getTableHeader().repaint(); } /** * Sort the table on the specified column. If row moving is allowed, or the column isn't sortable, nothing * happens. * @param pColumn The column, or null to revert to natural sort order. * @return true if the table was sorted. * @since 4.0 * @changed 4.4 */ public boolean sortByColumn(DoiTableColumn pColumn) { if (pColumn != null && !pColumn.isSortable()) return false; boolean sorted; if (itsTableModel == null || itsRowMoveAllowed || pColumn == null || !pColumn.isSortable()) { itsSortColumn = null; itsSortDescending = false; sorted = false; } else { List nameList = new ArrayList(); for (DoiTableColumn c = pColumn; c != null; c = c.getSecondarySortColumn()) { String name = c.getName(); if (nameList.contains(name)) break; nameList.add(name); } String[] names = nameList.toArray(new String[nameList.size()]); boolean[] descs = null; if (itsSortDescending) { descs = new boolean[names.length]; Arrays.fill(descs, true); } sort(names, descs); sorted = true; } return sorted; } /** * Invoked when a change event is sent from the table model. * @param pEvent The event sent. * @since 4.0 */ protected void tableChanged(TableModelEvent pEvent) { if (pEvent.getSource() != itsTableModel) return; if (isSilent()) return; if (pEvent.getType() == TableModelEvent.INSERT) { for (int i = pEvent.getFirstRow(); i <= pEvent.getLastRow(); ++i) if (itsTableModel.isRowDirty(i)) { getSupport().setState(DIRTY); break; } } else { getSupport().setState(DIRTY); } if (pEvent.getType() == TableModelEvent.UPDATE) { int rowNo = pEvent.getFirstRow(); int colNo = pEvent.getColumn(); if (rowNo < itsTableModel.getRowCount() && rowNo == pEvent.getLastRow()) { setContextRowNo(rowNo); if (colNo > 0) { DoiTableColumn column = getColumnByModelColNo(colNo); if (column != null) column.setValue(itsTableModel.getValueAt(rowNo, colNo), CLEAN, pEvent); } else if (colNo == 0) { DoiTableRowStateEventListener handler = (DoiTableRowStateEventListener)getSupport().getHandlerEventListener("rowState"); if (handler != null) { DoiTableRowStateEvent event = new DoiTableRowStateEvent(this, rowNo); handler.rowStateChanged(event); } } } } getSupport().fireValueChanged(this, pEvent, DIRTY); } /** * Return the tooltip text based on the mouse position. The default implementation determines the model row and column numbers * and invokes {@link #toolTipText(DoiTable.TableView, int, int, int)}. * @param pTableView The table view. * @param pEvent The mouse event. * @return The text, or null. * @since 4.2 * @changed 4.4 */ public String toolTipText(TableView pTableView, MouseEvent pEvent) { int rowNo = pTableView.rowAtPoint(pEvent.getPoint()); if (rowNo < 0 || rowNo > getRowCount()) return null; TableColumnModel columnModel = pTableView.getColumnModel(); int viewColNo = columnModel.getColumnIndexAtX(pEvent.getX()); if (viewColNo < 0) return null; int modelColNo = columnModel.getColumn(viewColNo).getModelIndex(); if (modelColNo < 0) return null; return toolTipText(pTableView, rowNo, modelColNo, viewColNo); } /** * Return the tooltip text for the specified row and column. Invoked by {@link DoiTableColumn#toolTipText}. * The default implementation returns the String representation of the cell value. * @param pRowNo The 0-based row number. * @param pColNo The 0-based column number withing the table model. * @return The text, or null. * @since 4.2 * @changed 4.4 */ public String toolTipText(int pRowNo, int pColNo) { Object value = getTableModel().getValueAt(pRowNo, pColNo); return value != null ? value.toString() : null; } /** * Return the tooltip text for the specified row and column. Invoked by {@link #toolTipText(TableView, MouseEvent)}. * First the column is asked to provide a tooltip, then any table level tooltip handler is invoked. * @param pTableView The table view. * @param pRowNo The 0-based row number. * @param pModelColNo The 0-based column number withing the table model. * @param pViewColNo The 0-based column number withing the table model. * @return The text, or null. * @see DoiTableColumn#toolTipText * @since 4.4 */ public String toolTipText(TableView pTableView, int pRowNo, int pModelColNo, int pViewColNo) { String tooltip = null; DoiTableColumn column = getColumnByModelColNo(pModelColNo); if (column != null) tooltip = column.toolTipText(pTableView, pRowNo, pModelColNo, pViewColNo); DoiTableCellTooltipEventListener handler = (DoiTableCellTooltipEventListener)getSupport().getHandlerEventListener("toolTipText"); DoiTableCellTooltipEvent event = null; if (handler != null) { event = new DoiTableCellTooltipEvent(pTableView, pRowNo, pModelColNo, pViewColNo, tooltip); handler.cellTooltip(event); tooltip = event.getTooltip(); } return tooltip; } /** * Validate the value of this component. * First, any registered validation handler is invoked using {@link DoiValidateEventListener#beforeValidateValue}. * Unless the handler consumes the event, the following validations are done: *
    *
  • All mandatory columns are checked to ensure that they have a value on dirty rows that isn't marrked for deletion.
  • *
* Finally, any registered validation handler is invoked using {@link DoiValidateEventListener#afterValidateValue}. * @throws DoiValidationException If this component or any subcomponent is invalid. * @throws IOException If an I/O error occurs. * @since 4.1 */ @Override public void validateValue() throws DoiValidationException, IOException { DoiValidateEventListener handler = (DoiValidateEventListener)getSupport().getHandlerEventListener("validateValue"); DoiValidateEvent event = null; if (handler != null) { event = new DoiValidateEvent(this); handler.beforeValidateValue(event); if (event.isConsumed()) return; event.throwException(); } EfiTableModel tm = getTableModel(); int rc = tm.getRowCount(); int cc = getColumnCount(); for (int ri = 0; ri < rc; ++ri) { if (!tm.isRow(ri) || !tm.isRowDirty(ri)) continue; setContextRowNo(ri); for (int ci = 0; ci < cc; ++ci) { DoiTableColumn column = getColumn(ci); if (column.isHidden()) continue; try { column.validateValue(); } catch (DoiValidationException ex) { ex.setPosition(ri); throw ex; } } } if (event != null) { handler.afterValidateValue(event); event.throwException(); } } //////////////////////////////////////////////////////////////////////////////// // Classes. /** * Container for columns during design time. * * @since 4.0 * @version 4.4 */ protected static class ColumnContainer extends JPanel implements ContainerListener { /** * Construct a new column container. * @since 4.0 */ protected ColumnContainer() { super(new FlowLayout(FlowLayout.LEFT, 0, 0)); addContainerListener(this); setBackground(UIManager.getColor("Panel.background")); setBorder(BorderFactory.createEtchedBorder()); } /** * Return the column with the specified index * @param pIndex The 0-based column index. * @return The column. * @since 4.0 */ public DoiTableColumn getColumn(int pIndex) { return (DoiTableColumn)getComponent(pIndex); } /** * Set the layout. Overridden to accept only FlowLayout and to adjust its properties. * @since 4.4 */ @Override public void setLayout(LayoutManager pLayout) { if (pLayout instanceof FlowLayout) { FlowLayout fl = (FlowLayout)pLayout; fl.setAlignment(FlowLayout.LEFT); fl.setHgap(0); fl.setVgap(0); super.setLayout(fl); } } /** * Invoked when a component is added. Checks that it is a {@link DoiTableColumn}. * If not, the background color is changed to warn the designer. * @param pEvent The container event. * @since 4.0 */ public void componentAdded(ContainerEvent pEvent) { Component child = pEvent.getChild(); if (!(child instanceof DoiTableColumn)) { child.setForeground(Color.red); child.setBackground(Color.red); setBackground(Color.pink); } } /** * Invoked when a component is removed. Sets the background to warn the designer if * any remaining component is not a {@link DoiTableColumn}. * @param pEvent The container event. * @since 4.0 */ public void componentRemoved(ContainerEvent pEvent) { int n = getComponentCount(); for (int i = 0; i < n; ++i) { if (!(getComponent(i) instanceof DoiTableColumn)) { setBackground(Color.pink); return; } } setBackground(UIManager.getColor("Panel.background")); } } /** * Handles row selection events for the table views. * Ensures that the two list selection models for the locked and scrolled view are kept * synchronized. Any selection changes in one table is propagated to the other and to the outer table. * * @since 4.0 * @version 4.0 */ protected class RowSelectionListener implements ListSelectionListener { private ListSelectionModel itsSelMod1, itsSelMod2; private boolean itsWorking; /** * Construct a new listener for row selections. * @param pTable1 The locked table view. * @param pTable2 The horizontally scrolled table view. * @since 4.0 */ public RowSelectionListener(JTable pTable1, JTable pTable2) { itsSelMod1 = pTable1.getSelectionModel(); itsSelMod2 = pTable2.getSelectionModel(); itsSelMod1.addListSelectionListener(this); itsSelMod2.addListSelectionListener(this); } /** * Invoked when the table views are disposed, to stop listening for row selection * events. * @since 4.0 */ public void dispose() { itsSelMod1.removeListSelectionListener(this); itsSelMod2.removeListSelectionListener(this); } /** * Invoked when a row is selected or deselected. * @param pEvent The selection event. * @since 4.0 */ public void valueChanged(ListSelectionEvent pEvent) { // Make sure this event is not a result of an ongoing synchronization. if (itsWorking) return; try { itsWorking = true; // Determine the source and target tables. ListSelectionModel source = null, target = null; if (pEvent.getSource() == itsSelMod1) { source = itsSelMod1; target = itsSelMod2; } if (pEvent.getSource() == itsSelMod2) { source = itsSelMod2; target = itsSelMod1; } if (source == null || target == null) return; // Synchronize. int last = pEvent.getLastIndex(); for (int i = pEvent.getFirstIndex(); i <= last; ++i) { if (source.isSelectedIndex(i)) target.addSelectionInterval(i, i); else target.removeSelectionInterval(i, i); } // Notify. rowSelected(pEvent); } finally { itsWorking = false; } } } /** * Controller for mouse events. Executed the RowActivate action when a row * activation event occurs, usually double click. * * @author Copyright © Gunnar Grim * @since 4.0 * @version 4.0 */ protected class MouseController extends MouseAdapter { /** * Invoked when the mouse is clicked. * @param pEvent The event. * @since 4.0 */ @Override public void mouseClicked(MouseEvent pEvent) { if (pEvent.isPopupTrigger()) return; if (!itsRowActivateSupported) return; JTable tv = (JTable)pEvent.getComponent(); if (tv == getLockedTableView()) DoiTable.this.requestFocusInWindow(); int cc = itsSingleClickRowActivationSuppressed ? 2 : DoiApplication.instance().getActivationClickCount(); if (pEvent.getClickCount() != cc) return; try { int colNo = tv.columnAtPoint(pEvent.getPoint()); if (colNo < 0) return; int rowNo = tv.rowAtPoint(pEvent.getPoint()); if (rowNo < 0) return; getActionSet().execute("RowActivate", pEvent.getModifiersEx()); } catch (ClassCastException ex) {} } } /** * An inner table view. The table component contains two views: One for the locked part, * containing the row flag column and other locked columns, and one view for the part that * may be horizontally scrolled. * * @since 4.0 * @version 4.4 */ public class TableView extends JTable { /** * Listener for focus events on cell editors. */ private CellFocusListener itsCellFocusListener; /** * Indicates if a TAB key is currently being processed by {@link #processKeyEvent} and smart tabbing is applicable, * i e the table is editable and smart tabbing is used. A value of FALSE indicates that a back-tab has * been used. */ private Boolean itsProcessingSmartTab; /** * Previously selected row and column number. Used for smart tabbing to determine the direction to move. */ private int itsPrevSmartTabRowNo = -1, itsPrevSmartTabColNo = -1; /** * Construct a new table view. * @param pTableModel The table model. * @param pColumnModel The column model. * @param pLocked true if this is the locked view. * @since 4.0 */ protected TableView(EfiTableModel pTableModel, TableColumnModel pColumnModel, boolean pLocked) { super(pTableModel, pColumnModel); setAutoCreateColumnsFromModel(false); setColumnSelectionAllowed(false); setSurrendersFocusOnKeystroke(true); setIntercellSpacing(itsIntercellSpacing); DoiContextMenuController.instance().installOn(this); addMouseListener(itsMouseController); DoiComponentSupport.mapAction(this, getAction("RowActivate"), false, true); DoiComponentSupport.mapAction(this, getAction("Lookup"), true, true); Iterator it = getToolBarActionList().iterator(); while (it.hasNext()) { DoiAction action = (DoiAction)it.next(); if (action != null) DoiComponentSupport.mapAction(this, action, false, false); } DoiComponentSupport.aatext(this); if (!Beans.isDesignTime() && DoiApplication.instance().hasFeature(DoiApplication.FEATURE_DebugMode)) { setDragEnabled(true); setTransferHandler(new TransferHandler("selectedObjectKeys")); setDropTarget(new DndTarget()); } } /** * Invoked when this component is added to some container. * Invokes {@link DoiComponentSupport#mapDialogActions}. * @since 4.0 */ @Override public void addNotify() { super.addNotify(); DoiComponentSupport.mapDialogActions(this); } /** * Invoked when editing is finished. Trims the value before updating the model. * If the resulting string is empty it is replaced with null. * @param pEvent The event. * @since 4.0 */ @Override public void editingStopped(ChangeEvent pEvent) { TableCellEditor editor = getCellEditor(); if (editor != null) { int viewColNo = editingColumn; Object newValue = editor.getCellEditorValue(); if (newValue instanceof String) { String s = ((String)newValue).trim(); if (s.length() == 0) s = null; newValue = s; } Object oldValue = getValueAt(editingRow, viewColNo); setValueAt(newValue, editingRow, viewColNo); removeEditor(); DoiTableColumn column = getColumnByViewColNo(this, viewColNo); if (column != null) column.editingStopped(this, oldValue, newValue); if (itsCellFocusListener != null) { if (editor instanceof DefaultCellEditor) { DefaultCellEditor dce = (DefaultCellEditor)editor; JComponent ec = (JComponent)dce.getComponent(); ec.removeFocusListener(itsCellFocusListener); } itsCellFocusListener = null; } // itsProcessingSmartTab = Boolean.TRUE; } } /** * Test if the specified cell is editable. Delegates to * {@link DoiTable#isCellEditable}. * @param pRowNo The 0-based row number. * @param pViewColNo The 0-based column number within the view. * @return true if the cell is editable. * @since 4.4 */ @Override public boolean isCellEditable(int pRowNo, int pViewColNo) { return DoiTable.this.isCellEditable(this, pRowNo, pViewColNo); } /** * Return a cell editor for the specified cell. Overridden to map the "EditRowInsert" action. * @since 4.0 */ @Override public TableCellEditor getCellEditor(int pRowNo, int pColNo) { TableCellEditor editor = super.getCellEditor(pRowNo, pColNo); if (editor instanceof DefaultCellEditor) { DefaultCellEditor dce = (DefaultCellEditor)editor; JComponent ec = (JComponent)dce.getComponent(); DoiAction action = getAction("EditRowInsert"); ec.getInputMap().put(action.getAcceleratorKey(), "EditRowInsert"); ec.getActionMap().put("EditRowInsert", action); DoiTableColumn column = getColumnByViewColNo(this, pColNo); if (column != null) { itsCellFocusListener = new CellFocusListener(column); ec.addFocusListener(itsCellFocusListener); } } return editor; } /** * Return a suitable cell renderer for the specified cell. * @param pRowNo The row number. * @param pColNo The column number in the table view. * @return The renderer. * @since 4.0 * @changed 4.2 */ @Override public TableCellRenderer getCellRenderer(int pRowNo, int pColNo) { TableCellRenderer renderer = super.getCellRenderer(pRowNo, pColNo); DoiComponentSupport.aatext((JComponent)renderer); return renderer; } /** * Return the column class for the specified column. Delegates to * {@link DoiTable#getColumnClass}. * @param pViewColNo The 0-based column number within the view. * @return The column class. * @since 4.4 */ @Override public Class getColumnClass(int pViewColNo) { return DoiTable.this.getColumnClass(this, pViewColNo); } /** * Invoked when cell editing is started or stopped. Notifies the outer table. * @param pColNo The column number within the view. * @since 4.0 */ @Override public void setEditingColumn(int pColNo) { super.setEditingColumn(pColNo); if (DoiTable.this != null) if (pColNo >= 0) DoiTable.this.editingStarted(this, pColNo); else DoiTable.this.editingStopped(this); } /** * Return the preferred size of the viewport, based on the recommeded number of * visible rows. * @return The size. * @since 4.0 */ @Override public Dimension getPreferredScrollableViewportSize() { JTableHeader th = getTableHeader(); if (th == null) { Dimension dim = super.getPreferredScrollableViewportSize(); dim.height = getVisibleRowCount()*getRowHeight(); return dim; } Dimension dim = th.getPreferredSize(); dim.height = (th != null) ? th.getHeight() : 0; dim.height += getVisibleRowCount()*getRowHeight(); return dim; } /** * Return the outer table. * @return The table. * @since 4.4 */ public DoiTable getTable() { return DoiTable.this; } /** * Return the tooltip text based on the mouse position. * @param pEvent The event. * @return The text, or null. * @since 4.2 */ @Override public String getToolTipText(MouseEvent pEvent) { return DoiTable.this.toolTipText(this, pEvent); } /** * Prepare an editor. Overridden to set the context row. * @param pEditor The TableCellEditor to set up. * @param pRowNo The 0-based row number. * @param pColNo The 0-based column number. * @return The Component being edited. * @since 4.4 */ @Override public Component prepareEditor(TableCellEditor pEditor, int pRowNo, int pColNo) { setContextRowNo(pRowNo); return super.prepareEditor(pEditor, pRowNo, pColNo); } /** * Prepare a cell renderer. Overridden to adjust the horizontal alignment and * invoke {@link DoiTable#prepareCellRenderer}. * @since 4.2 */ @Override public Component prepareRenderer(TableCellRenderer pRenderer, int pRowNo, int pColNo) { if (pRenderer instanceof JLabel) prepareRendererAlignment((JLabel)pRenderer, pRowNo, pColNo); else if (pRenderer instanceof JCheckBox) prepareRendererAlignment((JCheckBox)pRenderer, pRowNo, pColNo); Component component = super.prepareRenderer(pRenderer, pRowNo, pColNo); prepareCellRenderer(this, pRenderer, component, pRowNo, pColNo); return component; } /** * Prepare the horizontal alignment of a cell renderer checkbox. * Used by {@link #prepareRenderer(TableCellRenderer, int, int)} * @since 4.4 */ public void prepareRendererAlignment(JCheckBox pRenderer, int pRowNo, int pColNo) { DoiTableColumn column = getColumnByViewColNo(this, pColNo); if (column != null) { int al = column.getHorizontalAlignment(); if (al != -1) { pRenderer.setHorizontalAlignment(al); } else { pRenderer.setHorizontalAlignment(CENTER); } } } /** * Prepare the horizontal alignment of a cell renderer label. * Used by {@link #prepareRenderer(TableCellRenderer, int, int)} * @since 4.4 */ public void prepareRendererAlignment(JLabel pRenderer, int pRowNo, int pColNo) { DoiTableColumn column = getColumnByViewColNo(this, pColNo); if (column != null) { int al = column.getHorizontalAlignment(); if (al != -1) { pRenderer.setHorizontalAlignment(al); } else if (!(pRenderer instanceof DoiTableCellDropDownRenderer)) { Class cc = column.getValueClass(); if (Number.class.isAssignableFrom(cc)) { pRenderer.setHorizontalAlignment(RIGHT); } else { pRenderer.setHorizontalAlignment(LEFT); } } } } /** * Process a key event. Overridden to handle focus keys. * @param pEvent The key event. * @since 4.0 */ @Override public void processKeyEvent(KeyEvent pEvent) { if (pEvent.getID() == KeyEvent.KEY_PRESSED && pEvent.getKeyCode() == KeyEvent.VK_TAB) { boolean cyclic = isEditable() ? isFocusCyclicWhenEditable() : isFocusCyclicWhenReadOnly(); if (!cyclic) { if (pEvent.isShiftDown()) transferFocusBackward(); else transferFocus(); pEvent.consume(); } else { try { itsProcessingSmartTab = Boolean.valueOf(!pEvent.isShiftDown()); super.processKeyEvent(pEvent); } finally { itsProcessingSmartTab = null; } } } else { super.processKeyEvent(pEvent); } } /** * Change the selection. Overridden to refresh the lookup indicator. * @since 4.0 */ @Override public void changeSelection(int pRowNo, int pColNo, boolean pToggle, boolean pExtend) { // Check if next editable cell should be selected. if (itsProcessingSmartTab != null) { int rowNo = pRowNo; int colNo = pColNo; int rc = getRowCount(); int cc = getColumnCount(); if (rowNo != itsPrevSmartTabRowNo || colNo != itsPrevSmartTabColNo) { if (itsProcessingSmartTab.booleanValue()) { while (rowNo < rc) { if (isCellEditable(rowNo, colNo)) { pRowNo = rowNo; pColNo = colNo; break; } ++colNo; if (colNo >= cc) { colNo = 0; ++rowNo; if (rowNo >= rc) rowNo = 0; } if (rowNo == pRowNo && colNo == pColNo) break; } } else { while (rowNo >= 0) { if (isCellEditable(rowNo, colNo)) { pRowNo = rowNo; pColNo = colNo; break; } --colNo; if (colNo < 0) { colNo = cc-1; --rowNo; if (rowNo < 0) rowNo = rc-1; } if (rowNo == pRowNo && colNo == pColNo) break; } } } itsProcessingSmartTab = null; } DoiTableColumn column = getColumnByViewColNo(this, pColNo); if (column != null) column.refreshLookupIndicator(); itsPrevSmartTabRowNo = pRowNo; itsPrevSmartTabColNo = pColNo; super.changeSelection(pRowNo, pColNo, pToggle, pExtend); } /** * Deselects all selected columns and rows. * @since 4.2 */ @Override public void clearSelection() { super.clearSelection(); } } /** * Focus listener attached to the edited cell. * @since 4.0.0 */ private class CellFocusListener extends FocusAdapter { private DoiTableColumn itsColumn; private CellFocusListener(DoiTableColumn pColumn) { itsColumn = pColumn; } /** * Invoked when the inner component gains focus. * * @param pEvent The focus event. */ @Override public void focusGained(FocusEvent pEvent) { itsColumn.refreshLookupIndicator(); } /** * Invoked when the inner component loses focus. * * @param pEvent The focus event. */ @Override public void focusLost(FocusEvent pEvent) { } } /** * Drag-and-drop target. */ private class DndTarget extends DropTarget { /** * Invoked when a drag enters the view. This implementation does nothing. * * @param pEvent The event. */ @Override public void dragEnter(DropTargetDragEvent pEvent) { } } } ----- Tree: ------------------------------------------------------- public static final EfiComparator CELLCOMP at org.netbeans.modules.java.source.usages.RepositoryUpdater.couplingAbort(RepositoryUpdater.java:3142) at org.netbeans.modules.java.source.TreeLoader.loadTreeFor(TreeLoader.java:103) at com.sun.tools.javac.model.JavacElements.getTreeAndTopLevel(JavacElements.java:627) at com.sun.tools.javac.model.JavacElements.getTreeAndTopLevel(JavacElements.java:653) at com.sun.tools.javac.api.JavacTrees.getPath(JavacTrees.java:168) at com.sun.tools.javac.api.JavacTrees.getPath(JavacTrees.java:160) at org.netbeans.modules.editor.java.GoToSupport$1.run(GoToSupport.java:245) at org.netbeans.modules.editor.java.GoToSupport$1.run(GoToSupport.java:132) at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:613) at org.netbeans.modules.editor.java.GoToSupport.performGoTo(GoToSupport.java:131) at org.netbeans.modules.editor.java.GoToSupport.goTo(GoToSupport.java:296) at org.netbeans.modules.java.editor.hyperlink.JavaHyperlinkProvider.performClickAction(JavaHyperlinkProvider.java:79) at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.performAction(HyperlinkOperation.java:253) at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.mouseClicked(HyperlinkOperation.java:396) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252) at java.awt.Component.processMouseEvent(Component.java:6041) at javax.swing.JComponent.processMouseEvent(JComponent.java:3260) at java.awt.Component.processEvent(Component.java:5803) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4410) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3995) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916) at java.awt.Container.dispatchEventImpl(Container.java:2102) at java.awt.Window.dispatchEventImpl(Window.java:2429) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)