diff --git a/accessibility/prj/build.lst b/accessibility/prj/build.lst index 2288410ffba8..351473e38450 100755 --- a/accessibility/prj/build.lst +++ b/accessibility/prj/build.lst @@ -9,3 +9,9 @@ ac accessibility\source\helper nmake - all ac_h ac accessibility\source\standard nmake - all ac_standard ac_helper ac_inc NULL ac accessibility\source\extended nmake - all ac_extended ac_inc NULL ac accessibility\util nmake - all ac_util ac_helper ac_standard ac_extended NULL +ac accessibility\workben\org\openoffice\accessibility\awb nmake - all ac_awb_main ac_awb_misc ac_awb_canvas ac_awb_view ac_awb_tree NULL +ac accessibility\workben\org\openoffice\accessibility\misc nmake - all ac_awb_misc NULL +ac accessibility\workben\org\openoffice\accessibility\awb\canvas nmake - all ac_awb_canvas ac_awb_tree NULL +ac accessibility\workben\org\openoffice\accessibility\awb\tree nmake - all ac_awb_tree ac_awb_misc NULL +ac accessibility\workben\org\openoffice\accessibility\awb\view nmake - all ac_awb_view ac_awb_view_text NULL +ac accessibility\workben\org\openoffice\accessibility\awb\view\text nmake - all ac_awb_view_text NULL diff --git a/accessibility/workben/TODO b/accessibility/workben/TODO new file mode 100644 index 000000000000..6fdfd5cb81aa --- /dev/null +++ b/accessibility/workben/TODO @@ -0,0 +1,13 @@ +This is a unsorted list of TODO's and idea regarding the Accessibility Workbench + +* increase repaint performance +* fix paint problems in ObjectViewContainer for e.g. File menu +* change package structure to be flat (apps don't need deep package names) +* add ant build script(s) +* evaluate TreeTable as enhanced overview +* add error panel and a bunch of consistency checks +* add focus tracking mode +* evaluate drawing transparent frames at screen coordinates of an object +* enhance text view (colors) +* add table view +* more generic view loading (Class.forName()) diff --git a/accessibility/workben/makefile b/accessibility/workben/makefile new file mode 100644 index 000000000000..4bd7c05e44dd --- /dev/null +++ b/accessibility/workben/makefile @@ -0,0 +1,9 @@ +all: + cd source/org/openoffice/accessibility ; $(MAKE) all + +ROOT=source +SUBDIRS=source/org/openoffice/accessibility +include source/makefile.in + +run: all + $(JAVA) -classpath $(CLASSPATH) org.openoffice.accessibility.awb.AccessibilityWorkBench diff --git a/accessibility/workben/makefile.in b/accessibility/workben/makefile.in new file mode 100644 index 000000000000..ad97448e7780 --- /dev/null +++ b/accessibility/workben/makefile.in @@ -0,0 +1,32 @@ +PRJ=$(ROOT)/.. +SETTINGS=$(OO_SDK_HOME)/settings +include $(SETTINGS)/settings.mk +include $(SETTINGS)/std.mk +include $(SETTINGS)/dk.mk + +OUT_COMP_JAVA = $(OUT_CLASS)/$(patsubst .,/,$(PACKAGE)) +JAVAC=$(JAVA_HOME)/bin/javac +JAVA=$(JAVA_HOME)/bin/java +CLASS_FILES = $(patsubst %.java, %.class, $(JAVAFILES)) +CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(OFFICE_CLASSES_DIR)/jurt.jar\ + $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)/unoil.jar\ + $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)/ridl.jar\ + $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)/sandbox.jar\ + $(PATH_SEPARATOR)$(OFFICE_CLASSES_DIR)/juh.jar\ + $(PATH_SEPARATOR)$(OUT_COMP_JAVA)\ + $(PATH_SEPARATOR).\ + $(PATH_SEPARATOR)$(ROOT)\ + ) + +subdirs: + $(foreach dir,$(SUBDIRS), cd $(dir);$(MAKE);cd ..;) + +clean: + -rm *.class *.jar + $(foreach dir,$(SUBDIRS), cd $(dir);$(MAKE) clean ; cd ..;) + + +%.class : %.java + $(JAVAC) -classpath $(CLASSPATH) $< + +.PHONY: all package clean subdirs diff --git a/accessibility/workben/makefile.mk b/accessibility/workben/makefile.mk new file mode 100644 index 000000000000..33c1e2a0ef5e --- /dev/null +++ b/accessibility/workben/makefile.mk @@ -0,0 +1,40 @@ +# copied from settings.mk +SOLARBINDIR=$(SOLARVERSION)$/$(INPATH)$/bin$(UPDMINOREXT) + +# Please modify the following lines to match your environment: +# If you use the run: target at the end of the file, then adapt pipe name +PIPE_NAME = $(USER) + +# The following variables probably don't need to be changed. +JAVA = java +# The JAR_PATH points to the jar files of your local office installation. +JAR_PATH = $(SOLARBINDIR)$/ + + +# The rest of this makefile should not need to be touched. + +JAR_FILES = \ + unoil.jar \ + sandbox.jar \ + ridl.jar \ + jurt.jar \ + juh.jar \ + java_uno.jar + + +JAVA_CLASSPATHS := \ + ..$/$(INPATH)$/class \ + $(foreach,i,$(JAR_FILES) $(JAR_PATH)$i) \ + $(CLASSPATH) + +CLASSPATH !:=$(JAVA_CLASSPATHS:t$(PATH_SEPERATOR)) + +all: + build + +# Example of how to run the work bench. +run: + +$(JAVA) -classpath "$(CLASSPATH)" org/openoffice/accessibility/awb/AccessibilityWorkBench -p $(PIPE_NAME) + +runjar: + +$(JAVA) -classpath "$(CLASSPATH)" -jar AccessibilityWorkBench.jar -p $(PIPE_NAME) diff --git a/accessibility/workben/org/openoffice/accessibility/Makefile b/accessibility/workben/org/openoffice/accessibility/Makefile new file mode 100644 index 000000000000..a6db6a05ab4b --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/Makefile @@ -0,0 +1,6 @@ +all : subdirs + +ROOT=../../../ +SUBDIRS=misc awb +include $(ROOT)/makefile.in + diff --git a/accessibility/workben/org/openoffice/accessibility/awb/AccessibilityWorkBench.java b/accessibility/workben/org/openoffice/accessibility/awb/AccessibilityWorkBench.java new file mode 100644 index 000000000000..fd1d0e1fa13d --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/AccessibilityWorkBench.java @@ -0,0 +1,724 @@ +/************************************************************************* + * + * $RCSfile: AccessibilityWorkBench.java,v $ + * + * $Revision: 1.3 $ + * + * last change: $Author: obr $ $Date: 2008/05/14 13:21:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb; + +import java.awt.Cursor; +import java.awt.GridBagConstraints; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.JComponent; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JRadioButtonMenuItem; +import javax.swing.JScrollPane; +import javax.swing.JSplitPane; +import javax.swing.event.TreeSelectionListener; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeExpansionListener; +import javax.swing.event.TreeWillExpandListener; +import javax.swing.tree.TreeNode; +import javax.swing.tree.TreePath; + +import com.sun.star.accessibility.XAccessible; +import com.sun.star.awt.XExtendedToolkit; +import com.sun.star.frame.XFrame; +import com.sun.star.frame.XTerminateListener; +import com.sun.star.lang.EventObject; +import com.sun.star.uno.UnoRuntime; + +import org.openoffice.accessibility.misc.MessageArea; +import org.openoffice.accessibility.misc.Options; +import org.openoffice.accessibility.misc.OfficeConnection; +import org.openoffice.accessibility.misc.SimpleOffice; +import org.openoffice.accessibility.awb.canvas.Canvas; +import org.openoffice.accessibility.awb.tree.AccessibilityTree; +import org.openoffice.accessibility.awb.tree.AccessibilityModel; +import org.openoffice.accessibility.awb.tree.DynamicAccessibilityModel; +import org.openoffice.accessibility.awb.view.ObjectViewContainer; +import org.openoffice.accessibility.awb.view.ObjectViewContainerWindow; + + + +/** This class manages the GUI of the work bench. + @see AccessibilityTreeModel + for the implementation of the tree view on the left side which also + manages the registration of accessibility listeners. + @see Canvas + for the graphical view of the accessible objects. +*/ +public class AccessibilityWorkBench + extends JFrame + implements XTerminateListener, + ActionListener, + TreeSelectionListener +{ + public static final String msVersion = "v1.9"; + public String msOptionsFileName = ".AWBrc"; + + public static void main (String args[]) + { + String sPipeName = System.getenv( "USER" ); + + for (int i=0; i*"); + System.out.println ("options:"); + System.out.println (" -p name of the pipe to use to connect to OpenOffice.org."); + System.out.println (" Defaults to $USER."); + System.exit (0); + } + else if (args[i].equals ("-p")) + { + sPipeName = args[++i]; + } + } + + saWorkBench = new AccessibilityWorkBench (sPipeName); + } + + + + + /** Return the one instance of the AccessibilityWorkBench + @return + Returns null when the AccessibilityWorkBench could not be + created successfully. + */ + public static AccessibilityWorkBench Instance () + { + return saWorkBench; + } + + + + /** Create an accessibility work bench that listens at the specified + port to Office applications. + */ + private AccessibilityWorkBench (String sPipeName) + { + mbInitialized = false; + + OfficeConnection.SetPipeName (sPipeName); + Options.Instance().Load (msOptionsFileName); + Layout (); + + MessageArea.println (System.getProperty ("os.name") + " / " + + System.getProperty ("os.arch") + " / " + + System.getProperty ("os.version")); + MessageArea.println ("Using pipe name " + sPipeName); + + maTree.addTreeSelectionListener (this); + + addWindowListener (new WindowAdapter () + { public void windowClosing (WindowEvent e) {Quit();} } + ); + + OfficeConnection.Instance().AddConnectionListener (this); + Initialize (); + } + + + + + /** Create and arrange the widgets of the GUI. + */ + public void Layout () + { + setSize (new java.awt.Dimension (800,600)); + + JScrollPane aScrollPane; + GridBagConstraints constraints; + + // Create new layout. + java.awt.GridBagLayout aLayout = new java.awt.GridBagLayout (); + getContentPane().setLayout (aLayout); + + // Accessible Tree. + javax.swing.tree.TreeModel treeModel = new DynamicAccessibilityModel(); + maTree = new AccessibilityTree(treeModel); + // Add the model as tree listeners to be able to populate/clear the + // child lists on demand. + maTree.addTreeExpansionListener((TreeExpansionListener) treeModel); + maTree.addTreeWillExpandListener((TreeWillExpandListener) treeModel); + + JScrollPane aTreeScrollPane = new JScrollPane( + maTree, + JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, + JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); + aTreeScrollPane.setPreferredSize (new java.awt.Dimension (400,300)); + + // Object view shows details about the currently selected accessible + // object. + maObjectViewContainer = new ObjectViewContainer (); + JScrollPane aObjectViewContainerScrollPane = new JScrollPane( + maObjectViewContainer, + JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, + JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); + aObjectViewContainerScrollPane.setPreferredSize ( + new java.awt.Dimension (400,300)); + JButton aCornerButton = new JButton ("CreateNewViewWindow"); + aCornerButton.addActionListener (this); + aObjectViewContainerScrollPane.setCorner ( + JScrollPane.LOWER_RIGHT_CORNER, + aCornerButton); + + // Split pane for tree view and object view. + JSplitPane aLeftViewSplitPane = new JSplitPane ( + JSplitPane.VERTICAL_SPLIT, + aTreeScrollPane, + aObjectViewContainerScrollPane + ); + aLeftViewSplitPane.setDividerLocation (300); + aLeftViewSplitPane.setContinuousLayout (true); + + // Canvas. + maCanvas = new Canvas (); + maCanvas.SetTree (maTree); + JScrollPane aScrolledCanvas = new JScrollPane(maCanvas, + JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, + JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); + aScrolledCanvas.getViewport().setBackground (java.awt.Color.RED); + aScrolledCanvas.setPreferredSize (new java.awt.Dimension(600,400)); + + // Split pane for tree view and canvas. + JSplitPane aViewSplitPane = new JSplitPane ( + JSplitPane.HORIZONTAL_SPLIT, + aLeftViewSplitPane, + aScrolledCanvas + ); + aViewSplitPane.setOneTouchExpandable(true); + aViewSplitPane.setDividerLocation (400); + aViewSplitPane.setContinuousLayout (true); + + // Split pane for the three views at the top and the message area. + MessageArea.Instance().setPreferredSize (new java.awt.Dimension(600,50)); + JSplitPane aSplitPane = new JSplitPane ( + JSplitPane.VERTICAL_SPLIT, + aViewSplitPane, + MessageArea.Instance()); + aSplitPane.setOneTouchExpandable(true); + aSplitPane.setContinuousLayout (true); + addGridElement (aSplitPane, 0,0, 2,1, 3,3, + GridBagConstraints.CENTER, GridBagConstraints.BOTH); + + // Button bar. + maButtonBar = new javax.swing.JPanel(); + java.awt.GridBagLayout aButtonLayout = new java.awt.GridBagLayout (); + maButtonBar.setLayout (new java.awt.FlowLayout()); + addGridElement (maButtonBar, 0,3, 2,1, 1,0, + GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL); + + // Buttons. + // maConnectButton = createButton ("Connect", "connect"); + // maUpdateButton = createButton ("Update", "update"); + // maShapesButton = createButton ("Expand Shapes", "shapes"); + maExpandButton = createButton ("Expand All", "expand"); + maQuitButton = createButton ("Quit", "quit"); + UpdateButtonStates (); + + setJMenuBar (CreateMenuBar ()); + + setTitle("Accessibility Workbench " + msVersion); + + setVisible (true); + pack (); + aSplitPane.setDividerLocation (1.0); + validate (); + repaint(); + } + + + + + /** Shortcut method for adding an object to a GridBagLayout. + */ + void addGridElement (JComponent object, + int x, int y, + int width, int height, + int weightx, int weighty, + int anchor, int fill) + { + GridBagConstraints constraints = new GridBagConstraints (); + constraints.gridx = x; + constraints.gridy = y; + constraints.gridwidth = width; + constraints.gridheight = height; + constraints.weightx = weightx; + constraints.weighty = weighty; + constraints.anchor = anchor; + constraints.fill = fill; + getContentPane().add (object, constraints); + } + + + + + /** Create a new button and place at the right most position into the + button bar. + */ + public JButton createButton (String title, String command) + { + JButton aButton = new JButton (title); + aButton.setEnabled (false); + aButton.setActionCommand (command); + aButton.addActionListener (this); + + maButtonBar.add (aButton); + return aButton; + } + + + + + /** Create a menu bar for the application. + @return + Returns the new menu bar. The returned reference is also + remembered in the data member maMenuBar. + */ + javax.swing.JMenuBar CreateMenuBar() + { + // Menu bar. + maMenuBar = new JMenuBar (); + + // File menu. + JMenu aFileMenu = new JMenu ("File"); + maMenuBar.add (aFileMenu); + JMenuItem aItem; + aItem = new JMenuItem ("Quit"); + aFileMenu.add (aItem); + aItem.addActionListener (this); + + // View menu. + JMenu aViewMenu = new JMenu ("View"); + maMenuBar.add (aViewMenu); + ButtonGroup aGroup = new ButtonGroup (); + int nZoomMode = Options.GetInteger ("ZoomMode", Canvas.WHOLE_SCREEN); + JRadioButtonMenuItem aRadioButton = new JRadioButtonMenuItem ( + "Whole Screen", nZoomMode==Canvas.WHOLE_SCREEN); + aGroup.add (aRadioButton); + aViewMenu.add (aRadioButton); + aRadioButton.addActionListener (this); + aRadioButton = new JRadioButtonMenuItem ("200%", nZoomMode==200); + aGroup.add (aRadioButton); + aViewMenu.add (aRadioButton); + aRadioButton.addActionListener (this); + aRadioButton = new JRadioButtonMenuItem ("100%", nZoomMode==100); + aGroup.add (aRadioButton); + aViewMenu.add (aRadioButton); + aRadioButton.addActionListener (this); + aRadioButton = new JRadioButtonMenuItem ("50%", nZoomMode==50); + aGroup.add (aRadioButton); + aViewMenu.add (aRadioButton); + aRadioButton.addActionListener (this); + aRadioButton = new JRadioButtonMenuItem ("25%", nZoomMode==25); + aGroup.add (aRadioButton); + aViewMenu.add (aRadioButton); + aRadioButton.addActionListener (this); + aRadioButton = new JRadioButtonMenuItem ("10%", nZoomMode==10); + aGroup.add (aRadioButton); + aViewMenu.add (aRadioButton); + aRadioButton.addActionListener (this); + + // Options menu. + JMenu aOptionsMenu = new JMenu ("Options"); + maMenuBar.add (aOptionsMenu); + JCheckBoxMenuItem aCBItem; + aCBItem = new JCheckBoxMenuItem ("Show Descriptions", + Options.GetBoolean("ShowDescriptions")); + aOptionsMenu.add (aCBItem); + aCBItem.addActionListener (this); + + aCBItem = new JCheckBoxMenuItem ("Show Names", + Options.GetBoolean ("ShowNames")); + aOptionsMenu.add (aCBItem); + aCBItem.addActionListener (this); + + aCBItem = new JCheckBoxMenuItem ("Show Text", + Options.GetBoolean ("ShowText")); + aOptionsMenu.add (aCBItem); + aCBItem.addActionListener (this); + + aCBItem = new JCheckBoxMenuItem ("Antialiased Rendering", + Options.GetBoolean ("Antialiasing")); + aOptionsMenu.add (aCBItem); + aCBItem.addActionListener (this); + + // Help menu. + JMenu aHelpMenu = new JMenu ("Help"); + maMenuBar.add (aHelpMenu); + + aItem = new JMenuItem ("Help"); + aHelpMenu.add (aItem); + aItem.addActionListener (this); + + aItem = new JMenuItem ("News"); + aHelpMenu.add (aItem); + aItem.addActionListener (this); + + aItem = new JMenuItem ("About"); + aHelpMenu.add (aItem); + aItem.addActionListener (this); + + return maMenuBar; + } + + + + + /** Initialize the AWB. This includes clearing the canvas, add + listeners, creation of a new tree model for the tree list box and + the update of the button states. + + This method may be called any number of times. Note that all + actions will be carried out every time. The main purpose of a + second call is that of a re-initialization after a reconnect. + */ + protected void Initialize () + { + maCanvas.SetTree (maTree); + + SimpleOffice aOffice = SimpleOffice.Instance (); + if (aOffice != null) + { + // Add terminate listener. + if (aOffice.GetDesktop() != null) + aOffice.GetDesktop().addTerminateListener (this); + + } + + mbInitialized = true; + UpdateButtonStates (); + } + + + + + /** Update the states of the buttons according to the internal state of + the AWB. + */ + protected void UpdateButtonStates () + { + // maConnectButton.setEnabled (mbInitialized); + maQuitButton.setEnabled (true); + // maUpdateButton.setEnabled (mbInitialized); + maExpandButton.setEnabled (mbInitialized); + // maShapesButton.setEnabled (mbInitialized); + } + + + + /** Callback for GUI actions from the buttons. + */ + public void actionPerformed (ActionEvent aEvent) + { + String sCommand = aEvent.getActionCommand(); + if (sCommand.equals("connect")) + { + SimpleOffice.Clear(); + Initialize (); + } + else if (sCommand.equals("quit")) + { + Quit (); + } + else if (sCommand.equals("update")) + { +// maTree.Dispose(); + Initialize (); + } + else if (sCommand.equals("shapes")) + { + Cursor aCursor = getCursor(); + setCursor (new Cursor (Cursor.WAIT_CURSOR)); + // maTree.expandShapes(); + setCursor (aCursor); + } + else if (sCommand.equals("expand")) + { + Cursor aCursor = getCursor(); + setCursor (new Cursor (Cursor.WAIT_CURSOR)); + + for (int i=0; i")) + { + Connected (); + } + else if (sCommand.equals ("CreateNewViewWindow")) + { + TreePath aSelectionPath = maTree.getSelectionPath(); + if (aSelectionPath != null) + { + javax.swing.tree.TreeNode aSelectedNode = + (javax.swing.tree.TreeNode)aSelectionPath.getLastPathComponent(); + if (aSelectedNode instanceof XAccessible) { + new ObjectViewContainerWindow (((XAccessible) aSelectedNode).getAccessibleContext()); + } + } + } + else + { + System.err.println("unknown command " + sCommand); + } + } + + + + + /** TreeSelectionListener + Tell the object view and the canvas about the selected object. + */ + public void valueChanged (TreeSelectionEvent aEvent) { + + if (aEvent.isAddedPath()) { + Cursor aCursor = getCursor(); + setCursor (new Cursor (Cursor.WAIT_CURSOR)); + + javax.swing.tree.TreePath aPath = aEvent.getPath(); + maTree.scrollPathToVisible (aPath); + Object aObject = aPath.getLastPathComponent(); + if (aObject instanceof XAccessible) { + XAccessible xAccessible = (XAccessible) aObject; + if (maObjectViewContainer != null) { + ((AccessibilityModel) maTree.getModel()).addEventListener((TreeNode) aObject, maObjectViewContainer); + maObjectViewContainer.SetObject (xAccessible.getAccessibleContext()); + } + } + if (maCanvas != null) + maCanvas.SelectObject ((TreeNode) aObject); + setCursor (aCursor); + } else { + if (maObjectViewContainer != null) { + ((AccessibilityModel) maTree.getModel()).removeEventListener((TreeNode) aEvent.getPath().getLastPathComponent(), maObjectViewContainer); + maObjectViewContainer.SetObject (null); + } + if (maCanvas != null) + maCanvas.SelectObject (null); + } + } + + + + + // XEventListener + public void disposing (EventObject aSourceObj) + { + XFrame xFrame = (XFrame)UnoRuntime.queryInterface( + XFrame.class, aSourceObj.Source); + + if( xFrame != null ) + System.out.println("frame disposed"); + else + System.out.println("controller disposed"); + } + + + + + // XTerminateListener + public void queryTermination(final EventObject aEvent) throws com.sun.star.frame.TerminationVetoException + { + System.out.println ("Terminate Event : " + aEvent); + } + + + + + // XTerminateListener + public void notifyTermination(final EventObject aEvent) + { + System.out.println ("Notifiy Termination Event : " + aEvent); + } + + + /** Called after the AWB is connected to an Office application. + */ + private void Connected () + { + // Clear the tree and by expanding the root node initiate the + // scanning and insertion of nodes for the top-level windows. +// maTree.Clear(); +// maTree.collapseRow (0); +// maTree.expandRow (0); + + // Register the top window listener. + XExtendedToolkit xToolkit = + SimpleOffice.Instance().GetExtendedToolkit(); + if (xToolkit != null) + { + maTree.setToolkit(xToolkit); + } + } + + + /** Called when shutting down the AWB tool. + */ + private void Quit () + { +// maTree.Dispose(); + System.exit (0); + } + + /// The Singleton Workbench object. + private static AccessibilityWorkBench + saWorkBench = null; + + private JPanel maMainPanel; + private JPanel maButtonBar; + private Canvas maCanvas; + private AccessibilityTree maTree; + private ObjectViewContainer maObjectViewContainer; + private JButton + maConnectButton, + maQuitButton, + maUpdateButton, + maExpandButton, + maShapesButton; + private JMenuBar maMenuBar; + private boolean mbInitialized; +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/HelpWindow.java b/accessibility/workben/org/openoffice/accessibility/awb/HelpWindow.java new file mode 100644 index 000000000000..2f9671d191e5 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/HelpWindow.java @@ -0,0 +1,187 @@ +package org.openoffice.accessibility.awb; + +import javax.swing.JFrame; +import javax.swing.JScrollPane; +import javax.swing.JEditorPane; +import javax.swing.JButton; +import java.net.URL; +import javax.swing.event.HyperlinkListener; +import javax.swing.event.HyperlinkEvent; +import java.net.MalformedURLException; +import java.io.IOException; +import java.io.File; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.GridBagLayout; +import java.awt.GridBagConstraints; +import java.awt.event.ActionListener; +import java.util.LinkedList; + +public class HelpWindow + implements ActionListener +{ + public static synchronized HelpWindow Instance () + { + if (maInstance == null) + maInstance = new HelpWindow(); + return maInstance; + } + + public void loadFile (String sFilename) + { + File aFile = new File (sFilename); + try + { + loadURL (aFile.toURL()); + } + catch (MalformedURLException e) + { + e.printStackTrace (System.err); + } + } + public void loadURL (String sURL) + { + try + { + loadURL (new URL (sURL)); + } + catch (MalformedURLException e) + { + e.printStackTrace (System.err); + } + } + + + + + public void loadURL (URL aURL) + { + maHistory.addLast (aURL); + selectHistoryPage (maHistory.size()-1); + maFrame.toFront (); + } + + + + + private HelpWindow () + { + try + { + maCurrentHistoryEntry = -1; + maHistory = new LinkedList(); + + maFrame = new JFrame (); + maFrame.addWindowListener (new WindowAdapter () + { + public void windowClosing (WindowEvent e) + { + maInstance = null; + } + }); + maContent = createContentWidget(); + + maFrame.getContentPane().setLayout (new GridBagLayout()); + GridBagConstraints aConstraints = new GridBagConstraints (); + aConstraints.gridx = 0; + aConstraints.gridy = 0; + aConstraints.gridwidth = 3; + aConstraints.weightx = 1; + aConstraints.weighty = 1; + aConstraints.fill = GridBagConstraints.BOTH; + maFrame.getContentPane().add (new JScrollPane (maContent), aConstraints); + + aConstraints = new GridBagConstraints(); + aConstraints.gridx = 0; + aConstraints.gridy = 1; + maPrevButton = new JButton ("Prev"); + maFrame.getContentPane().add (maPrevButton, aConstraints); + maPrevButton.addActionListener (this); + + aConstraints = new GridBagConstraints(); + aConstraints.gridx = 1; + aConstraints.gridy = 1; + maNextButton = new JButton ("Next"); + maFrame.getContentPane().add (maNextButton, aConstraints); + maNextButton.addActionListener (this); + + aConstraints = new GridBagConstraints(); + aConstraints.gridx = 2; + aConstraints.gridy = 1; + aConstraints.anchor = GridBagConstraints.EAST; + JButton aButton = new JButton ("Close"); + maFrame.getContentPane().add (aButton, aConstraints); + aButton.addActionListener (this); + + maFrame.setSize (600,400); + maFrame.setVisible (true); + } + catch (Exception e) + {} + } + + public void actionPerformed (java.awt.event.ActionEvent e) + { + if (e.getActionCommand().equals("Prev")) + { + selectHistoryPage (maCurrentHistoryEntry - 1); + } + else if (e.getActionCommand().equals("Next")) + { + selectHistoryPage (maCurrentHistoryEntry + 1); + } + else if (e.getActionCommand().equals("Close")) + { + maFrame.dispose (); + maInstance = null; + } + } + + private JEditorPane createContentWidget () + { + JEditorPane aContent = new JEditorPane (); + aContent.setEditable (false); + aContent.addHyperlinkListener (new HyperlinkListener() + { + public void hyperlinkUpdate (HyperlinkEvent e) + { + if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) + HelpWindow.Instance().loadURL (e.getURL()); + } + }); + return aContent; + } + + private void selectHistoryPage (int i) + { + if (i < 0) + i = 0; + else if (i >= maHistory.size()-1) + i = maHistory.size()-1; + if (i != maCurrentHistoryEntry) + { + URL aURL = (URL)maHistory.get (i); + try + { + maContent.setPage (aURL); + } + catch (java.io.IOException ex) + { + ex.printStackTrace(System.err); + } + + maCurrentHistoryEntry = i; + } + + maPrevButton.setEnabled (maCurrentHistoryEntry > 0); + maNextButton.setEnabled (maCurrentHistoryEntry < maHistory.size()-1); + } + + private static HelpWindow maInstance = null; + private JFrame maFrame; + private JEditorPane maContent; + private LinkedList maHistory; + private int maCurrentHistoryEntry; + private JButton maPrevButton; + private JButton maNextButton; +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/Makefile b/accessibility/workben/org/openoffice/accessibility/awb/Makefile new file mode 100644 index 000000000000..d38799bed109 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/Makefile @@ -0,0 +1,13 @@ +# $Id: Makefile,v 1.1 2003/06/13 16:30:18 af Exp $ + +all : package + +ROOT=../../../.. +PACKAGE = org.openoffice.accessibility.awb +SUBDIRS = canvas event tree view + +include makefile.common + +include $(ROOT)/makefile.in + +package: subdirs $(CLASS_FILES) diff --git a/accessibility/workben/org/openoffice/accessibility/awb/canvas/Canvas.java b/accessibility/workben/org/openoffice/accessibility/awb/canvas/Canvas.java new file mode 100644 index 000000000000..9edf5dd928ae --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/canvas/Canvas.java @@ -0,0 +1,356 @@ +/************************************************************************* + * + * $RCSfile: Canvas.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: obr $ $Date: 2003/09/19 09:21:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.canvas; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Toolkit; +import java.awt.geom.Rectangle2D; +import java.util.Iterator; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JViewport; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.tree.TreePath; + +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleComponent; + +import org.openoffice.accessibility.misc.Options; + +/** This canvas displays accessible objects graphically. Each accessible + object with graphical representation is represented by an + CanvasShape object and has to be added by the + addAccessible member function. + +

The canvas listens to selection events of the associated JTree and + highlights the first selected node of that tree.

+*/ +public class Canvas + extends JPanel +{ + // This constant can be passed to SetZoomMode to always show the whole screen. + public static final int WHOLE_SCREEN = -1; + + public Canvas () + { + super (true); + maShapeList = new ShapeContainer (this); + maMouseObserver = new MouseObserver (this); + maTree = null; + mnHOffset = 0; + mnVOffset = 0; + mnScale = 1; + maLastWidgetSize = new Dimension (0,0); + } + + + + /** Tell the canvas which tree to use to highlight accessible + objects and to observe for changes in the tree structure. + */ + public void SetTree (javax.swing.JTree aTree) + { + if (aTree != maTree) + { + maTree = aTree; + maShapeList.SetTree (maTree); + maMouseObserver.SetTree (maTree); + } + } + + + + + private void Clear () + { + maShapeList.Clear(); + } + + + + + public Iterator GetShapeIterator () + { + return maShapeList.GetIterator(); + } + + + + + public void paintComponent (Graphics g) + { + synchronized (g) + { + super.paintComponent (g); + + Graphics2D g2 = (Graphics2D)g; + if (Options.GetBoolean("Antialiasing")) + g2.setRenderingHint (RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + else + g2.setRenderingHint (RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_OFF); + + setupTransformation (); + g2.translate (mnHOffset, mnVOffset); + g2.scale (mnScale, mnScale); + + // Draw the screen representation to give a hint of the location of the + // accessible object on the screen. + Dimension aScreenSize = Toolkit.getDefaultToolkit().getScreenSize(); + Rectangle2D.Double aScreen = new Rectangle2D.Double ( + 0, + 0, + aScreenSize.getWidth(), + aScreenSize.getHeight()); + // Fill the screen rectangle and draw a frame arround it to increase its visibility. + g2.setColor (new Color (250,240,230)); + g2.fill (aScreen); + g2.setColor (Color.BLACK); + g2.draw (aScreen); + + synchronized (maShapeList) + { + Iterator aShapeIterator = maShapeList.GetIterator(); + boolean bShowDescriptions = Options.GetBoolean ("ShowDescriptions"); + boolean bShowNames = Options.GetBoolean ("ShowNames"); + boolean bShowText = Options.GetBoolean ("ShowText"); + while (aShapeIterator.hasNext()) + { + CanvasShape aCanvasShape = + (CanvasShape)aShapeIterator.next(); + try + { + aCanvasShape.paint ( + g2, + bShowDescriptions, bShowNames, bShowText); + } + catch (Exception aException) + { + System.err.println ("caught exception while painting a shape:" + + aException); + aException.printStackTrace (System.err); + } + } + } + + // Paint highlighted frame around active object as the last thing. + if (maActiveObject != null) + maActiveObject.paint_highlight (g2); + } + } + + + + + /** Set up the transformation so that the graphical display can show a + centered representation of the whole screen. + */ + private void setupTransformation () + { + // Turn off scrollbars when showing the whole screen. Otherwise show them when needed. + JViewport aViewport = (JViewport)getParent(); + JScrollPane aScrollPane = (JScrollPane)aViewport.getParent(); + int nZoomMode = Options.GetInteger ("ZoomMode", WHOLE_SCREEN); + if (nZoomMode == WHOLE_SCREEN) + { + if (aScrollPane.getHorizontalScrollBarPolicy() + != JScrollPane.HORIZONTAL_SCROLLBAR_NEVER) + aScrollPane.setHorizontalScrollBarPolicy ( + JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + if (aScrollPane.getVerticalScrollBarPolicy() + != JScrollPane.VERTICAL_SCROLLBAR_NEVER) + aScrollPane.setVerticalScrollBarPolicy ( + JScrollPane.VERTICAL_SCROLLBAR_NEVER); + } + else + { + if (aScrollPane.getHorizontalScrollBarPolicy() + != JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED) + aScrollPane.setHorizontalScrollBarPolicy ( + JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); + if (aScrollPane.getVerticalScrollBarPolicy() + != JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED) + aScrollPane.setVerticalScrollBarPolicy ( + JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); + } + + Dimension aScreenSize = Toolkit.getDefaultToolkit().getScreenSize(); + Dimension aWidgetSize = aViewport.getSize(); + { + if ((aScreenSize.getWidth() > 0) && (aScreenSize.getHeight() > 0)) + { + if (nZoomMode == WHOLE_SCREEN) + { + // Calculate the scales that would map the screen onto the + // widget in both of the coordinate axes and select the + // smaller + // of the two: it maps the screen onto the widget in both + // axes at the same time. + double nHScale = (aWidgetSize.getWidth() - 10) + / aScreenSize.getWidth(); + double nVScale = (aWidgetSize.getHeight() - 10) + / aScreenSize.getHeight(); + if (nHScale < nVScale) + mnScale = nHScale; + else + mnScale = nVScale; + } + else + { + mnScale = nZoomMode / 100.0; + } + + // Calculate offsets that center the scaled screen inside + // the widget. + mnHOffset = (aWidgetSize.getWidth() + - mnScale*aScreenSize.getWidth()) / 2.0; + mnVOffset = (aWidgetSize.getHeight() + - mnScale*aScreenSize.getHeight()) / 2.0; + if (mnHOffset < 0) + mnHOffset = 0; + if (mnVOffset < 0) + mnVOffset = 0; + + setPreferredSize (new Dimension ( + (int)(2*mnHOffset + mnScale * aScreenSize.getWidth()), + (int)(2*mnVOffset + mnScale * aScreenSize.getHeight()))); + revalidate (); + } + else + { + // In case of a degenerate (not yet initialized?) screen size + // use some meaningless default values. + mnScale = 1; + mnHOffset = 0; + mnVOffset = 0; + } + } + maLastWidgetSize = aWidgetSize; + } + + + + protected boolean HighlightObject (CanvasShape aNewActiveObject) + { + if (aNewActiveObject != maActiveObject) + { + if (maActiveObject != null) + maActiveObject.Highlight (false); + + maActiveObject = aNewActiveObject; + if (maActiveObject != null) + { + /* if (maTree != null) + { + TreePath aPath = new TreePath ( + maActiveObject.GetNode().GetPath()); + maTree.scrollPathToVisible (aPath); + maTree.setSelectionPath (aPath); + maTree.repaint (); + } + */ + maActiveObject.Highlight (true); + } + repaint (); + return true; + } + else + return false; + } + + + + + /** Called when the selection of the tree changes. Highlight the + corresponding graphical representation of the object. + */ + public void SelectObject (javax.swing.tree.TreeNode aNode) + { + CanvasShape aCanvasShape = maShapeList.Get (aNode); + HighlightObject (aCanvasShape); + } + + + + + private int + mnXAnchor, + mnYAnchor, + maResizeFlag; + private double + mnHOffset, + mnVOffset, + mnScale; + private CanvasShape maActiveObject; + private javax.swing.JTree maTree; + // The size of the widget at the last call of setupTransformation() + private Dimension maLastWidgetSize; + private ShapeContainer maShapeList; + private MouseObserver maMouseObserver; +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/canvas/CanvasShape.java b/accessibility/workben/org/openoffice/accessibility/awb/canvas/CanvasShape.java new file mode 100644 index 000000000000..5b1b2fb1f4e2 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/canvas/CanvasShape.java @@ -0,0 +1,446 @@ +/************************************************************************* + * + * $RCSfile: CanvasShape.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: obr $ $Date: 2003/09/19 09:21:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.canvas; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.geom.Point2D; +import java.awt.geom.Rectangle2D; +import java.awt.geom.AffineTransform; +import java.awt.geom.NoninvertibleTransformException; + + +import com.sun.star.accessibility.*; +import com.sun.star.lang.EventObject; +import com.sun.star.uno.UnoRuntime; + + +class CanvasShape implements XAccessibleEventListener +{ + public final Color maHighlightColor = Color.red; + public final Color maSelectionColor = Color.green; + public final Color maFocusColor = Color.blue; + + public CanvasShape (javax.swing.tree.TreeNode aNode, Canvas aCanvas) + { + maNode = aNode; + msName = ""; + msDescription = ""; + maShape = new Rectangle2D.Double (-10,-10,10,10); + maPosition = new Point (-10,-10); + maSize = new Dimension (10,10); + maFgColor = java.awt.Color.black; + maBgColor = Color.blue; + mnRole = -1; + mbHighlighted = false; + mbSelected = false; + mbFocused = false; + maCanvas = aCanvas; + + Update (); + } + + + + + public javax.swing.tree.TreePath getNodePath (javax.swing.tree.TreeNode node) + { + javax.swing.tree.TreeNode parent = node.getParent(); + return (parent != null) ? + getNodePath(parent).pathByAddingChild(node) : + new javax.swing.tree.TreePath(node); + } + + public javax.swing.tree.TreePath getNodePath () + { + return getNodePath(maNode); + } + + + + /** Update the data obtained from the AccessibilityNode + object. + */ + public void Update () + { + if (maNode instanceof XAccessible) { + mxContext = ((XAccessible) maNode).getAccessibleContext(); + mxComponent = (XAccessibleComponent)UnoRuntime.queryInterface( + XAccessibleComponent.class, mxContext); + } + + if (mxContext != null) + { + msName = mxContext.getAccessibleName(); + msDescription = mxContext.getAccessibleDescription(); + mnRole = mxContext.getAccessibleRole(); + + // Extract the selected and focused flag. + XAccessibleStateSet xStateSet = mxContext.getAccessibleStateSet (); + if (xStateSet != null) + { + mbSelected = xStateSet.contains (AccessibleStateType.SELECTED); + mbFocused = xStateSet.contains (AccessibleStateType.FOCUSED); + } + } + + UpdateGeometry (); + + if (mxComponent != null) + { + // Note: alpha values in office 0..255 have to be mapped to + // 255..0 in Java + Color aCol = new Color (mxComponent.getForeground(), true); + maFgColor = new Color (aCol.getRed (), + aCol.getGreen (), + aCol.getBlue (), + 0xff - aCol.getAlpha ()); + aCol = new Color (mxComponent.getBackground(), true); + maBgColor = new Color (aCol.getRed (), + aCol.getGreen (), + aCol.getBlue (), + 0xff - aCol.getAlpha ()); + } + } + + + + public void UpdateGeometry () + { + if (mxComponent != null) + { + com.sun.star.awt.Point aLocationOnScreen = + mxComponent.getLocationOnScreen(); + com.sun.star.awt.Size aSizeOnScreen = mxComponent.getSize(); + maPosition = new Point ( + aLocationOnScreen.X, + aLocationOnScreen.Y); + maSize = new Dimension ( + aSizeOnScreen.Width, + aSizeOnScreen.Height); + } + } + + + + /** Paint the object into the specified canvas. It is transformed + according to the specified offset and scale. + */ + public void paint ( + Graphics2D g, + boolean bShowDescription, + boolean bShowName, + boolean bShowText) + { + try{ + // Transform the object's position and size according to the + // specified offset and scale. + Point aLocation = new Point(); + maShape = new Rectangle2D.Double ( + maPosition.x, + maPosition.y, + maSize.width, + maSize.height); + maTransformation = g.getTransform(); + + // Fill the object's bounding box with its background color if it + // has no children. + if (mxContext.getAccessibleChildCount() == 0) + { + g.setColor (maBgColor); + g.fill (maShape); + } + + // Remove alpha channel from color before drawing the frame. + Color color = maFgColor; + if (maFgColor.getAlpha()<128) + color = new Color (maFgColor.getRed(), maFgColor.getGreen(), maFgColor.getBlue()); + g.setColor (color); + g.draw (maShape); + + if (mbFocused) + { + g.setColor (maFocusColor); + for (int x=0; x<=2; x++) + for (int y=0; y<=2; y++) + g.fill ( + new Rectangle2D.Double ( + maShape.x + x/2.0 * maShape.width-3, + maShape.y + y/2.0 * maShape.height-3, + 6, + 6)); + } + if (mbSelected) + { + g.setColor (maSelectionColor); + for (int x=0; x<=2; x++) + for (int y=0; y<=2; y++) + g.draw ( + new Rectangle2D.Double ( + maShape.x + x/2.0 * maShape.width-2, + maShape.y + y/2.0 * maShape.height-2, + 4, + 4)); + } + + // Write the object's text OR name and description. + g.setColor (maFgColor); + if (bShowName) + paintName (g); + if (bShowDescription) + paintDescription (g); + if (bShowText) + paintText (g); + } + catch (Exception e) + { // don't care + } + } + + + public void paint_highlight (Graphics2D g) + { + if (mbHighlighted) + g.setColor (maHighlightColor); + else + g.setColor (maFgColor); + g.draw (maShape); + } + + + + + private void paintName (Graphics2D g) + { + g.drawString ("Name: " + msName, + (float)maShape.x+5, + (float)maShape.y+15); + } + + + + private void paintDescription (Graphics2D g) + { + g.drawString ("Description: " + msDescription, + (float)maShape.x+5, + (float)maShape.y+35); + } + + + + + private void paintText (Graphics2D g) + { + XAccessibleText xText = null; + // get XAccessibleText + xText = (XAccessibleText)UnoRuntime.queryInterface( + XAccessibleText.class, mxContext); + + // Draw every character in the text string. + if (xText != null) + { + String sText = xText.getText(); + try + { + for(int i = 0; i < sText.length(); i++) + { + com.sun.star.awt.Rectangle aRect = + xText.getCharacterBounds(i); + + double x = maShape.x + aRect.X; + double y = maShape.y + aRect.Y + aRect.Height; + + g.drawString (sText.substring(i, i+1), (float)x, (float)y); + } + } + catch (com.sun.star.lang.IndexOutOfBoundsException e) + {} + } + } + + + /** Compute whether the specified point lies inside the object's + bounding box. + */ + public boolean Contains (int x, int y) + { + Point2D aPosition = new Point2D.Double (x,y); + try + { + maTransformation.inverseTransform (aPosition, aPosition); + // System.out.println ("transformed "+x+","+y+" to "+aPosition); + } + catch (NoninvertibleTransformException aException) + { + return false; + } + return (maShape.contains (aPosition)); + } + + public void Highlight (boolean bFlag) + { + mbHighlighted = bFlag; + } + + public boolean IsHighlighted () + { + return mbHighlighted; + } + + public Rectangle GetBBox () + { + return new Rectangle (maPosition, maSize); + } + + public Point getOrigin () + { + return maPosition; + } + + public Dimension GetSize () + { + return maSize; + } + + public int getRole () + { + return mnRole; + } + + public XAccessibleContext getContext () + { + return mxContext; + } + + public XAccessibleComponent getComponent () + { + return mxComponent; + } + + public String toString () + { + return ">"+msName+", "+msDescription+" +"+maPosition.x+"+"+maPosition.y + +"x"+maSize.width+"x"+maSize.height+"<"; + } + + /** */ + public void notifyEvent(com.sun.star.accessibility.AccessibleEventObject aEvent) { + try { + switch (aEvent.EventId) { + case AccessibleEventId.BOUNDRECT_CHANGED: + case AccessibleEventId.VISIBLE_DATA_CHANGED: + UpdateGeometry (); + maCanvas.repaint(); + break; + default: + break; + } + } catch (Exception aException) { + System.err.println ("caught exception while updating a shape:" + + aException); + aException.printStackTrace (System.err); + } + } + + /** Callback for disposing events. + */ + public void disposing (com.sun.star.lang.EventObject e) + { + System.out.println ("Disposing"); + } + + + + + private Canvas + maCanvas; + private javax.swing.tree.TreeNode + maNode; + private XAccessibleContext + mxContext; + private XAccessibleComponent + mxComponent; + private String + msDescription, + msName; + private Rectangle2D.Double maShape; + private AffineTransform maTransformation; + private Point maPosition; + private Dimension + maTransformedSize, + maSize; + private Color + maFgColor, + maBgColor; + private boolean + // Highlighting objects is an internal concept. Corresponds to selection in the tree view. + mbHighlighted, + // Set when the accessible object is selected. + mbSelected, + // Set when the accessible object is focused. + mbFocused; + private int + mnRole; +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/canvas/Makefile b/accessibility/workben/org/openoffice/accessibility/awb/canvas/Makefile new file mode 100644 index 000000000000..8d9688433ff9 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/canvas/Makefile @@ -0,0 +1,15 @@ +# $Id: Makefile,v 1.1 2003/06/13 16:30:21 af Exp $ + +all : package + +ROOT=../../../../.. +PACKAGE = org.openoffice.accessibility.awb.canvas +SUBDIRS = +include makefile.common + +include $(ROOT)/makefile.in + + +package : $(CLASS_FILES) + + diff --git a/accessibility/workben/org/openoffice/accessibility/awb/canvas/MouseObserver.java b/accessibility/workben/org/openoffice/accessibility/awb/canvas/MouseObserver.java new file mode 100644 index 000000000000..3e7e2807906d --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/canvas/MouseObserver.java @@ -0,0 +1,104 @@ +package org.openoffice.accessibility.awb.canvas; + +import java.awt.Dimension; +import java.awt.event.InputEvent; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.util.Iterator; +import javax.swing.tree.TreePath; + + +/** Observe the mouse and highlight shapes of the canvas when clicked. +*/ +public class MouseObserver + implements MouseListener, + MouseMotionListener +{ + public MouseObserver (Canvas aCanvas) + { + maCanvas = aCanvas; + maCanvas.addMouseListener (this); + maCanvas.addMouseMotionListener (this); + } + + + public void SetTree (javax.swing.JTree aTree) + { + maTree = aTree; + } + + public void mouseClicked (MouseEvent e) + {} + + public void mousePressed (MouseEvent e) + { + CanvasShape aObjectUnderMouse = FindCanvasShapeUnderMouse (e); + maTree.clearSelection(); + if (aObjectUnderMouse != null) + { + TreePath aPath = aObjectUnderMouse.getNodePath(); + if ((e.getModifiers() & InputEvent.CTRL_MASK) != 0) + maTree.expandPath (aPath); + // Selecting the entry will eventually highlight the shape. + maTree.setSelectionPath (aPath); + maTree.makeVisible (aPath); + } + } + + public void mouseReleased (MouseEvent e) + {} + + public void mouseEntered (MouseEvent e) + {} + + public void mouseExited (MouseEvent e) + {} + + public void mouseDragged (MouseEvent e) + { + } + + public void mouseMoved (MouseEvent e) + { + if ((e.getModifiers() & InputEvent.SHIFT_MASK) != 0) + maCanvas.HighlightObject (FindCanvasShapeUnderMouse (e)); + } + + + /** Search for the smallest shape that contains the mouse position. + */ + protected CanvasShape FindCanvasShapeUnderMouse (MouseEvent e) + { + Dimension aSmallestSize = null; + Iterator maShapeIterator = maCanvas.GetShapeIterator(); + CanvasShape aShapeUnderMouse = null; + while (maShapeIterator.hasNext()) + { + CanvasShape aShape = (CanvasShape)maShapeIterator.next(); + if (aShape != null) + if (aShape.Contains (e.getX(),e.getY())) + { + if (aShapeUnderMouse == null) + { + aSmallestSize = aShape.GetSize(); + aShapeUnderMouse = aShape; + } + else + { + Dimension aSize = aShape.GetSize(); + if (aSize.getWidth()= "140" + +.INCLUDE : makefile.common + +JAVACLASSFILES= $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) + +#JARTARGET = $(TARGET).jar +#JARCOMPRESS = TRUE +JARCLASSDIRS = $(PACKAGE) org/openoffice/java/accessibility/awb +#CUSTOMMANIFESTFILE = manifest +.ENDIF + +# --- Targets ------------------------------------------------------ + + +.INCLUDE : target.mk + diff --git a/accessibility/workben/org/openoffice/accessibility/awb/makefile.common b/accessibility/workben/org/openoffice/accessibility/awb/makefile.common new file mode 100644 index 000000000000..80633d7e66ea --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/makefile.common @@ -0,0 +1,3 @@ +JAVAFILES = \ + AccessibilityWorkBench.java \ + HelpWindow.java diff --git a/accessibility/workben/org/openoffice/accessibility/awb/makefile.mk b/accessibility/workben/org/openoffice/accessibility/awb/makefile.mk new file mode 100644 index 000000000000..eb744d465cfb --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/makefile.mk @@ -0,0 +1,88 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJNAME = awb +PRJ = ..$/..$/..$/..$/.. +TARGET = java_awb +PACKAGE = org$/openoffice$/accessibility$/awb + +USE_JAVAVER:=TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +.IF "$(JAVAVER:s/.//)" >= "140" +JARFILES = sandbox.jar jurt.jar unoil.jar ridl.jar + +.INCLUDE : makefile.common + +JAVACLASSFILES= $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) + +JARTARGET = $(TARGET).jar +JARCOMPRESS = TRUE +JARCLASSDIRS = $(PACKAGE) \ + org$/openoffice$/accessibility$/misc +CUSTOMMANIFESTFILE = manifest +.ENDIF + +# --- Targets ------------------------------------------------------ + + +.INCLUDE : target.mk + diff --git a/accessibility/workben/org/openoffice/accessibility/awb/manifest b/accessibility/workben/org/openoffice/accessibility/awb/manifest new file mode 100644 index 000000000000..951f9ec3128f --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/manifest @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: org.openoffice.accessibility.awb.AccessibilityWorkBench +Class-Path: classes.jar sandbox.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar xt.jar jaxp.jar diff --git a/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityModel.java b/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityModel.java new file mode 100644 index 000000000000..6bdb5976f843 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityModel.java @@ -0,0 +1,188 @@ +/************************************************************************* + * + * $RCSfile: AccessibilityModel.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: obr $ $Date: 2003/09/19 09:21:39 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.tree; + +import javax.swing.SwingUtilities; +import javax.swing.tree.TreeNode; +import javax.swing.tree.MutableTreeNode; +import javax.swing.tree.DefaultMutableTreeNode; + +import com.sun.star.uno.UnoRuntime; +import com.sun.star.awt.XExtendedToolkit; +import com.sun.star.awt.XTopWindow; +import com.sun.star.awt.XTopWindowListener; +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleEventBroadcaster; +import com.sun.star.accessibility.XAccessibleEventListener; + +/** + * + */ +public abstract class AccessibilityModel extends javax.swing.tree.DefaultTreeModel { + + protected java.util.Hashtable nodeList; + protected static DefaultMutableTreeNode disconnectedRootNode = + new DefaultMutableTreeNode(""); + + /** Creates a new instance of AccessibilityModel */ + public AccessibilityModel() { + super(disconnectedRootNode, false); + nodeList = new java.util.Hashtable(); + } + + /* Convenience method that creates a new Toolkit node from xToolkit + * and sets as the new root object of the tree. + */ + public synchronized void setRoot(XExtendedToolkit xToolkit) { + if (xToolkit != null) { + try { + // remove old root node as topwindow listener + if (getRoot() instanceof ToolkitNode) { + ToolkitNode tn = (ToolkitNode) getRoot(); + if (tn.xToolkit != null) { + tn.xToolkit.removeTopWindowListener(tn); + } + } + nodeList.clear(); + setRoot(new ToolkitNode(xToolkit, this)); + xToolkit.addTopWindowListener((ToolkitNode) getRoot()); + } catch (com.sun.star.uno.RuntimeException e) { + // FIXME: error message ! + } + } + } + + /* Appends the new child to parent's child list */ + public void addNodeInto(MutableTreeNode newChild, MutableTreeNode parent) { + int index = parent.getChildCount(); + if (newChild != null && newChild.getParent() == parent) { + index -= 1; + } + insertNodeInto(newChild, parent, index); + } + + /** Adds listener to the listener chain of node */ + public static void addEventListener(TreeNode node, XAccessibleEventListener listener) { + if (node instanceof AccessibilityNode) { + ((AccessibilityNode) node).addEventListener(listener); + } + } + + /** Removes listener from the listener chain of node */ + public static void removeEventListener(TreeNode node, XAccessibleEventListener listener) { + if (node instanceof AccessibilityNode) { + ((AccessibilityNode) node).removeEventListener(listener); + } + } + + protected abstract AccessibilityNode createWindowNode(XAccessible xAccessible, + XAccessibleContext xAccessibleContext); + protected abstract AccessibilityNode createNode(XAccessible xAccessible); + + /** Adds xAccessible,node to the internal hashtable */ + public AccessibilityNode putNode(XAccessible xAccessible, AccessibilityNode node) { + if (xAccessible != null) { + String oid = UnoRuntime.generateOid(xAccessible); + java.lang.ref.WeakReference ref = (java.lang.ref.WeakReference) + nodeList.put(oid, new java.lang.ref.WeakReference(node)); + if (ref != null) { + return (AccessibilityNode) ref.get(); + } + } + return null; + } + + /** Returns the AccessibilityNode for xAccessible */ + public AccessibilityNode findNode(XAccessible xAccessible) { + if (xAccessible != null) { + String oid = UnoRuntime.generateOid(xAccessible); + java.lang.ref.WeakReference ref = + (java.lang.ref.WeakReference) nodeList.get(oid); + if (ref != null) { + return (AccessibilityNode) ref.get(); + } + } + return null; + } + + /** Removes the AccessibilityNode for xAccessible from the internal hashtable */ + public AccessibilityNode removeNode(XAccessible xAccessible) { + if (xAccessible != null) { + String oid = UnoRuntime.generateOid(xAccessible); + java.lang.ref.WeakReference ref = + (java.lang.ref.WeakReference) nodeList.remove(oid); + if (ref != null) { + return (AccessibilityNode) ref.get(); + } + } + return null; + } + + public AccessibilityNode removeNode(Object o) { + if (o instanceof XAccessible) { + return removeNode((XAccessible) o); + } + return null; + } +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityNode.java b/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityNode.java new file mode 100644 index 000000000000..36c5d71b240e --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityNode.java @@ -0,0 +1,200 @@ +/************************************************************************* + * + * $RCSfile: AccessibilityNode.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: obr $ $Date: 2003/09/19 09:21:39 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.tree; + +import org.openoffice.accessibility.misc.AccessibleEventMulticaster; + +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.SwingUtilities; + +import com.sun.star.accessibility.AccessibleEventId; +import com.sun.star.accessibility.AccessibleEventObject; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleEventBroadcaster; +import com.sun.star.accessibility.XAccessibleEventListener; + +import com.sun.star.uno.UnoRuntime; + +class AccessibilityNode extends DefaultMutableTreeNode implements XAccessible, + XAccessibleEventListener, XAccessibleEventBroadcaster { + + protected AccessibilityModel treeModel; + protected XAccessibleContext unoAccessibleContext; + + private XAccessibleEventListener listener; + + public AccessibilityNode(AccessibilityModel treeModel) { + this.treeModel = treeModel; + } + + protected void finalize() throws java.lang.Throwable { + if (userObject != null) { + treeModel.removeNode(userObject); + } + } + + /** Sets the XAccessibleContext object of this node */ + public void setAccessibleContext(XAccessibleContext xAccessibleContext) { + unoAccessibleContext = xAccessibleContext; + } + + /** Returns the XAccessibleContext object of this node */ + public XAccessibleContext getAccessibleContext() { + return unoAccessibleContext; + } + + /** Attaches or Detaches the itself as listener to unoAccessibleContext */ + protected void setAttached(boolean attach) { + XAccessibleContext xAccessibleContext = unoAccessibleContext; + if (xAccessibleContext != null) { + try { + XAccessibleEventBroadcaster xAccessibleEventBroadcaster = + (XAccessibleEventBroadcaster) UnoRuntime.queryInterface( + XAccessibleEventBroadcaster.class, xAccessibleContext); + if (xAccessibleEventBroadcaster != null) { + if (attach) { + xAccessibleEventBroadcaster.addEventListener(this); + } else { + xAccessibleEventBroadcaster.removeEventListener(this); + } + } + } catch (com.sun.star.uno.RuntimeException e) { + // FIXME: error message ! + } + } + } + + public void disposing(com.sun.star.lang.EventObject eventObject) { + XAccessibleEventListener listener = this.listener; + if (listener != null) { + listener.disposing(eventObject); + } + + treeModel.removeNode(userObject); + userObject = null; + unoAccessibleContext = null; + // FIXME: mark the object as being disposed in the tree view ! + } + + protected void handleChildRemoved(XAccessible xAccessible) { + final AccessibilityNode node = treeModel.findNode(xAccessible); + if (node != null) { + SwingUtilities.invokeLater(new java.lang.Runnable() { + public void run() { + treeModel.removeNodeFromParent(node); + } + }); + } + } + + protected void handleChildAdded(XAccessible xAccessible) { + final AccessibilityNode parent = this; + final AccessibilityNode node = treeModel.createNode(xAccessible); + if (node != null) { + SwingUtilities.invokeLater(new java.lang.Runnable() { + public void run() { + try { + XAccessibleContext xAC = node.getAccessibleContext(); + if (xAC != null) { + treeModel.insertNodeInto(node, parent, + xAC.getAccessibleIndexInParent()); + } + } catch (com.sun.star.uno.RuntimeException e) { + // FIXME: output + } + } + }); + } + } + + public void notifyEvent(AccessibleEventObject accessibleEventObject) { + if (accessibleEventObject.EventId == AccessibleEventId.CHILD) { + XAccessible xAccessible = (XAccessible) UnoRuntime.queryInterface( + XAccessible.class, accessibleEventObject.OldValue); + if (xAccessible != null) { + handleChildRemoved(xAccessible); + } + + xAccessible = (XAccessible) UnoRuntime.queryInterface( + XAccessible.class, accessibleEventObject.NewValue); + if (xAccessible != null) { + handleChildAdded(xAccessible); + } + } + + XAccessibleEventListener listener = this.listener; + if (listener != null) { + listener.notifyEvent(accessibleEventObject); + } + } + + public synchronized void addEventListener(com.sun.star.accessibility.XAccessibleEventListener xAccessibleEventListener) { + listener = AccessibleEventMulticaster.add(listener, xAccessibleEventListener); + } + + public synchronized void removeEventListener(com.sun.star.accessibility.XAccessibleEventListener xAccessibleEventListener) { + listener = AccessibleEventMulticaster.remove(listener, xAccessibleEventListener); + } +} + + diff --git a/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityTree.java b/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityTree.java new file mode 100644 index 000000000000..f7e71d21574e --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityTree.java @@ -0,0 +1,123 @@ +/************************************************************************* + * + * $RCSfile: AccessibilityTree.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: obr $ $Date: 2003/09/19 09:21:39 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.tree; + +import org.openoffice.accessibility.misc.NameProvider; + +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.DefaultMutableTreeNode; + +import com.sun.star.awt.XExtendedToolkit; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleContext; + +/** + * + */ +public class AccessibilityTree extends javax.swing.JTree { + + /** Creates a new instance of AccessibilityTree */ + public AccessibilityTree(javax.swing.tree.TreeModel model) { + super(model); + // always show handles to indicate expandable / collapsable + showsRootHandles = true; + } + + public void setToolkit(XExtendedToolkit xToolkit) { + AccessibilityModel model = (AccessibilityModel) getModel(); + if (model != null) { + // hide the root node when connected + setRootVisible(xToolkit == null); + // update the root node + model.setRoot(xToolkit); + model.reload(); + } + } + + public String convertValueToText(Object value, boolean selected, + boolean expanded, boolean leaf, int row, boolean hasFocus) { + + if (value instanceof DefaultMutableTreeNode) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; + + Object userObject = node.getUserObject(); + if (userObject != null && userObject instanceof XAccessible) { + XAccessible xAccessible = (XAccessible) userObject; + try { + XAccessibleContext xAC = xAccessible.getAccessibleContext(); + if (xAC != null) { + String name = xAC.getAccessibleName(); + if (name.length() == 0) { + name = new String (""); + } + value = name + " / " + NameProvider.getRoleName(xAC.getAccessibleRole()); + } + } catch (com.sun.star.uno.RuntimeException e) { + value = "???"; + } + } + } + + return super.convertValueToText(value, selected, expanded, leaf, row, hasFocus); + } + +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityTreeModel.java b/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityTreeModel.java new file mode 100644 index 000000000000..acecd0100a2e --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/tree/AccessibilityTreeModel.java @@ -0,0 +1,251 @@ +/************************************************************************* + * + * $RCSfile: AccessibilityTreeModel.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: af $ $Date: 2003/06/13 16:30:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc.,y October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.tree; + +import com.sun.star.accessibility.XAccessible; +import com.sun.star.awt.XExtendedToolkit; +import com.sun.star.lang.DisposedException; +import com.sun.star.lang.IndexOutOfBoundsException; + +import org.openoffice.accessibility.misc.OfficeConnection; +import org.openoffice.accessibility.awb.event.EventQueue; + +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreeNode; + + +public class AccessibilityTreeModel + extends DefaultTreeModel +{ + public AccessibilityTreeModel () + { + super (null); + setAsksAllowsChildren (false); + + SetRootNode(); + } + + + + /** Release all resources. + */ + synchronized public void Dispose () + { + Clear (); + } + + + + /** Calls to this method are dispatched to the given node but are + observed for exceptions. + */ + synchronized public boolean isLeaf (Object aObject) + { + boolean bIsLeaf = true; + + if (aObject != null) + { + AccessibilityNode aNode = (AccessibilityNode)aObject; + try + { + bIsLeaf = aNode.isLeaf(); + } + catch (DisposedException aException) + { + System.out.println ("node is disposed. removing it"); + /* TreeNode aParent = aNode.GetParent(); + int nIndexInParent = aParent.getIndex (aNode); + aNode.removeFromParent (); + System.out.println ("" + aParent + " # " + aNode + " # "+ nIndexInParent); + nodesWereRemoved ( + aParent, new int[]{nIndexInParent}, new + Object[]{aNode}); + */ + } + catch (Exception aException) + { + System.err.println ("caught exception in AccessibilityTreeModel.isLeaf():" + + aException); + aException.printStackTrace (System.err); + } + } + + return bIsLeaf; + } + + + + + synchronized public int getChildCount (Object aObject) + { + AccessibilityNode aNode = (AccessibilityNode)aObject; + return aNode.getChildCount(); + } + + + + + /** Return the requested child of aParent. If that child is not yet + known to the parent then try to create it. + */ + synchronized public Object getChild (Object aParent, final int nIndex) + { + AccessibilityNode aChild = null; + + final AccessibilityNode aParentNode = (AccessibilityNode)aParent; + + // Try to get an existing child from the super class object. + aChild = aParentNode.GetChildNoCreate (nIndex); + + // When the requested child does not yet exist and this node is not a + // special node then create a new node. + if (aChild == null) + { + aChild = aParentNode.CreateChild (nIndex); + aParentNode.SetChild ((AccessibilityNode)aChild, nIndex); + /* EventQueue.Instance().AddEvent (new Runnable() { public void run() { + AccessibilityTreeModel.this.nodeWasInserted ( + aParentNode, nIndex); + }}); + */ } + + return aChild; + } + + + synchronized public void nodeWasInserted (AccessibilityNode aParent, int nIndex) + { + nodesWereInserted (aParent, new int[]{nIndex}); + nodeStructureChanged (aParent); + + } + + + + + /** Clear the tree so that afterwards it has only the root node. + */ + public void Clear () + { + AccessibilityNode aRoot = (AccessibilityNode)getRoot(); + aRoot.RemoveAllChildren(); + SetRootNode(); + nodeStructureChanged (aRoot); + } + + + + + private void SetRootNode () + { + OfficeConnection aConnection = OfficeConnection.Instance(); + AccessibilityNode aRoot; + if (aConnection!=null && aConnection.IsValid()) + aRoot = new AccessibilityNode (""); + else + aRoot = new AccessibilityNode (""); + setRoot (aRoot); + } + + + + + /** Add a new child to the root node. + */ + public synchronized void AddTopLevelNode (AccessibilityNode aNode) + { + if (aNode != null) + { + if ( ! OfficeConnection.Instance().IsValid()) + { + setRoot (null); + } + + AccessibilityNode aRoot = (AccessibilityNode)getRoot(); + if (aRoot == null) + { + aRoot = new AccessibilityNode (""); + setRoot (aRoot); + } + + aNode.SetParent (aRoot); + aRoot.Append (aNode); + nodesWereInserted (aRoot, new int[]{aRoot.getIndex (aNode)}); + } + } + + + + + /** Remove a node that is a direct child of the root. + */ + public synchronized void RemoveTopLevelNode (AccessibilityNode aNode) + { + AccessibilityNode aRoot = (AccessibilityNode)getRoot(); + if (aRoot != null) + { + int nIndex = aRoot.getIndex (aNode); + aRoot.Remove (aNode); + nodesWereRemoved (aRoot, new int[]{nIndex}, new Object[]{aNode}); + } + } +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/tree/DynamicAccessibilityModel.java b/accessibility/workben/org/openoffice/accessibility/awb/tree/DynamicAccessibilityModel.java new file mode 100644 index 000000000000..0f5626852238 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/tree/DynamicAccessibilityModel.java @@ -0,0 +1,157 @@ +/************************************************************************* + * + * $RCSfile: DynamicAccessibilityModel.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: obr $ $Date: 2003/09/19 09:21:39 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.tree; + +import javax.swing.tree.TreeNode; +import javax.swing.tree.MutableTreeNode; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.event.TreeExpansionListener; +import javax.swing.event.TreeWillExpandListener; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleContext; + +/** + * + */ +public class DynamicAccessibilityModel extends AccessibilityModel implements TreeExpansionListener, TreeWillExpandListener { + + /* Creates a AccessibilityNode object for a window */ + protected AccessibilityNode createWindowNode(XAccessible xAccessible, + XAccessibleContext xAccessibleContext) { + if (xAccessible != null) { + // Some objects inherit XAccessible, but should not appear in + // the hierarchy as toplevels (like sub-menus), so they don't + // return an accessible context. + if (xAccessibleContext != null) { + AccessibilityNode node = new AccessibilityNode(this); + node.setUserObject(xAccessible); + node.setAccessibleContext(xAccessibleContext); + putNode(xAccessible, node); + return node; + } + } + return null; + } + + /* Creates a DynamicAccessibilityNode object */ + protected AccessibilityNode createNode(XAccessible xAccessible) { + if (xAccessible != null) { + try { + // Some objects inherit XAccessible, but should not appear in + // the hierarchy as toplevels (like sub-menus), so they don't + // return an accessible context. + XAccessibleContext xAccessibleContext = xAccessible.getAccessibleContext(); + if (xAccessibleContext != null) { + AccessibilityNode node = new DynamicAccessibilityNode(this); + node.setUserObject(xAccessible); + node.setAccessibleContext(xAccessibleContext); + putNode(xAccessible, node); + return node; + } + } catch (com.sun.star.uno.RuntimeException e) { + } + } + return null; + } + + public void treeCollapsed(javax.swing.event.TreeExpansionEvent treeExpansionEvent) { + TreeNode node = (TreeNode) treeExpansionEvent.getPath().getLastPathComponent(); + if (node instanceof DynamicAccessibilityNode) { + DynamicAccessibilityNode dynode = (DynamicAccessibilityNode) node; + dynode.clear(); + } + } + + public void treeExpanded(javax.swing.event.TreeExpansionEvent treeExpansionEvent) { + TreeNode node = (TreeNode) treeExpansionEvent.getPath().getLastPathComponent(); + if (node instanceof AccessibilityNode) { + // Calling oneway methods from an UNO thread may cause + // deadlocks, so adding the listeners here. + for (java.util.Enumeration e = node.children(); e.hasMoreElements(); ) { + ((AccessibilityNode) e.nextElement()).setAttached(true); + } + } + } + + public void treeWillCollapse(javax.swing.event.TreeExpansionEvent treeExpansionEvent) + throws javax.swing.tree.ExpandVetoException { + TreeNode node = (TreeNode) treeExpansionEvent.getPath().getLastPathComponent(); + if (node instanceof AccessibilityNode) { + // Calling oneway methods from an UNO thread may cause + // deadlocks, so adding the listeners here. + for (java.util.Enumeration e = node.children(); e.hasMoreElements(); ) { + ((AccessibilityNode) e.nextElement()).setAttached(false); + } + } + } + + public void treeWillExpand(javax.swing.event.TreeExpansionEvent treeExpansionEvent) + throws javax.swing.tree.ExpandVetoException { + TreeNode node = (TreeNode) treeExpansionEvent.getPath().getLastPathComponent(); + if (node instanceof DynamicAccessibilityNode) { + DynamicAccessibilityNode dynode = (DynamicAccessibilityNode) node; + dynode.populate(); + } + } +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/tree/DynamicAccessibilityNode.java b/accessibility/workben/org/openoffice/accessibility/awb/tree/DynamicAccessibilityNode.java new file mode 100644 index 000000000000..ff6f5ddd45ea --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/tree/DynamicAccessibilityNode.java @@ -0,0 +1,126 @@ +/************************************************************************* + * + * $RCSfile: DynamicAccessibilityNode.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: obr $ $Date: 2003/09/19 09:21:40 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.tree; + +import com.sun.star.uno.UnoRuntime; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleContext; + +/* + * This class is dynamic in the way that it does not contain any children + * until the node is going to be expanded. It also releases all children + * as soon as the node is collapsed again. + */ +class DynamicAccessibilityNode extends AccessibilityNode { + + public DynamicAccessibilityNode(AccessibilityModel treeModel) { + super(treeModel); + } + + // Populates the child list. Called by AccessibilityMode.treeWillExpand(). + protected void populate() { + try { + XAccessibleContext xAC = getAccessibleContext(); + if (xAC != null) { + int n = xAC.getAccessibleChildCount(); + for (int i=0; i"); + this.xToolkit = xToolkit; + this.treeModel = treeModel; + + // Initially fill the child list + try { + for (int i=0,j=xToolkit.getTopWindowCount(); i= "140" + +.INCLUDE : makefile.common + +JAVACLASSFILES= $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) + +.ENDIF + +# --- Targets ------------------------------------------------------ + + +.INCLUDE : target.mk + diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/ComponentView.java b/accessibility/workben/org/openoffice/accessibility/awb/view/ComponentView.java new file mode 100644 index 000000000000..7d3da7c0ac16 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/ComponentView.java @@ -0,0 +1,229 @@ +/************************************************************************* + * + * $RCSfile: ComponentView.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: af $ $Date: 2003/06/13 16:30:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.view; + +import java.awt.Color; +import java.awt.Dimension; + +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +import javax.swing.JLabel; + +import com.sun.star.accessibility.AccessibleEventId; +import com.sun.star.accessibility.AccessibleEventObject; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.uno.UnoRuntime; + +import org.openoffice.accessibility.misc.NameProvider; + +/** The ContextView class displays information accessible over + the XAccessibleContext interface. This includes name, + description, and role. +*/ +public class ComponentView + extends ObjectView +{ + static public ObjectView Create ( + ObjectViewContainer aContainer, + XAccessibleContext xContext) + { + if (UnoRuntime.queryInterface( + XAccessibleComponent.class, xContext) != null) + return new ComponentView (aContainer); + else + return null; + } + + public ComponentView (ObjectViewContainer aContainer) + { + super (aContainer); + + ViewGridLayout aLayout = new ViewGridLayout (this); + + maRelativeLocationLabel = aLayout.AddLabeledEntry ("Relative Location: "); + maAbsoluteLocationLabel = aLayout.AddLabeledEntry ("Location on Screen: "); + maSizeLabel = aLayout.AddLabeledEntry ("Size"); + maBoundingBoxLabel = aLayout.AddLabeledEntry ("Bounding Box: "); + maConsistencyLabel = aLayout.AddLabeledEntry ("Consistent: "); + maForegroundColorLabel = aLayout.AddLabeledEntry ("Foreground Color: "); + maBackgroundColorLabel = aLayout.AddLabeledEntry ("Background Color: "); + } + + + public void SetObject (XAccessibleContext xContext) + { + mxComponent = (XAccessibleComponent)UnoRuntime.queryInterface( + XAccessibleComponent.class, xContext); + super.SetObject (xContext); + } + + public void Update () + { + if (mxContext == null) + { + maRelativeLocationLabel.setText (""); + maAbsoluteLocationLabel.setText (""); + maSizeLabel.setText (""); + maBoundingBoxLabel.setText (""); + maConsistencyLabel.setText (""); + maForegroundColorLabel.setText (""); + maBackgroundColorLabel.setText (""); + } + else + { + com.sun.star.awt.Point aLocation = mxComponent.getLocation(); + maRelativeLocationLabel.setText ( + aLocation.X + ", " + aLocation.Y); + com.sun.star.awt.Point aLocationOnScreen = + mxComponent.getLocationOnScreen(); + maAbsoluteLocationLabel.setText ( + aLocationOnScreen.X + ", " + aLocationOnScreen.Y); + com.sun.star.awt.Size aSize = mxComponent.getSize(); + maSizeLabel.setText ( + aSize.Width + ", " + aSize.Height); + com.sun.star.awt.Rectangle aBBox = mxComponent.getBounds(); + maBoundingBoxLabel.setText ( + aBBox.X + ", " + aBBox.Y + "," + + aBBox.Width + ", " + aBBox.Height); + int nColor = mxComponent.getForeground(); + maForegroundColorLabel.setText ( + "R"+ (nColor>>16&0xff) + + "G" + (nColor>>8&0xff) + + "B" + (nColor>>0&0xff) + + "A" + (nColor>>24&0xff)); + nColor = mxComponent.getBackground(); + maBackgroundColorLabel.setText ( + "R"+ (nColor>>16&0xff) + + "G" + (nColor>>8&0xff) + + "B" + (nColor>>0&0xff) + + "A" + (nColor>>24&0xff)); + + // Check consistency of coordinates. + String sConsistency = new String (); + if (aBBox.X!=aLocation.X || aBBox.Y!=aLocation.Y) + sConsistency += (sConsistency.length()!=0?", ":"") + + "Bounding box conflicts with relative location"; + if (aBBox.Width!=aSize.Width || aBBox.Height!=aSize.Height) + sConsistency += (sConsistency.length()!=0?", ":"") + + "Bounding box conflicts with size"; + XAccessible xParent = mxContext.getAccessibleParent(); + XAccessibleComponent xParentComponent = + (XAccessibleComponent)UnoRuntime.queryInterface( + XAccessibleComponent.class, xParent); + if (xParentComponent == null) + { + if (aLocation.X != aLocationOnScreen.X + || aLocation.Y != aLocationOnScreen.Y) + sConsistency += (sConsistency.length()!=0?", ":"") + + "location on screen does not equal " + + "relative location without parent"; + } + else + { + com.sun.star.awt.Point aParentLocationOnScreen = + xParentComponent.getLocationOnScreen(); + if (aLocation.X+aParentLocationOnScreen.X + != aLocationOnScreen.X + || aLocation.Y+aParentLocationOnScreen.Y + != aLocationOnScreen.Y) + sConsistency += (sConsistency.length()!=0?", ":"") + + "location on screen does not match " + + "relative location"; + } + if (sConsistency.length() == 0) + sConsistency += "yes"; + else + maConsistencyLabel.setBackground (GetContainer().GetErrorColor()); + maConsistencyLabel.setText (sConsistency); + } + } + + public String GetTitle () + { + return ("Component"); + } + + /** Listen for changes regarding displayed values. + */ + public void notifyEvent (AccessibleEventObject aEvent) + { + switch (aEvent.EventId) + { + case AccessibleEventId.BOUNDRECT_CHANGED : + case AccessibleEventId.VISIBLE_DATA_CHANGED : + Update (); + } + } + + private XAccessibleComponent mxComponent; + private JLabel + maRelativeLocationLabel, + maAbsoluteLocationLabel, + maSizeLabel, + maBoundingBoxLabel, + maConsistencyLabel, + maForegroundColorLabel, + maBackgroundColorLabel; +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/ContextView.java b/accessibility/workben/org/openoffice/accessibility/awb/view/ContextView.java new file mode 100644 index 000000000000..16d51b6edd97 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/ContextView.java @@ -0,0 +1,149 @@ +/************************************************************************* + * + * $RCSfile: ContextView.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: af $ $Date: 2003/06/13 16:30:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.view; + +import java.awt.Color; +import java.awt.Dimension; + +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +import javax.swing.JLabel; +import javax.swing.JTextField; + +import com.sun.star.accessibility.AccessibleEventId; +import com.sun.star.accessibility.AccessibleEventObject; +import com.sun.star.accessibility.XAccessibleContext; + +import org.openoffice.accessibility.misc.NameProvider; + +/** The ContextView class displays information accessible over + the XAccessibleContext interface. This includes name, + description, and role. +*/ +public class ContextView + extends ObjectView + implements ActionListener +{ + static public ObjectView Create ( + ObjectViewContainer aContainer, + XAccessibleContext xContext) + { + if (xContext != null) + return new ContextView (aContainer); + else + return null; + } + + public ContextView (ObjectViewContainer aContainer) + { + super (aContainer); + + ViewGridLayout aLayout = new ViewGridLayout (this); + maNameLabel = aLayout.AddLabeledString ("Name:"); + maDescriptionLabel = aLayout.AddLabeledString ("Description:"); + maRoleLabel = aLayout.AddLabeledEntry ("Role:"); + } + + public void Update () + { + if (mxContext == null) + { + maNameLabel.setText (""); + maDescriptionLabel.setText (""); + maRoleLabel.setText (""); + } + else + { + maNameLabel.setText (mxContext.getAccessibleName()); + maDescriptionLabel.setText (mxContext.getAccessibleDescription()); + maRoleLabel.setText (NameProvider.getRoleName (mxContext.getAccessibleRole())); + } + } + + public String GetTitle () + { + return ("Context"); + } + + /** Listen for changes regarding displayed values. + */ + public void notifyEvent (AccessibleEventObject aEvent) + { + switch (aEvent.EventId) + { + case AccessibleEventId.NAME_CHANGED : + case AccessibleEventId.DESCRIPTION_CHANGED : + Update (); + } + } + + public void actionPerformed (ActionEvent aEvent) + { + } + + + private JLabel + maNameLabel, + maDescriptionLabel, + maRoleLabel; +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/EditableTextView.java b/accessibility/workben/org/openoffice/accessibility/awb/view/EditableTextView.java new file mode 100644 index 000000000000..b60404f22efd --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/EditableTextView.java @@ -0,0 +1,153 @@ +/************************************************************************* + * + * $RCSfile: EditableTextView.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: af $ $Date: 2003/06/13 16:30:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.view; + +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import javax.swing.JButton; + +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleEditableText; +import com.sun.star.uno.UnoRuntime; + +import org.openoffice.accessibility.awb.view.text.TextDialogFactory; + + +public class EditableTextView + extends ObjectView + implements ActionListener +{ + /** Create a EditableTextView when the given object supports the + XAccessibleEditableText interface. + */ + static public ObjectView Create ( + ObjectViewContainer aContainer, + XAccessibleContext xContext) + { + XAccessibleEditableText xEditableText = + (XAccessibleEditableText)UnoRuntime.queryInterface( + XAccessibleEditableText.class, xContext); + if (xEditableText != null) + return new EditableTextView (aContainer); + else + return null; + } + + public EditableTextView (ObjectViewContainer aContainer) + { + super (aContainer); + + JButton aButton = new JButton ("cut..."); + aButton.setFont (ViewGridLayout.GetFont()); + aButton.addActionListener (this); + add (aButton); + aButton = new JButton ("paste..."); + aButton.setFont (ViewGridLayout.GetFont()); + aButton.addActionListener (this); + add (aButton); + aButton = new JButton ("edit..."); + aButton.setFont (ViewGridLayout.GetFont()); + aButton.addActionListener (this); + add (aButton); + aButton = new JButton ("format..."); + aButton.setFont (ViewGridLayout.GetFont()); + aButton.addActionListener (this); + add (aButton); + } + + + /** Additionally to the context store a reference to the + XAccessibleEditableText interface. + */ + public void SetObject (XAccessibleContext xObject) + { + mxEditableText = (XAccessibleEditableText)UnoRuntime.queryInterface( + XAccessibleEditableText.class, xObject); + super.SetObject (xObject); + } + + public String GetTitle () + { + return ("Editable Text"); + } + + synchronized public void Destroy () + { + mxEditableText = null; + super.Destroy(); + } + + public void actionPerformed (ActionEvent aEvent) + { + String sCommand = aEvent.getActionCommand(); + if (sCommand.equals ("cut...")) + TextDialogFactory.CreateCutDialog (mxContext); + else if (sCommand.equals ("past...")) + TextDialogFactory.CreatePasteDialog (mxContext); + else if (sCommand.equals ("edit...")) + TextDialogFactory.CreateEditDialog (mxContext); + else if (sCommand.equals ("format...")) + TextDialogFactory.CreateFormatDialog (mxContext); + } + + private XAccessibleEditableText mxEditableText; +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/EventMonitorView.java b/accessibility/workben/org/openoffice/accessibility/awb/view/EventMonitorView.java new file mode 100644 index 000000000000..e01f665b5e22 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/EventMonitorView.java @@ -0,0 +1,158 @@ +/************************************************************************* + * + * $RCSfile: EventMonitorView.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: af $ $Date: 2003/06/13 16:30:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.view; + +import java.awt.BorderLayout; +import java.awt.GridBagLayout; +import java.awt.GridBagConstraints; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import javax.swing.JScrollBar; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; + +import com.sun.star.accessibility.AccessibleEventId; +import com.sun.star.accessibility.AccessibleEventObject; +import com.sun.star.accessibility.XAccessibleContext; + +import org.openoffice.accessibility.misc.NameProvider; + + +/** A simple event monitor that shows all events sent to one accessible + object. +*/ +class EventMonitorView + extends ObjectView +{ + static public ObjectView Create ( + ObjectViewContainer aContainer, + XAccessibleContext xContext) + { + if (xContext != null) + return new EventMonitorView (aContainer); + else + return null; + } + + public EventMonitorView (ObjectViewContainer aContainer) + { + super (aContainer); + Layout(); + } + + public String GetTitle () + { + return "Event Monitor"; + } + + /** Create and arrange the widgets for this view. + */ + private void Layout () + { + setLayout (new GridBagLayout ()); + + maText = new JTextArea(); + maText.setBackground (new Color (255,250,240)); + maText.setFont (new Font ("Helvetica", Font.PLAIN, 9)); + + maScrollPane = new JScrollPane (maText, + JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, + JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); + maScrollPane.setPreferredSize (new Dimension (300,80)); + + GridBagConstraints aConstraints = new GridBagConstraints (); + aConstraints.weightx = 1; + aConstraints.fill = GridBagConstraints.HORIZONTAL; + add (maScrollPane, aConstraints); + } + + + public void Update () + { + } + + + private void UpdateVerticalScrollBar () + { + JScrollBar sb = maScrollPane.getVerticalScrollBar(); + if (sb != null) + { + int nScrollBarValue = sb.getMaximum() - sb.getVisibleAmount() - 1; + sb.setValue (nScrollBarValue); + } + } + + + public void notifyEvent (AccessibleEventObject aEvent) + { + maText.append (NameProvider.getEventName (aEvent.EventId) + " : " + + aEvent.OldValue.toString() + + " -> " + + aEvent.NewValue.toString() + "\n"); + UpdateVerticalScrollBar(); + } + + private JTextArea maText; + private JScrollPane maScrollPane; +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/FocusView.java b/accessibility/workben/org/openoffice/accessibility/awb/view/FocusView.java new file mode 100644 index 000000000000..6f3f850aeb14 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/FocusView.java @@ -0,0 +1,182 @@ +/************************************************************************* + * + * $RCSfile: FocusView.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: af $ $Date: 2003/06/13 16:30:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.view; + +import java.awt.Font; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +import javax.swing.JButton; +import javax.swing.JLabel; + +import com.sun.star.accessibility.AccessibleEventId; +import com.sun.star.accessibility.AccessibleEventObject; +import com.sun.star.accessibility.AccessibleStateType; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleStateSet; +import com.sun.star.uno.UnoRuntime; + +public class FocusView + extends ObjectView + implements ActionListener +{ + /** Create a FocusView when the given object supports the + XAccessibleComponent interface. + */ + static public ObjectView Create ( + ObjectViewContainer aContainer, + XAccessibleContext xContext) + { + XAccessibleComponent xComponent = (XAccessibleComponent)UnoRuntime.queryInterface( + XAccessibleComponent.class, xContext); + if (xComponent != null) + return new FocusView (aContainer); + else + return null; + } + + public FocusView (ObjectViewContainer aContainer) + { + super (aContainer); + + setLayout (new GridBagLayout()); + GridBagConstraints aConstraints = new GridBagConstraints (); + + maFocused = new JLabel (); + maFocused.setFont (GetContainer().GetViewFont()); + aConstraints.gridy = 0; + aConstraints.weightx = 1; + aConstraints.fill = GridBagConstraints.HORIZONTAL; + add (maFocused, aConstraints); + + maGrabFocus = new JButton ("grabFocus"); + maGrabFocus.setFont (GetContainer().GetViewFont()); + aConstraints.gridy = 1; + aConstraints.fill = GridBagConstraints.NONE; + aConstraints.anchor = GridBagConstraints.WEST; + add (maGrabFocus, aConstraints); + + maGrabFocus.addActionListener (this); + } + + /** Additionally to the context store a reference to the + XAccessibleComponent interface. + */ + public void SetObject (XAccessibleContext xObject) + { + mxComponent = (XAccessibleComponent)UnoRuntime.queryInterface( + XAccessibleComponent.class, xObject); + super.SetObject (xObject); + } + + synchronized public void Destroy () + { + super.Destroy(); + maGrabFocus.removeActionListener (this); + } + + synchronized public void Update () + { + if (mxContext == null) + { + maFocused.setText (""); + maGrabFocus.setEnabled (false); + } + else + { + XAccessibleStateSet aStateSet = mxContext.getAccessibleStateSet(); + if (aStateSet.contains(AccessibleStateType.FOCUSED)) + maFocused.setText ("focused"); + else + maFocused.setText ("not focused"); + if (maGrabFocus != null) + maGrabFocus.setEnabled (true); + } + } + + public String GetTitle () + { + return ("Focus"); + } + + synchronized public void actionPerformed (ActionEvent aEvent) + { + if (aEvent.getActionCommand().equals("grabFocus")) + { + mxComponent.grabFocus(); + } + } + + public void notifyEvent (AccessibleEventObject aEvent) + { + System.out.println (aEvent); + if (aEvent.EventId == AccessibleEventId.STATE_CHANGED) + Update (); + } + + private JLabel maFocused; + private JButton maGrabFocus; + private XAccessibleComponent mxComponent; +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/LayoutManager.java b/accessibility/workben/org/openoffice/accessibility/awb/view/LayoutManager.java new file mode 100644 index 000000000000..590d17c94954 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/LayoutManager.java @@ -0,0 +1,194 @@ +/************************************************************************* + * + * $RCSfile: LayoutManager.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: af $ $Date: 2003/06/13 16:30:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.view; + +import java.awt.Component; +import java.awt.Cursor; +import java.awt.GridBagLayout; +import java.awt.GridBagConstraints; +import java.awt.Point; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.MouseEvent; +import javax.swing.JComponent; + +class LayoutManager + implements MouseListener, + MouseMotionListener +{ + public LayoutManager (JComponent aLayoutedComponent) + { + maLayoutedComponent = aLayoutedComponent; + maDraggedView = null; + mbInsertionPending = false; + } + + public void mouseClicked (MouseEvent aEvent) + { + System.out.println (aEvent); + } + public void mousePressed (MouseEvent aEvent) + { + mnOldY = aEvent.getPoint().y; + } + public void mouseReleased (MouseEvent aEvent) + { + if (mbInsertionPending) + { + InsertView (maDraggedView, aEvent.getPoint().y); + mbInsertionPending = false; + maDraggedView = null; + } + } + public void mouseEntered (MouseEvent aEvent) + { + } + public void mouseExited (MouseEvent aEvent) + { + if (mbInsertionPending) + { + InsertView (maDraggedView, mnOldY); + mbInsertionPending = false; + maDraggedView = null; + } + } + public void mouseDragged (MouseEvent aEvent) + { + int dy = mnOldY - aEvent.getPoint().y; + GridBagLayout aLayout = (GridBagLayout)maLayoutedComponent.getLayout(); + if ( ! mbInsertionPending && dy != 0) + { + maDraggedView = RemoveView (mnOldY); + if (maDraggedView != null) + mbInsertionPending = true; + } + } + public void mouseMoved (MouseEvent aEvent) + { + } + + + + + private ObjectView RemoveView (int y) + { + ObjectView aView = null; + GridBagLayout aLayout = (GridBagLayout)maLayoutedComponent.getLayout(); + + Point aGridLocation = aLayout.location (10,y); + Component[] aComponentList = maLayoutedComponent.getComponents(); + System.out.println ("removing view at " + aGridLocation); + for (int i=0; i= aGridLocation.y) + { + if (aConstraints.gridy == aGridLocation.y) + maLayoutedComponent.add (maDraggedView, aConstraints); + aConstraints.gridy += 1; + aLayout.setConstraints (aComponentList[i], aConstraints); + } + } + maLayoutedComponent.validate(); + maLayoutedComponent.repaint(); + } + maLayoutedComponent.setCursor (maNormalCursor); + } + + + + + private JComponent maLayoutedComponent; + private ObjectView maDraggedView; + private int mnOldY; + private boolean mbInsertionPending; + private Cursor maNormalCursor; +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/Makefile b/accessibility/workben/org/openoffice/accessibility/awb/view/Makefile new file mode 100644 index 000000000000..2e4eb1566afd --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/Makefile @@ -0,0 +1,13 @@ +# $Id: Makefile,v 1.1 2003/06/13 16:30:34 af Exp $ + +all : package + +ROOT=../../../../.. +PACKAGE = org.openoffice.accessibility.awb.view +SUBDIRS = text +include makefile.common + +include $(ROOT)/makefile.in + + +package : $(CLASS_FILES) diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/ObjectView.java b/accessibility/workben/org/openoffice/accessibility/awb/view/ObjectView.java new file mode 100644 index 000000000000..3c1b8e90ff26 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/ObjectView.java @@ -0,0 +1,90 @@ +package org.openoffice.accessibility.awb.view; + +import javax.swing.JPanel; + +import com.sun.star.accessibility.AccessibleEventObject; +import com.sun.star.accessibility.XAccessibleContext; + +/** This is the base class for all object views that can be placed inside an + object view container. + +

When provided with a new accessible object the container will call + the Create method to create a new instance when certain conditions are + met. It then calls SetObject to pass the object to the instance. + Finally it calls Update.

+ +

The SetObject and Update methods may be called for a new object + without calling Create first. In this way an existing instance is + recycled.

+*/ +abstract public class ObjectView + extends JPanel +{ + /** This factory method creates a new instance of the (derived) class + when the given accessible object supports all necessary features. + In the ususal case this will be the support of a specific + accessibility interface. + */ + static public ObjectView Create ( + ObjectViewContainer aContainer, + XAccessibleContext xContext) + { + return null; + } + + public ObjectView (ObjectViewContainer aContainer) + { + maContainer = aContainer; + mxContext = null; + } + + /** Call this when you want the object to be destroyed. Release all + resources when called. + */ + public void Destroy () + { + } + + /** Tell the view to display information for a new accessible object. + @param xObject + The given object may be null. A typical behaviour in this case + would be to display a blank area. But is also possible to show + information about the last object. + */ + public void SetObject (XAccessibleContext xContext) + { + mxContext = xContext; + Update (); + } + + + /** This is a request of a repaint with the current state of the current + object. The current object may or may not be the same as the one + when Update() was called the last time. + */ + public void Update () + { + } + + + /** Return a string that is used as a title of an enclosing frame. + */ + abstract public String GetTitle (); + + + public ObjectViewContainer GetContainer () + { + return maContainer; + } + + + /** Implement this method if you are interested in accessible events. + */ + public void notifyEvent (AccessibleEventObject aEvent) + {} + + /// Reference to the current object to display information about. + protected XAccessibleContext mxContext; + + protected ObjectViewContainer maContainer; +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/ObjectViewContainer.java b/accessibility/workben/org/openoffice/accessibility/awb/view/ObjectViewContainer.java new file mode 100644 index 000000000000..e5eeec95b41a --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/ObjectViewContainer.java @@ -0,0 +1,344 @@ +/************************************************************************* + * + * $RCSfile: ObjectViewContainer.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: obr $ $Date: 2003/09/19 09:21:42 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.view; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Font; +import java.awt.GridBagLayout; +import java.awt.GridBagConstraints; +import java.awt.Insets; + +import java.util.Vector; + +import java.lang.reflect.Method; +import java.lang.NoSuchMethodException; +import java.lang.IllegalAccessException; +import java.lang.reflect.InvocationTargetException; + +import javax.swing.JPanel; +import javax.swing.JTree; +import javax.swing.BorderFactory; +import javax.swing.border.Border; +import javax.swing.border.BevelBorder; +import javax.swing.SwingUtilities; + +import com.sun.star.accessibility.AccessibleEventObject; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleEventBroadcaster; +import com.sun.star.accessibility.XAccessibleEventListener; +import com.sun.star.accessibility.XAccessibleSelection; +import com.sun.star.lang.EventObject; +import com.sun.star.uno.UnoRuntime; + +import org.openoffice.accessibility.awb.view.ObjectView; + + + +/** This container of specialized object views displays information about + one accessible object. + In this it plays several roles: + 1. Object container. + 2. Accessibility event dispatcher. + 3. Object view class registration manager. + 4. Swing widget. +*/ +public class ObjectViewContainer + extends JPanel + implements XAccessibleEventListener +{ + public ObjectViewContainer () + { + maFont = new Font ("Dialog", Font.PLAIN, 11); + maViewTemplates = new Vector (); + maViewBorder = BorderFactory.createBevelBorder (BevelBorder.RAISED); + GridBagLayout aLayout = new GridBagLayout (); + setLayout (aLayout); + // maLayoutManager = new LayoutManager (this); + maLayoutManager = null; + + RegisterView (ContextView.class); + RegisterView (ComponentView.class); + RegisterView (ParentView.class); + RegisterView (StateSetView.class); + RegisterView (FocusView.class); + RegisterView (TextView.class); + RegisterView (EditableTextView.class); + RegisterView (TableView.class); + RegisterView (SelectionView.class); + RegisterView (ServiceInterfaceView.class); + RegisterView (EventMonitorView.class); + + mxContext = null; + + // addMouseListener (maLayoutManager); + // addMouseMotionListener (maLayoutManager); + } + + + + /** Remove all existing views and create new ones according to the + interfaces supported by the given object. + */ + public synchronized void SetObject (XAccessibleContext xContext) + { + // Call Destroy at all views to give them a chance to release their + // resources. + int n = getComponentCount(); + for (int i=0; i= 0) + maViewTemplates.setElementAt (aSubstitution, nIndex); + } + + + /** Return a font that should be used for widgets in the views. + */ + public Font GetViewFont () + { + return maFont; + } + + public Color GetErrorColor () + { + return new Color (255,80,50); + } + + /** Add an object view and place it below all previously added views. + @param aView + This argument may be null. In this case nothing happens. + */ + private void Add (ObjectView aView) + { + if (aView != null) + { + GridBagConstraints constraints = new GridBagConstraints (); + constraints.gridx = 0; + constraints.gridy = getComponentCount(); + constraints.gridwidth = 1; + constraints.gridheight = 1; + constraints.weightx = 1; + constraints.weighty = 0; + constraints.ipadx = 2; + constraints.ipady = 5; + constraints.insets = new Insets (5,5,5,5); + constraints.anchor = GridBagConstraints.NORTH; + constraints.fill = GridBagConstraints.HORIZONTAL; + + aView.setBorder ( + BorderFactory.createTitledBorder ( + maViewBorder, aView.GetTitle())); + + add (aView, constraints); + } + } + + /** Update the layout manager by setting the vertical weight of the + bottom entry to 1 and so make it strech to over the available + space. + + */ + private void UpdateLayoutManager () + { + // Adapt the layout manager. + if (getComponentCount() > 1000) + { + Component aComponent = getComponent (getComponentCount()-1); + GridBagLayout aLayout = (GridBagLayout)getLayout(); + GridBagConstraints aConstraints = aLayout.getConstraints (aComponent); + aConstraints.weighty = 1; + aLayout.setConstraints (aComponent, aConstraints); + } + } + + + + + /** Put the event just received into the event queue which will deliver + it soon asynchronuously to the DispatchEvent method. + */ + public void notifyEvent (final AccessibleEventObject aEvent) + { + SwingUtilities.invokeLater( + new Runnable() + { + public void run() + { + DispatchEvent (aEvent); + } + } + ); + } + + + + + /** Forward accessibility events to all views without them being + registered as event listeners each on their own. + */ + private void DispatchEvent (AccessibleEventObject aEvent) + { + int n = getComponentCount(); + for (int i=0; i"); + maIndexLabel.setText (""); + maValidLabel.setText (""); + maChildrenLabel.setText (""); + } + else + { + XAccessible xParent = mxContext.getAccessibleParent(); + int nIndex = mxContext.getAccessibleIndexInParent(); + maIndexLabel.setText (Integer.toString(nIndex)); + if (xParent != null) + { + maParentLabel.setText ("yes"); + XAccessibleContext xParentContext = + xParent.getAccessibleContext(); + if (xParentContext != null) + { + try + { + XAccessible xChild = + xParentContext.getAccessibleChild(nIndex); + if (xChild != mxContext) + maValidLabel.setText ("yes"); + else + { + maValidLabel.setText ("no"); + maValidLabel.setBackground (GetContainer().GetErrorColor()); + } + } + catch (IndexOutOfBoundsException e) + { + maValidLabel.setText ("no: invalid index in parent"); + maValidLabel.setBackground (GetContainer().GetErrorColor()); + } + } + else + { + maValidLabel.setText ("no: parent has no context"); + maValidLabel.setBackground (GetContainer().GetErrorColor()); + } + } + else + maParentLabel.setText ("no"); + maChildrenLabel.setText (Integer.toString(mxContext.getAccessibleChildCount())); + } + } + + public String GetTitle () + { + return ("Parent"); + } + + + /** Listen for changes regarding displayed values. + */ + public void notifyEvent (AccessibleEventObject aEvent) + { + switch (aEvent.EventId) + { + default: + Update (); + } + } + + + private JLabel + maParentLabel, + maIndexLabel, + maValidLabel, + maChildrenLabel; +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/SelectionView.java b/accessibility/workben/org/openoffice/accessibility/awb/view/SelectionView.java new file mode 100644 index 000000000000..5967e4ae1ad4 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/SelectionView.java @@ -0,0 +1,301 @@ +/************************************************************************* + * + * $RCSfile: SelectionView.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: af $ $Date: 2003/06/13 16:30:36 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.view; + +import java.util.Vector; + +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.GridBagLayout; +import java.awt.GridBagConstraints; + +import javax.swing.BoxLayout; +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JOptionPane; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JToggleButton; +import javax.swing.ListSelectionModel; + + +import com.sun.star.accessibility.AccessibleEventId; +import com.sun.star.accessibility.AccessibleEventObject; +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.AccessibleStateType; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleSelection; +import com.sun.star.accessibility.XAccessibleStateSet; + +import com.sun.star.uno.UnoRuntime; +import com.sun.star.lang.IndexOutOfBoundsException; + + +/** Display a list of children and select/deselect buttons +*/ +class SelectionView + extends ObjectView + implements ActionListener +{ + static public ObjectView Create ( + ObjectViewContainer aContainer, + XAccessibleContext xContext) + { + XAccessibleSelection xSelection = (XAccessibleSelection)UnoRuntime.queryInterface( + XAccessibleSelection.class, xContext); + if (xSelection != null) + return new SelectionView(aContainer); + else + return null; + } + + public SelectionView (ObjectViewContainer aContainer) + { + super (aContainer); + Layout(); + } + + public String GetTitle () + { + return "Selection"; + } + + /** Create and arrange the widgets for this view. + */ + private void Layout () + { + setLayout (new GridBagLayout()); + + GridBagConstraints aConstraints = new GridBagConstraints(); + + // Label that shows whether the selection is multi selectable. + aConstraints.gridx = 0; + aConstraints.gridy = 0; + aConstraints.anchor = GridBagConstraints.WEST; + maTypeLabel = new JLabel (); + maTypeLabel.setFont (maContainer.GetViewFont()); + add (maTypeLabel, aConstraints); + + // the JListBox + maChildrenSelector = new JPanel (); + maChildrenSelector.setPreferredSize (new Dimension (100,100)); + maChildrenSelector.setLayout ( + new BoxLayout (maChildrenSelector, BoxLayout.Y_AXIS)); + + aConstraints.gridx = 0; + aConstraints.gridwidth = 4; + aConstraints.gridy = 1; + aConstraints.fill = GridBagConstraints.HORIZONTAL; + add (new JScrollPane (maChildrenSelector, + JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, + JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED), + aConstraints); + + JButton aButton; + aButton = new JButton( "Select all" ); + aButton.setFont (maContainer.GetViewFont()); + aButton.setActionCommand( "Select all" ); + aButton.addActionListener( this ); + aConstraints.gridx = 0; + aConstraints.gridwidth = 1; + aConstraints.gridy = 2; + aConstraints.fill = GridBagConstraints.NONE; + aConstraints.anchor = GridBagConstraints.WEST; + add (aButton, aConstraints); + + aButton = new JButton( "Clear Selection" ); + aButton.setFont (maContainer.GetViewFont()); + aButton.setActionCommand( "Clear Selection" ); + aButton.addActionListener( this ); + aConstraints.gridx = 1; + aConstraints.gridy = 2; + aConstraints.weightx = 1; + add (aButton, aConstraints); + + setSize (getPreferredSize()); + } + + + public void SetObject (XAccessibleContext xContext) + { + mxSelection = (XAccessibleSelection)UnoRuntime.queryInterface( + XAccessibleSelection.class, xContext); + super.SetObject (xContext); + } + + + public void Update () + { + maChildrenSelector.removeAll (); + + // Determine whether multi selection is possible. + XAccessibleStateSet aStateSet = mxContext.getAccessibleStateSet(); + boolean bMultiSelectable = false; + if (aStateSet!=null && aStateSet.contains( + AccessibleStateType.MULTI_SELECTABLE)) + { + bMultiSelectable = true; + maTypeLabel.setText ("multi selectable"); + } + else + { + maTypeLabel.setText ("single selectable"); + } + + if (mxContext.getAccessibleRole() != AccessibleRole.TABLE) + { + int nCount = mxContext.getAccessibleChildCount(); + for (int i=0; i"))); + } + } + + private void CreateServiceTree () + { + XServiceInfo xServiceInfo = (XServiceInfo)UnoRuntime.queryInterface( + XServiceInfo.class, mxContext); + maServiceRoot.removeAllChildren(); + if (xServiceInfo != null) + { + String[] aServiceNames = xServiceInfo.getSupportedServiceNames(); + int nCount = aServiceNames.length; + for (int i=0; i"); + boolean bStateSet = xStateSet.contains (i); + g.setTransform (aTransform); + g.translate (x,y); + if (bStateSet) + { + switch (i) + { + case AccessibleStateType.INVALID: + case AccessibleStateType.DEFUNC: + g.setColor (saInvalidColor); + break; + case AccessibleStateType.FOCUSED: + g.setColor (saFocusColor); + break; + case AccessibleStateType.SELECTED: + g.setColor (saSelectionColor); + break; + case AccessibleStateType.EDITABLE: + g.setColor (saEditColor); + break; + default: + g.setColor (saDefaultColor); + break; + } + g.fill (aCheckBox); + g.setColor (aTextColor); + } + g.draw (aCheckBox); + g.rotate (nTextRotation); + g.scale (nScale, nScale); + g.translate (2,-2); + g.drawString (sStateName, 0,0); + } + + // Draw string of set states. + String sStates = new String (); + for (int i=0; i 0) + sStates = sStates + ", "; + sStates = sStates + NameProvider.getStateName(aStates[i]); + } + g.setTransform (aTransform); + g.translate (10,aWidgetArea.y+aWidgetArea.height-3); + g.scale (0.9,0.9); + g.drawString (sStates,0,0); + } + } + + static private Color + saInvalidColor = new Color (255,0,255), + saFocusColor = new Color (100,100,255), + saSelectionColor = Color.GREEN, + saDefaultColor = new Color (90,90,90), + saEditColor = new Color (240,240,0); +} + + diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/TableView.java b/accessibility/workben/org/openoffice/accessibility/awb/view/TableView.java new file mode 100644 index 000000000000..ad185ce86f7b --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/TableView.java @@ -0,0 +1,195 @@ +/************************************************************************* + * + * $RCSfile: TableView.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: af $ $Date: 2003/06/13 16:30:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.view; + +import java.lang.Integer; +import java.lang.StringBuffer; + +import javax.swing.JLabel; + +import com.sun.star.accessibility.AccessibleEventId; +import com.sun.star.accessibility.AccessibleEventObject; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleTable; +import com.sun.star.uno.UnoRuntime; + + + +/** The ContextView class displays information accessible over + the XAccessibleContext interface. This includes name, + description, and role. +*/ +public class TableView + extends ObjectView +{ + static public ObjectView Create ( + ObjectViewContainer aContainer, + XAccessibleContext xContext) + { + if (UnoRuntime.queryInterface( + XAccessibleTable.class, xContext) != null) + return new TableView (aContainer); + else + return null; + } + + public TableView (ObjectViewContainer aContainer) + { + super (aContainer); + + ViewGridLayout aLayout = new ViewGridLayout (this); + + maRowCountLabel = aLayout.AddLabeledEntry ("Row Count: "); + maColumnCountLabel = aLayout.AddLabeledEntry ("Column Count: "); + maCellCountLabel = aLayout.AddLabeledEntry ("Cell Count: "); + maSelectedRowsLabel = aLayout.AddLabeledEntry ("Selected Rows: "); + maSelectedColumnsLabel = aLayout.AddLabeledEntry ("Selected Columns: "); + } + + + public void SetObject (XAccessibleContext xContext) + { + mxTable = (XAccessibleTable)UnoRuntime.queryInterface( + XAccessibleTable.class, xContext); + super.SetObject (xContext); + } + + + public void Update () + { + if (mxTable == null) + { + maRowCountLabel.setText (""); + maColumnCountLabel.setText (""); + maCellCountLabel.setText (""); + maSelectedRowsLabel.setText (""); + maSelectedColumnsLabel.setText (""); + } + else + { + int nRowCount = mxTable.getAccessibleRowCount(); + int nColumnCount = mxTable.getAccessibleColumnCount(); + maRowCountLabel.setText (Integer.toString (nRowCount)); + maColumnCountLabel.setText (Integer.toString (nColumnCount)); + maCellCountLabel.setText (Integer.toString (nRowCount*nColumnCount)); + + StringBuffer sList = new StringBuffer(); + int[] aSelected = mxTable.getSelectedAccessibleRows(); + boolean bFirst = true; + for (int i=0; i"); + maCharacterArrayLabel.setText (""); + maCharacterCountLabel.setText (""); + maSelectionLabel.setText (""); + maBoundsLabel.setText (""); + maCaretLineNoLabel.setText (""); + maCaretLineTextLabel.setText (""); + maLineNoFromCaretPosLabel.setText (""); + maLineTextFromCaretPosLabel.setText (""); + } + else + { + maTextLabel.setText (mxText.getText()); + maCharacterArrayLabel.setText (GetCharacterArray()); + maCharacterCountLabel.setText ( + Integer.toString(mxText.getCharacterCount())); + // Selection. + maSelectionLabel.setText ( + "[" + mxText.getSelectionStart() + + "," + mxText.getSelectionEnd() + + "] \"" + mxText.getSelectedText() + "\""); + + // Character bounds. + maBoundsLabel.setText (GetTextBoundsString()); + + // Caret position. + maCaretPositionSpinner.setValue (new Integer (mxText.getCaretPosition())); + + // Multi line methods. + XAccessibleMultiLineText xMultiText = (XAccessibleMultiLineText) + UnoRuntime.queryInterface( XAccessibleMultiLineText.class, mxText ); + + if( null != xMultiText ) { + try { + maCaretLineNoLabel.setText ( Integer.toString( xMultiText.getNumberOfLineWithCaret() ) ); + TextSegment ts = xMultiText.getTextAtLineWithCaret(); + maCaretLineTextLabel.setText ( "[" + ts.SegmentStart + + "," + ts.SegmentEnd + + "] \"" + ts.SegmentText + "\""); + maLineNoFromCaretPosLabel.setText ( Integer.toString( xMultiText.getLineNumberAtIndex( mxText.getCaretPosition() ) ) ); + ts = xMultiText.getTextAtLineNumber(xMultiText.getLineNumberAtIndex( mxText.getCaretPosition() ) ); + maLineTextFromCaretPosLabel.setText ( "[" + ts.SegmentStart + + "," + ts.SegmentEnd + + "] \"" + ts.SegmentText + "\""); + } catch( IndexOutOfBoundsException e) { + } + } + + // Text segments. + aRoot.add (CreateNode ("Character", AccessibleTextType.CHARACTER)); + aRoot.add (CreateNode ("Word", AccessibleTextType.WORD)); + aRoot.add (CreateNode ("Sentence", AccessibleTextType.SENTENCE)); + aRoot.add (CreateNode ("Paragraph", AccessibleTextType.PARAGRAPH)); + aRoot.add (CreateNode ("Line", AccessibleTextType.LINE)); + aRoot.add (CreateNode ("Attribute", AccessibleTextType.ATTRIBUTE_RUN)); + aRoot.add (CreateNode ("Glyph", AccessibleTextType.GLYPH)); + } + ((DefaultTreeModel)maTree.getModel()).setRoot (aRoot); + } + + public String GetTitle () + { + return ("Text"); + } + + public void notifyEvent (AccessibleEventObject aEvent) + { + System.out.println (aEvent); + switch (aEvent.EventId) + { + case AccessibleEventId.CARET_CHANGED : + maCaretSpinnerModel.Update(); + Update (); + break; + + case AccessibleEventId.TEXT_CHANGED : + case AccessibleEventId.TEXT_SELECTION_CHANGED: + Update (); + break; + } + } + + public void actionPerformed (ActionEvent aEvent) + { + String sCommand = aEvent.getActionCommand(); + if (sCommand.equals ("select...")) + TextDialogFactory.CreateSelectionDialog (mxContext); + else if (sCommand.equals ("copy...")) + TextDialogFactory.CreateCopyDialog (mxContext); + } + + + + /** Create a string that is a list of all characters returned by the + getCharacter() method. + */ + private String GetCharacterArray () + { + // Do not show more than 30 characters. + int nCharacterCount = mxText.getCharacterCount(); + int nMaxDisplayCount = 30; + + // build up string + StringBuffer aCharacterArray = new StringBuffer(); + int nIndex = 0; + try + { + while (nIndex= 0) && (nIndex < mxText.getCharacter(i))) + aBuffer.append (mxText.getCharacter(nIndex)); + else + aBuffer.append ('#'); + } + } + catch (IndexOutOfBoundsException aEvent) + { + // Ignore errors. + } + + return aBuffer.toString(); + } + + + + + private final static int BEFORE = -1; + private final static int AT = 0; + private final static int BEHIND = +1; + + private MutableTreeNode CreateNode (String sTitle, short nTextType) + { + DefaultMutableTreeNode aNode = new DefaultMutableTreeNode (sTitle); + + aNode.add (CreateSegmentNode ("Before", nTextType, BEFORE)); + aNode.add (CreateSegmentNode ("At", nTextType, AT)); + aNode.add (CreateSegmentNode ("Behind", nTextType, BEHIND)); + + return aNode; + } + + private MutableTreeNode CreateSegmentNode (String sTitle, short nTextType, int nWhere) + { + TextSegment aSegment; + int nTextLength = mxText.getCharacterCount(); + DefaultMutableTreeNode aNode = new DefaultMutableTreeNode (sTitle); + for (int nIndex=0; nIndex<=nTextLength; /* empty */) + { + aSegment = GetTextSegment (nIndex, nTextType, nWhere); + DefaultMutableTreeNode aSegmentNode = new DefaultMutableTreeNode ( + new StringBuffer ( + Integer.toString (nIndex) + " -> " + + Integer.toString (aSegment.SegmentStart) + " - " + + Integer.toString (aSegment.SegmentEnd) + " : " + + aSegment.SegmentText.toString())); + aNode.add (aSegmentNode); + if (nTextType == AccessibleTextType.ATTRIBUTE_RUN) + AddAttributeNodes (aSegmentNode, aSegment); + if (aSegment.SegmentEnd > nIndex) + nIndex = aSegment.SegmentEnd; + else + nIndex ++; + } + + return aNode; + } + + + private TextSegment GetTextSegment (int nIndex, short nTextType, int nWhere) + { + TextSegment aSegment; + + try + { + switch (nWhere) + { + case BEFORE: + aSegment = mxText.getTextBeforeIndex (nIndex, nTextType); + break; + + case AT: + aSegment = mxText.getTextAtIndex (nIndex, nTextType); + break; + + case BEHIND: + aSegment = mxText.getTextBehindIndex (nIndex, nTextType); + break; + + default: + aSegment = new TextSegment(); + aSegment.SegmentText = new String ("unknown position " + nWhere); + aSegment.SegmentStart = nIndex; + aSegment.SegmentStart = nIndex+1; + break; + } + } + catch (IndexOutOfBoundsException aException) + { + aSegment = new TextSegment (); + aSegment.SegmentText = new String ("Invalid index at ") + nIndex + " : " + + aException.toString(); + aSegment.SegmentStart = nIndex; + aSegment.SegmentEnd = nIndex+1; + } + catch (IllegalArgumentException aException) + { + aSegment = new TextSegment (); + aSegment.SegmentText = new String ("Illegal argument at ") + nIndex + " : " + + aException.toString(); + aSegment.SegmentStart = nIndex; + aSegment.SegmentEnd = nIndex+1; + } + + return aSegment; + } + + + /** Add to the given node one node for every attribute of the given segment. + */ + private void AddAttributeNodes ( + DefaultMutableTreeNode aNode, + TextSegment aSegment) + { + try + { + PropertyValue[] aValues = mxText.getCharacterAttributes ( + aSegment.SegmentStart, aAttributeList); + for (int i=0; i= "140" + +.INCLUDE : makefile.common + +JAVACLASSFILES= $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) + +.ENDIF + +# --- Targets ------------------------------------------------------ + + +.INCLUDE : target.mk + diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/text/CaretSpinnerModel.java b/accessibility/workben/org/openoffice/accessibility/awb/view/text/CaretSpinnerModel.java new file mode 100644 index 000000000000..6289697ee375 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/text/CaretSpinnerModel.java @@ -0,0 +1,156 @@ +/************************************************************************* + * + * $RCSfile: CaretSpinnerModel.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: obr $ $Date: 2008/05/14 13:21:37 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.view.text; + +import java.lang.Integer; +import java.util.Vector; +import javax.swing.SpinnerModel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +import com.sun.star.accessibility.XAccessibleText; +import com.sun.star.lang.IndexOutOfBoundsException; + + +/** A simple model for JSpinner objects that clips the spinner values to valid + text indices. +*/ +public class CaretSpinnerModel + implements SpinnerModel +{ + public CaretSpinnerModel (XAccessibleText xText) + { + mxText = xText; + maListeners = new Vector (); + } + + public void addChangeListener (ChangeListener aListener) + { + if (aListener != null) + maListeners.add (aListener); + } + + public void removeChangeListener (ChangeListener aListener) + { + maListeners.removeElement (aListener); + } + + public Object getNextValue () + { + if (mxText != null) + { + int nPosition = mxText.getCaretPosition(); + if (nPosition+1 <= mxText.getCharacterCount()) + return new Integer (nPosition+1); + } + return null; + } + + public Object getPreviousValue () + { + if (mxText != null) + { + int nPosition = mxText.getCaretPosition(); + if (nPosition > 0) + return new Integer (nPosition-1); + } + return null; + } + + public Object getValue () + { + if (mxText != null) + return new Integer (mxText.getCaretPosition()); + else + return null; + } + + public void setValue (Object aValue) + { + if (mxText != null) + if (aValue instanceof Integer) + { + try + { + if( ((Integer)aValue).intValue() != mxText.getCaretPosition() ) + mxText.setCaretPosition (((Integer)aValue).intValue()); + } + catch (IndexOutOfBoundsException aException) + { + } + } + } + + /** Call this method when the caret position has changes so that the model + can inform its listeners about it. + */ + public void Update () + { + ChangeEvent aEvent = new ChangeEvent (this); + for (int i=0; i 0) + aContent.add (new JLabel (msExplanation), BorderLayout.NORTH); + + // the text field + maText = new JTextArea(); + maText.setLineWrap (true); + maText.setEditable (false); + aContent.add (maText, BorderLayout.CENTER); + + XAccessibleText xText = (XAccessibleText)UnoRuntime.queryInterface( + XAccessibleText.class, mxContext); + String sText = xText.getText(); + maText.setText (sText); + maText.setRows (sText.length() / 40 + 1); + maText.setColumns (Math.min (Math.max (40, sText.length()), 20)); + + JPanel aButtons = new JPanel(); + aButtons.setLayout (new FlowLayout()); + maIndexToggle = new JCheckBox ("reverse selection"); + aButtons.add (maIndexToggle); + + JButton aActionButton = new JButton (msTitle); + aActionButton.setActionCommand ("Action"); + aActionButton.addActionListener (this); + aButtons.add (aActionButton); + + JButton aCancelButton = new JButton ("cancel"); + aCancelButton.setActionCommand ("Cancel"); + aCancelButton.addActionListener (this); + aButtons.add (aCancelButton); + + // add Panel with buttons + aContent.add (aButtons, BorderLayout.SOUTH); + } + + protected void Cancel() + { + hide(); + dispose(); + } + + public void actionPerformed(ActionEvent e) + { + String sCommand = e.getActionCommand(); + + if( "Cancel".equals( sCommand ) ) + Cancel(); + else if( "Action".equals( sCommand ) ) + Action(); + } + + + protected int GetSelectionStart() + { + return GetSelection(true); + } + protected int GetSelectionEnd() + { + return GetSelection(false); + } + private int GetSelection (boolean bStart) + { + if (bStart ^ maIndexToggle.isSelected()) + return maText.getSelectionStart(); + else + return maText.getSelectionEnd(); + } + + + + protected void Action () + { + String sError = null; + boolean bSuccess = true; + try + { + XAccessibleText xText = + (XAccessibleText)UnoRuntime.queryInterface( + XAccessibleText.class, mxContext); + if (xText != null) + bSuccess = bSuccess && TextAction (xText); + + XAccessibleEditableText xEditableText = + (XAccessibleEditableText)UnoRuntime.queryInterface( + XAccessibleEditableText.class, mxContext); + if (xEditableText != null) + bSuccess = bSuccess && EditableTextAction (xEditableText); + + if ( ! bSuccess) + sError = "Can't execute"; + } + catch (IndexOutOfBoundsException e) + { + sError = "Index out of bounds"; + } + + if (sError != null) + JOptionPane.showMessageDialog ( + this,// AccessibilityWorkBench.Instance(), + sError, + msTitle, + JOptionPane.ERROR_MESSAGE); + + Cancel(); + } + + /** override this for dialog-specific action */ + boolean TextAction (XAccessibleText xText) + throws IndexOutOfBoundsException + { + return true; + } + + boolean EditableTextAction (XAccessibleEditableText xText) + throws IndexOutOfBoundsException + { + return true; + } + + private XAccessibleContext mxContext; + protected JTextArea maText; + private String msTitle; + private String msExplanation; + private JCheckBox maIndexToggle; +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/text/TextAttributeDialog.java b/accessibility/workben/org/openoffice/accessibility/awb/view/text/TextAttributeDialog.java new file mode 100644 index 000000000000..36d81162462c --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/text/TextAttributeDialog.java @@ -0,0 +1,213 @@ +/************************************************************************* + * + * $RCSfile: TextAttributeDialog.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: af $ $Date: 2003/06/13 16:30:42 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.view.text; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import javax.swing.BoxLayout; +import javax.swing.Icon; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JColorChooser; +import javax.swing.JPanel; +import javax.swing.text.JTextComponent; + +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleEditableText; +import com.sun.star.beans.PropertyValue; +import com.sun.star.lang.IndexOutOfBoundsException; +import com.sun.star.uno.UnoRuntime; + + +class TextAttributeDialog + extends TextActionDialog +{ + public TextAttributeDialog (XAccessibleContext xContext) + { + super (xContext, + "Choose attributes, select text, and press 'Set':", + "set"); + } + + protected void Layout () + { + super.Layout (); + + maForeground = Color.black; + maBackground = Color.white; + + JPanel aPanel = new JPanel(); + aPanel.setLayout (new BoxLayout (aPanel, BoxLayout.Y_AXIS)); + + maBoldCheckBox = new JCheckBox ("bold"); + maUnderlineCheckBox = new JCheckBox ("underline"); + maItalicsCheckBox = new JCheckBox ("italics"); + + JButton aForegroundButton = new JButton ("Foreground", + new TextAttributeDialog.ColorIcon(true)); + aForegroundButton.addActionListener (new ActionListener() + { + public void actionPerformed (ActionEvent aEvent) + { + maForeground = JColorChooser.showDialog ( + TextAttributeDialog.this, + "Select Foreground Color", + maForeground); + } + } ); + + JButton aBackgroundButton = new JButton("Background", + new TextAttributeDialog.ColorIcon(false)); + aBackgroundButton.addActionListener (new ActionListener() + { + public void actionPerformed (ActionEvent eEvent) + { + maBackground = JColorChooser.showDialog( + TextAttributeDialog.this, + "Select Background Color", + maBackground); + } + } ); + + aPanel.add (maBoldCheckBox); + aPanel.add (maUnderlineCheckBox); + aPanel.add (maItalicsCheckBox); + aPanel.add (aForegroundButton); + aPanel.add (aBackgroundButton); + + getContentPane().add (aPanel, BorderLayout.WEST); + } + + + /** edit the text */ + boolean EditableTextAction (XAccessibleEditableText xText) + throws IndexOutOfBoundsException + { + PropertyValue[] aSequence = new PropertyValue[6]; + aSequence[0] = new PropertyValue(); + aSequence[0].Name = "CharWeight"; + aSequence[0].Value = new Integer (maBoldCheckBox.isSelected() ? 150 : 100); + aSequence[1] = new PropertyValue(); + aSequence[1].Name = "CharUnderline"; + aSequence[1].Value = new Integer (maUnderlineCheckBox.isSelected() ? 1 : 0); + aSequence[2] = new PropertyValue(); + aSequence[2].Name = "CharBackColor"; + aSequence[2].Value = new Integer (maBackground.getRGB()); + aSequence[3] = new PropertyValue(); + aSequence[3].Name = "CharColor"; + aSequence[3].Value = new Integer (maForeground.getRGB()); + aSequence[4] = new PropertyValue(); + aSequence[4].Name = "CharPosture"; + aSequence[4].Value = new Integer (maItalicsCheckBox.isSelected() ? 1 : 0); + aSequence[5] = new PropertyValue(); + aSequence[5].Name = "CharBackTransparent"; + aSequence[5].Value = new Boolean (false); + + return xText.setAttributes ( + GetSelectionStart(), + GetSelectionEnd(), + aSequence); + } + + class ColorIcon + implements Icon + { + public ColorIcon(boolean bWhich) { bForeground = bWhich; } + public int getIconHeight() { return nHeight; } + public int getIconWidth() { return nWidth; } + public void paintIcon (Component c, Graphics g, int x, int y) + { + g.setColor( getColor() ); + g.fillRect( x, y, nHeight, nWidth ); + g.setColor( c.getForeground() ); + g.drawRect( x, y, nHeight, nWidth ); + } + Color getColor() + { + if (bForeground) + return maForeground; + else + return maBackground; + } + + private static final int nHeight = 16; + private static final int nWidth = 16; + private boolean bForeground; + } + + + + + private JCheckBox + maBoldCheckBox, + maUnderlineCheckBox, + maItalicsCheckBox; + private Color + maForeground, + maBackground; + +} + diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/text/TextDialogFactory.java b/accessibility/workben/org/openoffice/accessibility/awb/view/text/TextDialogFactory.java new file mode 100644 index 000000000000..397c3f8b1877 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/text/TextDialogFactory.java @@ -0,0 +1,170 @@ +/************************************************************************* + * + * $RCSfile: TextDialogFactory.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: af $ $Date: 2003/06/13 16:30:43 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.view.text; + +import javax.swing.JDialog; +import javax.swing.text.JTextComponent; + +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleEditableText; +import com.sun.star.accessibility.XAccessibleText; +import com.sun.star.lang.IndexOutOfBoundsException; +import com.sun.star.uno.UnoRuntime; + + +/** Factory for dialogs of the text views. +*/ +public class TextDialogFactory +{ + static public JDialog CreateSelectionDialog (XAccessibleContext xContext) + { + JDialog aDialog = new TextActionDialog( + xContext, + "Select range:", + "select") + { + boolean TextAction (XAccessibleText xText) + throws IndexOutOfBoundsException + { + return xText.setSelection( + GetSelectionStart(), + GetSelectionEnd() ); + } + }; + if (aDialog != null) + aDialog.show(); + return aDialog; + } + + static public JDialog CreateCopyDialog (XAccessibleContext xContext) + { + JDialog aDialog = new TextActionDialog( + xContext, + "Select range and copy:", + "copy") + { + boolean TextAction (XAccessibleText xText) + throws IndexOutOfBoundsException + { + return xText.copyText( + GetSelectionStart(), + GetSelectionEnd()); + } + }; + if (aDialog != null) + aDialog.show(); + return aDialog; + } + static public JDialog CreateCutDialog (XAccessibleContext xContext) + { + JDialog aDialog = new TextActionDialog( + xContext, + "Select range and cut:", + "cut") + { + boolean EditableTextAction (XAccessibleEditableText xText) + throws IndexOutOfBoundsException + { + return xText.cutText( + GetSelectionStart(), + GetSelectionEnd() ); + } + }; + if (aDialog != null) + aDialog.show(); + return aDialog; + } + static public JDialog CreatePasteDialog (XAccessibleContext xContext) + { + JDialog aDialog = new TextActionDialog ( + xContext, + "Place Caret and paste:", + "paste") + { + boolean EditableTextAction (XAccessibleEditableText xText) + throws IndexOutOfBoundsException + { + return xText.pasteText(maText.getCaretPosition()); + } + }; + if (aDialog != null) + aDialog.show(); + return aDialog; + } + static public JDialog CreateEditDialog (XAccessibleContext xContext) + { + JDialog aDialog = new TextEditDialog ( + xContext, + "Edit text:", + "edit"); + if (aDialog != null) + aDialog.show(); + return aDialog; + } + static public JDialog CreateFormatDialog (XAccessibleContext xContext) + { + JDialog aDialog = new TextAttributeDialog (xContext); + if (aDialog != null) + aDialog.show(); + return aDialog; + } +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/text/TextEditDialog.java b/accessibility/workben/org/openoffice/accessibility/awb/view/text/TextEditDialog.java new file mode 100644 index 000000000000..55dfea6fb0b2 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/text/TextEditDialog.java @@ -0,0 +1,156 @@ +/************************************************************************* + * + * $RCSfile: TextEditDialog.java,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: af $ $Date: 2003/06/13 16:30:43 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.awb.view.text; + +import javax.swing.text.JTextComponent; + +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleEditableText; +import com.sun.star.lang.IndexOutOfBoundsException; +import com.sun.star.uno.UnoRuntime; + + +class TextEditDialog + extends TextActionDialog +{ + public TextEditDialog ( + XAccessibleContext xContext, + String sExplanation, + String sTitle ) + { + super (xContext, sExplanation, sTitle); + } + + protected void Layout() + { + super.Layout(); + maText.setEditable (true); + } + + + /** edit the text */ + boolean EditableTextAction (XAccessibleEditableText xText) + { + return UpdateText (xText, maText.getText()); + } + + + /** update the text */ + boolean UpdateText (XAccessibleEditableText xText, String sNew) + { + boolean bResult = false; + + String sOld = xText.getText(); + + // false alarm? Early out if no change was done! + if ( ! sOld.equals (sNew)) + { + + // Get the minimum length of both strings. + int nMinLength = sOld.length(); + if (sNew.length() < nMinLength) + nMinLength = sNew.length(); + + // Count equal characters from front and end. + int nFront = 0; + while ((nFront < nMinLength) && + (sNew.charAt(nFront) == sOld.charAt(nFront))) + nFront++; + int nBack = 0; + while ((nBack < nMinLength) && + (sNew.charAt(sNew.length()-nBack-1) == + sOld.charAt(sOld.length()-nBack-1) )) + nBack++; + if (nFront + nBack > nMinLength) + nBack = nMinLength - nFront; + + // so... the first nFront and the last nBack characters are the + // same. Change the others! + String sDel = sOld.substring (nFront, sOld.length() - nBack); + String sIns = sNew.substring (nFront, sNew.length() - nBack); + + System.out.println ("edit text: " + + sOld.substring(0, nFront) + + " [ " + sDel + " -> " + sIns + " ] " + + sOld.substring(sOld.length() - nBack)); + + try + { + // edit the text, and use + // (set|insert|delete|replace)Text as needed + if( nFront+nBack == 0 ) + bResult = xText.setText( sIns ); + else if( sDel.length() == 0 ) + bResult = xText.insertText( sIns, nFront ); + else if( sIns.length() == 0 ) + bResult = xText.deleteText( nFront, sOld.length()-nBack ); + else + bResult = xText.replaceText(nFront, sOld.length()-nBack,sIns); + } + catch( IndexOutOfBoundsException aException) + { + } + } + + return bResult; + } +} diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/text/makefile.common b/accessibility/workben/org/openoffice/accessibility/awb/view/text/makefile.common new file mode 100644 index 000000000000..32655a0c6a6f --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/text/makefile.common @@ -0,0 +1,65 @@ +#************************************************************************* +# +# $RCSfile: makefile.common,v $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +JARFILES = sandbox.jar jurt.jar unoil.jar ridl.jar +JAVAFILES = \ + CaretSpinnerModel.java \ + TextActionDialog.java \ + TextEditDialog.java \ + TextAttributeDialog.java \ + TextDialogFactory.java diff --git a/accessibility/workben/org/openoffice/accessibility/awb/view/text/makefile.mk b/accessibility/workben/org/openoffice/accessibility/awb/view/text/makefile.mk new file mode 100644 index 000000000000..05f5b3a99c35 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/awb/view/text/makefile.mk @@ -0,0 +1,82 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJNAME = awb +PRJ = ..$/..$/..$/..$/..$/..$/.. +TARGET = awb_view_text +PACKAGE = org$/openoffice$/accessibility$/awb$/view$/text + +USE_JAVAVER:=TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +.IF "$(JAVAVER:s/.//)" >= "140" + +.INCLUDE : makefile.common + +JAVACLASSFILES= $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) + +.ENDIF + +# --- Targets ------------------------------------------------------ + + +.INCLUDE : target.mk + diff --git a/accessibility/workben/org/openoffice/accessibility/misc/AccessibleEventMulticaster.java b/accessibility/workben/org/openoffice/accessibility/misc/AccessibleEventMulticaster.java new file mode 100644 index 000000000000..f9212e05a35c --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/misc/AccessibleEventMulticaster.java @@ -0,0 +1,122 @@ +/************************************************************************* + * + * $RCSfile: AccessibleEventMulticaster.java,v $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +package org.openoffice.accessibility.misc; + +import com.sun.star.lang.EventObject; + +import com.sun.star.accessibility.AccessibleEventObject; +import com.sun.star.accessibility.XAccessibleEventBroadcaster; +import com.sun.star.accessibility.XAccessibleEventListener; + +/** + * + */ +public class AccessibleEventMulticaster implements XAccessibleEventListener { + + private final XAccessibleEventListener a; + private final XAccessibleEventListener b; + + /** Creates a new instance of AccessibleEventMulticaster */ + protected AccessibleEventMulticaster(XAccessibleEventListener a, + XAccessibleEventListener b) { + this.a = a; + this.b = b; + } + + protected XAccessibleEventListener remove(XAccessibleEventListener l) { + if (l == a) + return b; + if (l == b) + return a; + XAccessibleEventListener a2 = remove(a, l); + XAccessibleEventListener b2 = remove(b, l); + if (a2 == a && b2 == b) { + return this; // not found + } + return add(a2, b2); + } + + public void notifyEvent(AccessibleEventObject accessibleEventObject) { + a.notifyEvent(accessibleEventObject); + b.notifyEvent(accessibleEventObject); + } + + public void disposing(EventObject eventObject) { + a.disposing(eventObject); + b.disposing(eventObject); + } + + public static XAccessibleEventListener add(XAccessibleEventListener a, XAccessibleEventListener b) { + if (a == null) + return b; + if (b == null) + return a; + return new AccessibleEventMulticaster(a,b); + } + + public static XAccessibleEventListener remove(XAccessibleEventListener l, XAccessibleEventListener oldl) { + if (l == oldl || l == null) { + return null; + } else if (l instanceof AccessibleEventMulticaster) { + return ((AccessibleEventMulticaster) l).remove(oldl); + } else { + return l; + } + } + +} diff --git a/accessibility/workben/org/openoffice/accessibility/misc/Connector.java b/accessibility/workben/org/openoffice/accessibility/misc/Connector.java new file mode 100644 index 000000000000..de188676e224 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/misc/Connector.java @@ -0,0 +1,50 @@ +package org.openoffice.accessibility.misc; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.Timer; +import java.util.TimerTask; +import java.util.Vector; + + +/** Wait for an Office application and connect to it. +*/ +public class Connector + extends TimerTask +{ + final public static long snDelay = 3000; + + public Connector () + { + maTimer = new Timer (true); + maListeners = new Vector(); + run (); + } + + public void AddConnectionListener (ActionListener aListener) + { + SimpleOffice aOffice = SimpleOffice.Instance(); + if (aOffice!=null && aOffice.IsConnected()) + aListener.actionPerformed ( + new ActionEvent (aOffice,0,"")); + maListeners.add (aListener); + } + + public void run () + { + SimpleOffice aOffice = SimpleOffice.Instance(); + if (aOffice!=null && !aOffice.IsConnected()) + if ( ! aOffice.Connect()) + maTimer.schedule (this, snDelay); + else + { + ActionEvent aEvent = new ActionEvent (aOffice,0,""); + for (int i=0; i 0) + sIndent += " "; + + // Get XAccessibleContext object if given object does not + // already support this interface. + XAccessibleContext xContext + = (XAccessibleContext) UnoRuntime.queryInterface ( + XAccessibleContext.class, xObject); + if (xContext == null) + { + XAccessible xAccessible + = (XAccessible) UnoRuntime.queryInterface ( + XAccessible.class, xObject); + if (xAccessible == null) + { + maOut.println (sIndent + "given object " + xObject + + " is not accessible"); + return false; + } + else + xContext = xAccessible.getAccessibleContext(); + } + + // Print information about the accessible context. + if (xContext != null) + { + maOut.println (sIndent + "Name : " + + xContext.getAccessibleName()); + maOut.println (sIndent + "Description : " + + xContext.getAccessibleDescription()); + maOut.println (sIndent + "Role : " + + xContext.getAccessibleRole()); + String sHasParent; + if (xContext.getAccessibleParent() != null) + { + maOut.println (sIndent + "Has parent : yes"); + maOut.println (sIndent + "Parent index : " + + xContext.getAccessibleIndexInParent()); + } + else + maOut.println (sIndent + "Has parent : no"); + maOut.println (sIndent + "Child count : " + + xContext.getAccessibleChildCount()); + maOut.print (sIndent + "Relation set : "); + XAccessibleRelationSet xRelationSet + = xContext.getAccessibleRelationSet(); + if (xRelationSet != null) + { + maOut.print (xRelationSet.getRelationCount() + " ("); + for (int i=0; i 0) + maOut.print (", "); + maOut.print (xRelationSet.getRelation(i).toString()); + } + maOut.println (")"); + } + else + maOut.println ("no relation set"); + + maOut.print (sIndent + "State set : "); + XAccessibleStateSet xStateSet = + xContext.getAccessibleStateSet(); + if (xStateSet != null) + { + XIndexAccess xStates = + (XIndexAccess) UnoRuntime.queryInterface ( + XIndexAccess.class, xStateSet); + maOut.print (xStates.getCount() + " ("); + for (int i=0; i 0) + maOut.print (", "); + maOut.print (xStates.getByIndex(i).toString()); + } + maOut.println (")"); + } + else + maOut.println ("no state set"); + + showAccessibleComponent (xContext, sIndent); + } + else + maOut.println ("object has no accessible context."); + + // showInfo (xContext); + // showServices (xContext); + // showInterfaces (xContext); + } + catch (Exception e) + { + System.out.println ("caught exception in showAccessibility :" + e); + } + return true; + } + + + + + /** @descr Print information about the given accessible component. + */ + public void showAccessibleComponent (XInterface xObject, String sIndent) + { + try + { + XAccessibleComponent xComponent = + (XAccessibleComponent) UnoRuntime.queryInterface ( + XAccessibleComponent.class, xObject); + + // Print information about the accessible context. + if (xComponent != null) + { + maOut.println (sIndent + "Position : " + + xComponent.getLocation().X+", " + + xComponent.getLocation().Y); + maOut.println (sIndent + "Screen position : " + + xComponent.getLocationOnScreen().X+", " + + xComponent.getLocationOnScreen().Y); + maOut.println (sIndent + "Size : " + + xComponent.getSize().Width+", " + + xComponent.getSize().Height); + } + } + catch (Exception e) + { + System.out.println ( + "caught exception in showAccessibleComponent : " + e); + } + } + + + /** Show a textual representation of the accessibility subtree rooted in + xRoot. + */ + public boolean showAccessibilityTree (XAccessible xRoot, int depth) + { + try + { + if ( ! showAccessibility (xRoot, depth)) + return false; + + String sIndent = ""; + for (int i=0; i 0) + aMessage = " " + aMessage; + Instance().printMessage(aMessage); + } + + + + + /** Show the given string at the end of the message area and scroll to make + it visible. + */ + public static void println (String aMessage) + { + println (0, aMessage); + } + + + + + /** Show the given string at the end of the message area and scroll to make + it visible. + */ + public static void println (int nIndentation, String aMessage) + { + print (nIndentation, aMessage+"\n"); + } + + + + + public void paintComponent (Graphics g) + { + synchronized (g) + { + JScrollBar sb = getVerticalScrollBar(); + if (sb != null) + { + int nScrollBarValue = sb.getMaximum() - sb.getVisibleAmount() - 1; + sb.setValue (nScrollBarValue); + } + super.paintComponent (g); + } + } + + + + + /** Append the given string to the end of the text and scroll so that it + becomes visible. This is an internal method. Use one of the static + and public ones. + */ + private synchronized void printMessage (String aMessage) + { + maText.append (aMessage); + } + + + + + private static MessageArea saInstance = null; + private JTextArea maText; +} diff --git a/accessibility/workben/org/openoffice/accessibility/misc/NameProvider.java b/accessibility/workben/org/openoffice/accessibility/misc/NameProvider.java new file mode 100644 index 000000000000..736bc2c7f17b --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/misc/NameProvider.java @@ -0,0 +1,263 @@ +package org.openoffice.accessibility.misc; + +import java.util.HashMap; +import com.sun.star.accessibility.AccessibleStateType; +import com.sun.star.accessibility.AccessibleEventId; +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.AccessibleRelationType; + + +/** Provide names for several accessibility constants groups. +*/ +public class NameProvider +{ + /** Return the name of the specified state. + @param nStateId + Id of the state for which to return its name. This is one of + the ids listed in the AccessibleStateType + constants group. + @return + Returns the name of the specified state. When an invalid or + unknown state id is given then a special string is returned that + says that the state does not exist. + */ + public static String getStateName (int nStateId) + { + String sStateName = (String)maStateMap.get (new Integer(nStateId)); + if (sStateName == null) + sStateName = new String (""); + return sStateName; + } + + + /** Return the name of the specified event. + @param nEventId + Id of the event type for which to return its name. This is one + of the ids listed in the AccessibleEventId + constants group. + @return + Returns the name of the specified event type or an empty string + if an invalid / unknown event id was given. + */ + public static String getEventName (int nEventId) + { + return (String)maEventMap.get (new Integer(nEventId)); + } + + + /** Return the name of the specified role. + @param nRole + Id of the role for which to return its name. This is one of + the ids listed in the AccessibleRole + constants group. + @return + Returns the name of the specified role or an empty string if an + invalid / unknown role id was given. + */ + public static String getRoleName (int nRole) + { + return (String)maRoleMap.get (new Integer(nRole)); + } + + + /** Return the name of the specified relation. + @param nRelation + Id of the relation for which to return its name. This is one of + the ids listed in the AccessibleRelationType + constants group. + @return + Returns the name of the specified relation type or an empty + string if an invalid / unknown role id was given. + */ + public static String getRelationName (int nRelation) + { + return (String)maRelationMap.get (new Integer(nRelation)); + } + + + private static HashMap maStateMap = new HashMap(); + private static HashMap maEventMap = new HashMap(); + private static HashMap maRoleMap = new HashMap(); + private static HashMap maRelationMap = new HashMap(); + + static { + maStateMap.put (new Integer (AccessibleStateType.INVALID), "INVALID"); + maStateMap.put (new Integer (AccessibleStateType.ACTIVE), "ACTIVE"); + maStateMap.put (new Integer (AccessibleStateType.ARMED), "ARMED"); + maStateMap.put (new Integer (AccessibleStateType.BUSY), "BUSY"); + maStateMap.put (new Integer (AccessibleStateType.CHECKED), "CHECKED"); + // maStateMap.put (new Integer (AccessibleStateType.COLLAPSED), "COLLAPSED"); + maStateMap.put (new Integer (AccessibleStateType.DEFUNC), "DEFUNC"); + maStateMap.put (new Integer (AccessibleStateType.EDITABLE), "EDITABLE"); + maStateMap.put (new Integer (AccessibleStateType.ENABLED), "ENABLED"); + maStateMap.put (new Integer (AccessibleStateType.EXPANDABLE), "EXPANDABLE"); + maStateMap.put (new Integer (AccessibleStateType.EXPANDED), "EXPANDED"); + maStateMap.put (new Integer (AccessibleStateType.FOCUSABLE), "FOCUSABLE"); + maStateMap.put (new Integer (AccessibleStateType.FOCUSED), "FOCUSED"); + maStateMap.put (new Integer (AccessibleStateType.HORIZONTAL), "HORIZONTAL"); + maStateMap.put (new Integer (AccessibleStateType.ICONIFIED), "ICONIFIED"); + maStateMap.put (new Integer (AccessibleStateType.MODAL), "MODAL"); + maStateMap.put (new Integer (AccessibleStateType.MULTI_LINE), "MULTI_LINE"); + maStateMap.put (new Integer (AccessibleStateType.MULTI_SELECTABLE), "MULTI_SELECTABLE"); + maStateMap.put (new Integer (AccessibleStateType.OPAQUE), "OPAQUE"); + maStateMap.put (new Integer (AccessibleStateType.PRESSED), "PRESSED"); + maStateMap.put (new Integer (AccessibleStateType.RESIZABLE), "RESIZABLE"); + maStateMap.put (new Integer (AccessibleStateType.SELECTABLE), "SELECTABLE"); + maStateMap.put (new Integer (AccessibleStateType.SELECTED), "SELECTED"); + maStateMap.put (new Integer (AccessibleStateType.SENSITIVE), "SENSITIVE"); + maStateMap.put (new Integer (AccessibleStateType.SHOWING), "SHOWING"); + maStateMap.put (new Integer (AccessibleStateType.SINGLE_LINE), "SINGLE_LINE"); + maStateMap.put (new Integer (AccessibleStateType.STALE), "STALE"); + maStateMap.put (new Integer (AccessibleStateType.TRANSIENT), "TRANSIENT"); + maStateMap.put (new Integer (AccessibleStateType.VERTICAL), "VERTICAL"); + maStateMap.put (new Integer (AccessibleStateType.VISIBLE), "VISIBLE"); + maStateMap.put (new Integer (AccessibleStateType.MANAGES_DESCENDANTS), + "MANAGES_DESCENDANTS"); + //maStateMap.put (new Integer (AccessibleStateType.INCONSISTENT),"INCONSISTENT"); + + + maEventMap.put (new Integer (0), + "[UNKNOWN]"); + maEventMap.put (new Integer (AccessibleEventId.NAME_CHANGED), + "NAME_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.DESCRIPTION_CHANGED), + "DESCRIPTION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.ACTION_CHANGED), + "ACTION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.STATE_CHANGED), + "STATE_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.ACTIVE_DESCENDANT_CHANGED), + "ACTIVE_DESCENDANT_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.BOUNDRECT_CHANGED), + "BOUNDRECT_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.CHILD), + "CHILD"); + maEventMap.put (new Integer (AccessibleEventId.INVALIDATE_ALL_CHILDREN), + "INVALIDATE_ALL_CHILDREN"); + maEventMap.put (new Integer (AccessibleEventId.SELECTION_CHANGED), + "SELECTION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.VISIBLE_DATA_CHANGED), + "VISIBLE_DATA_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.VALUE_CHANGED), + "VALUE_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.CONTENT_FLOWS_FROM_RELATION_CHANGED), + "CONTENT_FLOWS_FROM_RELATION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.CONTENT_FLOWS_TO_RELATION_CHANGED), + "CONTENT_FLOWS_TO_RELATION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.CONTROLLED_BY_RELATION_CHANGED), + "CONTROLLED_BY_RELATION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.CONTROLLER_FOR_RELATION_CHANGED), + "CONTROLLER_FOR_RELATION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.LABEL_FOR_RELATION_CHANGED), + "LABEL_FOR_RELATION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.LABELED_BY_RELATION_CHANGED), + "LABELED_BY_RELATION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.MEMBER_OF_RELATION_CHANGED), + "MEMBER_OF_RELATION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.SUB_WINDOW_OF_RELATION_CHANGED), + "SUB_WINDOW_OF_RELATION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.CARET_CHANGED), + "CARET_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.TEXT_SELECTION_CHANGED), + "TEXT_SELECTION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.TEXT_CHANGED), + "TEXT_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.TEXT_ATTRIBUTE_CHANGED), + "TEXT_ATTRIBUTE_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.HYPERTEXT_CHANGED), + "HYPERTEXT_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.TABLE_CAPTION_CHANGED), + "TABLE_CAPTION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.TABLE_COLUMN_DESCRIPTION_CHANGED), + "TABLE_COLUMN_DESCRIPTION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.TABLE_COLUMN_HEADER_CHANGED), + "TABLE_COLUMN_HEADER_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.TABLE_MODEL_CHANGED), + "TABLE_MODEL_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.TABLE_ROW_DESCRIPTION_CHANGED), + "TABLE_ROW_DESCRIPTION_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.TABLE_ROW_HEADER_CHANGED), + "TABLE_ROW_HEADER_CHANGED"); + maEventMap.put (new Integer (AccessibleEventId.TABLE_SUMMARY_CHANGED), + "TABLE_SUMMARY_CHANGED"); + + maRoleMap.put (new Integer(AccessibleRole.UNKNOWN), "UNKNOWN"); + maRoleMap.put (new Integer (AccessibleRole.UNKNOWN), "UNKNOWN"); + maRoleMap.put (new Integer (AccessibleRole.ALERT), "ALERT"); + maRoleMap.put (new Integer (AccessibleRole.COLUMN_HEADER), "COLUMN_HEADER"); + maRoleMap.put (new Integer (AccessibleRole.CANVAS), "CANVAS"); + maRoleMap.put (new Integer (AccessibleRole.CHECK_BOX), "CHECK_BOX"); + maRoleMap.put (new Integer (AccessibleRole.CHECK_MENU_ITEM), "CHECK_MENU_ITEM"); + maRoleMap.put (new Integer (AccessibleRole.COLOR_CHOOSER), "COLOR_CHOOSER"); + maRoleMap.put (new Integer (AccessibleRole.COMBO_BOX), "COMBO_BOX"); + maRoleMap.put (new Integer (AccessibleRole.DESKTOP_ICON), "DESKTOP_ICON"); + maRoleMap.put (new Integer (AccessibleRole.DESKTOP_PANE), "DESKTOP_PANE"); + maRoleMap.put (new Integer (AccessibleRole.DIRECTORY_PANE), "DIRECTORY_PANE"); + maRoleMap.put (new Integer (AccessibleRole.DIALOG), "DIALOG"); + maRoleMap.put (new Integer (AccessibleRole.DOCUMENT), "DOCUMENT"); + maRoleMap.put (new Integer (AccessibleRole.EMBEDDED_OBJECT), "EMBEDDED_OBJECT"); + maRoleMap.put (new Integer (AccessibleRole.END_NOTE), "END_NOTE"); + maRoleMap.put (new Integer (AccessibleRole.FILE_CHOOSER), "FILE_CHOOSER"); + maRoleMap.put (new Integer (AccessibleRole.FILLER), "FILLER"); + maRoleMap.put (new Integer (AccessibleRole.FONT_CHOOSER), "FONT_CHOOSER"); + maRoleMap.put (new Integer (AccessibleRole.FOOTER), "FOOTER"); + maRoleMap.put (new Integer (AccessibleRole.FOOTNOTE), "FOOTNOTE"); + maRoleMap.put (new Integer (AccessibleRole.FRAME), "FRAME"); + maRoleMap.put (new Integer (AccessibleRole.GLASS_PANE), "GLASS_PANE"); + maRoleMap.put (new Integer (AccessibleRole.GRAPHIC), "GRAPHIC"); + maRoleMap.put (new Integer (AccessibleRole.GROUP_BOX), "GROUP_BOX"); + maRoleMap.put (new Integer (AccessibleRole.HEADER), "HEADER"); + maRoleMap.put (new Integer (AccessibleRole.HEADING), "HEADING"); + maRoleMap.put (new Integer (AccessibleRole.HYPER_LINK), "HYPER_LINK"); + maRoleMap.put (new Integer (AccessibleRole.ICON), "ICON"); + maRoleMap.put (new Integer (AccessibleRole.INTERNAL_FRAME), "INTERNAL_FRAME"); + maRoleMap.put (new Integer (AccessibleRole.LABEL), "LABEL"); + maRoleMap.put (new Integer (AccessibleRole.LAYERED_PANE), "LAYERED_PANE"); + maRoleMap.put (new Integer (AccessibleRole.LIST), "LIST"); + maRoleMap.put (new Integer (AccessibleRole.LIST_ITEM), "LIST_ITEM"); + maRoleMap.put (new Integer (AccessibleRole.MENU), "MENU"); + maRoleMap.put (new Integer (AccessibleRole.MENU_BAR), "MENU_BAR"); + maRoleMap.put (new Integer (AccessibleRole.MENU_ITEM), "MENU_ITEM"); + maRoleMap.put (new Integer (AccessibleRole.OPTION_PANE), "OPTION_PANE"); + maRoleMap.put (new Integer (AccessibleRole.PAGE_TAB), "PAGE_TAB"); + maRoleMap.put (new Integer (AccessibleRole.PAGE_TAB_LIST), "PAGE_TAB_LIST"); + maRoleMap.put (new Integer (AccessibleRole.PANEL), "PANEL"); + maRoleMap.put (new Integer (AccessibleRole.PARAGRAPH), "PARAGRAPH"); + maRoleMap.put (new Integer (AccessibleRole.PASSWORD_TEXT), "PASSWORD_TEXT"); + maRoleMap.put (new Integer (AccessibleRole.POPUP_MENU), "POPUP_MENU"); + maRoleMap.put (new Integer (AccessibleRole.PUSH_BUTTON), "PUSH_BUTTON"); + maRoleMap.put (new Integer (AccessibleRole.PROGRESS_BAR), "PROGRESS_BAR"); + maRoleMap.put (new Integer (AccessibleRole.RADIO_BUTTON), "RADIO_BUTTON"); + maRoleMap.put (new Integer (AccessibleRole.RADIO_MENU_ITEM), "RADIO_MENU_ITEM"); + maRoleMap.put (new Integer (AccessibleRole.ROW_HEADER), "ROW_HEADER"); + maRoleMap.put (new Integer (AccessibleRole.ROOT_PANE), "ROOT_PANE"); + maRoleMap.put (new Integer (AccessibleRole.SCROLL_BAR), "SCROLL_BAR"); + maRoleMap.put (new Integer (AccessibleRole.SCROLL_PANE), "SCROLL_PANE"); + maRoleMap.put (new Integer (AccessibleRole.SHAPE), "SHAPE"); + maRoleMap.put (new Integer (AccessibleRole.SEPARATOR), "SEPARATOR"); + maRoleMap.put (new Integer (AccessibleRole.SLIDER), "SLIDER"); + maRoleMap.put (new Integer (AccessibleRole.SPIN_BOX), "SPIN_BOX"); + maRoleMap.put (new Integer (AccessibleRole.SPLIT_PANE), "SPLIT_PANE"); + maRoleMap.put (new Integer (AccessibleRole.STATUS_BAR), "STATUS_BAR"); + maRoleMap.put (new Integer (AccessibleRole.TABLE), "TABLE"); + maRoleMap.put (new Integer (AccessibleRole.TABLE_CELL), "TABLE_CELL"); + maRoleMap.put (new Integer (AccessibleRole.TEXT), "TEXT"); + maRoleMap.put (new Integer (AccessibleRole.TEXT_FRAME), "TEXT_FRAME"); + maRoleMap.put (new Integer (AccessibleRole.TOGGLE_BUTTON), "TOGGLE_BUTTON"); + maRoleMap.put (new Integer (AccessibleRole.TOOL_BAR), "TOOL_BAR"); + maRoleMap.put (new Integer (AccessibleRole.TOOL_TIP), "TOOL_TIP"); + maRoleMap.put (new Integer (AccessibleRole.TREE), "TREE"); + maRoleMap.put (new Integer (AccessibleRole.VIEW_PORT), "VIEW_PORT"); + maRoleMap.put (new Integer (AccessibleRole.WINDOW), "WINDOW"); + + maRelationMap.put (new Integer (AccessibleRelationType.INVALID), "INVALID"); + maRelationMap.put (new Integer (AccessibleRelationType.CONTENT_FLOWS_FROM), "CONTENT_FLOWS_FROM"); + maRelationMap.put (new Integer (AccessibleRelationType.CONTENT_FLOWS_TO), "CONTENT_FLOWS_TO"); + maRelationMap.put (new Integer (AccessibleRelationType.CONTROLLED_BY), "CONTROLLED_BY"); + maRelationMap.put (new Integer (AccessibleRelationType.CONTROLLER_FOR), "CONTROLLER_FOR"); + maRelationMap.put (new Integer (AccessibleRelationType.LABEL_FOR), "LABEL_FOR"); + maRelationMap.put (new Integer (AccessibleRelationType.LABELED_BY), "LABELED_BY"); + maRelationMap.put (new Integer (AccessibleRelationType.MEMBER_OF), "MEMBER_OF"); + maRelationMap.put (new Integer (AccessibleRelationType.SUB_WINDOW_OF), "SUB_WINDOW_OF"); + } +} diff --git a/accessibility/workben/org/openoffice/accessibility/misc/OfficeConnection.java b/accessibility/workben/org/openoffice/accessibility/misc/OfficeConnection.java new file mode 100644 index 000000000000..d9f77d9e4e07 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/misc/OfficeConnection.java @@ -0,0 +1,169 @@ +package org.openoffice.accessibility.misc; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.PrintStream; +import java.util.Timer; +import java.util.TimerTask; +import java.util.Vector; + +import com.sun.star.uno.UnoRuntime; +import com.sun.star.bridge.XUnoUrlResolver; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.comp.helper.Bootstrap; + +/** This class establishes a connection to a StarOffice application. + */ +public class OfficeConnection + extends TimerTask +{ + final public static long snDelay = 3000; + + public static synchronized OfficeConnection Instance () + { + if (saInstance == null) + saInstance = new OfficeConnection (); + return saInstance; + } + + + + + static public void SetPipeName (String sPipeName) + { + ssDefaultPipeName = sPipeName; + } + + + + + public void AddConnectionListener (ActionListener aListener) + { + SimpleOffice aOffice = SimpleOffice.Instance(); + if (IsValid()) + aListener.actionPerformed ( + new ActionEvent (aOffice,0,"")); + maListeners.add (aListener); + } + + + + /** @descr Return the service manager that represents the connected + StarOffice application + */ + public XMultiServiceFactory GetServiceManager () + { + return maServiceManager; + } + + + + + /** Return a flag that indicates if the constructor has been able to + establish a valid connection. + */ + public boolean IsValid () + { + return (maServiceManager != null); + } + + + + + /** Connect to a already running StarOffice application that has + been started with a command line argument like + "-accept=pipe,name=;urp;" + */ + private boolean Connect () + { + mbInitialized = true; + // Set up connection string. + String sConnectString = "uno:pipe,name=" + msPipeName + + ";urp;StarOffice.ServiceManager"; + + // connect to a running office and get the ServiceManager + try + { + // Create a URL Resolver. + XMultiServiceFactory aLocalServiceManager = + Bootstrap.createSimpleServiceManager(); + XUnoUrlResolver aURLResolver = + (XUnoUrlResolver) UnoRuntime.queryInterface ( + XUnoUrlResolver.class, + aLocalServiceManager.createInstance ( + "com.sun.star.bridge.UnoUrlResolver") + ); + + maServiceManager = + (XMultiServiceFactory) UnoRuntime.queryInterface ( + XMultiServiceFactory.class, + aURLResolver.resolve (sConnectString) + ); + } + + catch (Exception e) + { + if (maOut != null) + { + maOut.println ("Could not connect with " + + sConnectString + " : " + e); + maOut.println ("Please start OpenOffice/StarOffice with " + + "\"-accept=pipe,name=" + msPipeName + ";urp;\""); + } + } + + return maServiceManager != null; + } + + + public void run () + { + if ( ! IsValid()) + { + MessageArea.println ("trying to connect"); + if (Connect()) + { + // Stop the timer. + cancel (); + + ActionEvent aEvent = new ActionEvent (this,0,""); + for (int i=0; i 0) + { + // All shapes return as accessible object the document window's + // accessible object. This is, of course, a hack and will be + // removed as soon as the missing infrastructure for obtaining + // the object directly is implemented. + XShape xShape = null; + try{ + xShape = (XShape) UnoRuntime.queryInterface( + XShape.class, xShapeList.getByIndex (0)); + } catch (Exception e) + {} + XAccessible xAccessible = (XAccessible) UnoRuntime.queryInterface ( + XAccessible.class, xShape); + return xAccessible; + } + else + return null; + } + + private SimpleOffice () + { + } + + + + private XDesktop mxDesktop; + private static SimpleOffice saInstance = null; +} diff --git a/accessibility/workben/org/openoffice/accessibility/misc/makefile.common b/accessibility/workben/org/openoffice/accessibility/misc/makefile.common new file mode 100644 index 000000000000..d06336e12c56 --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/misc/makefile.common @@ -0,0 +1,67 @@ +#************************************************************************* +# +# $RCSfile: makefile.common,v $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +JARFILES = sandbox.jar jurt.jar unoil.jar ridl.jar juh.jar java_uno.jar +JAVAFILES = \ + AccessibleEventMulticaster.java \ + InformationWriter.java \ + MessageArea.java \ + NameProvider.java \ + OfficeConnection.java \ + Options.java \ + SimpleOffice.java diff --git a/accessibility/workben/org/openoffice/accessibility/misc/makefile.mk b/accessibility/workben/org/openoffice/accessibility/misc/makefile.mk new file mode 100644 index 000000000000..f0b71f860c3e --- /dev/null +++ b/accessibility/workben/org/openoffice/accessibility/misc/makefile.mk @@ -0,0 +1,86 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJNAME = awb +PRJ = ..$/..$/..$/..$/.. +TARGET = java_misc +PACKAGE = org$/openoffice$/accessibility$/misc + +USE_JAVAVER:=TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +.IF "$(JAVAVER:s/.//)" >= "140" + +.INCLUDE : makefile.common + +JAVACLASSFILES= $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) + +#JARTARGET = $(TARGET).jar +#JARCOMPRESS = TRUE +#JARCLASSDIRS = $(PACKAGE) org/openoffice/java/accessibility/awb +#CUSTOMMANIFESTFILE = manifest +.ENDIF + +# --- Targets ------------------------------------------------------ + + +.INCLUDE : target.mk + diff --git a/automation/source/communi/communi.cxx b/automation/source/communi/communi.cxx index 55b72e1031e2..6f79551ecd72 100644 --- a/automation/source/communi/communi.cxx +++ b/automation/source/communi/communi.cxx @@ -260,7 +260,7 @@ long CommunicationLinkViaSocket::DataReceived( void* EMPTYARG ) IMPL_LINK( CommunicationLinkViaSocket, PutDataReceivedHdl, CommunicationLinkViaSocket*, EMPTYARG ) { - nDataReceivedEventId = GetpApp()->PostUserEvent( LINK( this, CommunicationLinkViaSocket, DataReceived ) ); + nDataReceivedEventId = GetpApp()->PostUserEvent( LINK( this, CommunicationLink, DataReceived ) ); return 0; } diff --git a/automation/source/server/server.cxx b/automation/source/server/server.cxx index 5d84cb6cd75d..988f4055a2eb 100644 --- a/automation/source/server/server.cxx +++ b/automation/source/server/server.cxx @@ -805,7 +805,7 @@ BOOL ImplRemoteControl::QueCommands( ULONG nServiceId, SvStream *pIn ) break; } default: - DBG_ERROR1( "Unbekannter Request Nr:%il", nId ); + DBG_ERROR1( "Unbekannter Request Nr:%i", nId ); break; } if( !pIn->IsEof() ) diff --git a/automation/source/testtool/tcommuni.cxx b/automation/source/testtool/tcommuni.cxx index f341bd3efe36..3ac135829f6d 100644 --- a/automation/source/testtool/tcommuni.cxx +++ b/automation/source/testtool/tcommuni.cxx @@ -36,7 +36,6 @@ #include #include #include -#include #include #ifndef _BASIC_TTRESHLP_HXX diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index 7b36f27626c4..f86b284b72fd 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -223,9 +223,6 @@ namespace dbp // the bound field getContext().xObjectModel->setPropertyValue(::rtl::OUString::createFromAscii("DataField"), makeAny(::rtl::OUString(getSettings().sLinkedFormField))); - - // by default, create a drop down control - getContext().xObjectModel->setPropertyValue(::rtl::OUString::createFromAscii("Dropdown"), ::cppu::bool2any(sal_True)); } catch(Exception&) { diff --git a/extensions/source/propctrlr/eformspropertyhandler.cxx b/extensions/source/propctrlr/eformspropertyhandler.cxx index d0ac0de3857a..b200d37cb83b 100644 --- a/extensions/source/propctrlr/eformspropertyhandler.cxx +++ b/extensions/source/propctrlr/eformspropertyhandler.cxx @@ -411,6 +411,18 @@ namespace pcr return Sequence< ::rtl::OUString >( &(*aInterestedInActuations.begin()), aInterestedInActuations.size() ); } + //-------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL EFormsPropertyHandler::getSupersededProperties( ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + if ( !m_pHelper.get() ) + return Sequence< ::rtl::OUString >(); + + Sequence< ::rtl::OUString > aReturn( 1 ); + aReturn[ 0 ] = PROPERTY_INPUT_REQUIRED; + return aReturn; + } + //-------------------------------------------------------------------- LineDescriptor SAL_CALL EFormsPropertyHandler::describePropertyLine( const ::rtl::OUString& _rPropertyName, const Reference< XPropertyControlFactory >& _rxControlFactory ) diff --git a/extensions/source/propctrlr/eformspropertyhandler.hxx b/extensions/source/propctrlr/eformspropertyhandler.hxx index 700cf43431cf..55c464d77076 100644 --- a/extensions/source/propctrlr/eformspropertyhandler.hxx +++ b/extensions/source/propctrlr/eformspropertyhandler.hxx @@ -77,6 +77,8 @@ namespace pcr virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getActuatingProperties( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > + SAL_CALL getSupersededProperties( ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::inspection::LineDescriptor SAL_CALL describePropertyLine( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::inspection::InteractiveSelectionResult diff --git a/extensions/util/hidother.src b/extensions/util/hidother.src index 49b67060f8a3..3f8fcd5ed7f8 100644 --- a/extensions/util/hidother.src +++ b/extensions/util/hidother.src @@ -30,208 +30,92 @@ #include "../inc/extensio.hrc" -hidspecial HID_BIB_CHANGESOURCE { HelpId = HID_BIB_CHANGESOURCE; } -hidspecial HID_BIB_MAPPINGDLG { HelpId = HID_BIB_MAPPINGDLG; } -hidspecial HID_BIB_TBX_TABLE { HelpId = HID_BIB_TBX_TABLE; } -hidspecial HID_BIB_TBX_SEARCH { HelpId = HID_BIB_TBX_SEARCH; } -hidspecial HID_BIB_TBX_AUTOFILTER { HelpId = HID_BIB_TBX_AUTOFILTER; } +hidspecial HID_ABSPILOT { HelpId = HID_ABSPILOT; } +hidspecial HID_ABSPILOT_CANCEL { HelpId = HID_ABSPILOT_CANCEL; } +hidspecial HID_ABSPILOT_FINISH { HelpId = HID_ABSPILOT_FINISH; } +hidspecial HID_ABSPILOT_NEXT { HelpId = HID_ABSPILOT_NEXT; } +hidspecial HID_ABSPILOT_PREVIOUS { HelpId = HID_ABSPILOT_PREVIOUS; } -hidspecial HID_BIB_IDENTIFIER_POS { HelpId = HID_BIB_IDENTIFIER_POS; } +hidspecial HID_BIB_ADDRESS_POS { HelpId = HID_BIB_ADDRESS_POS; } +hidspecial HID_BIB_ANNOTE_POS { HelpId = HID_BIB_ANNOTE_POS; } hidspecial HID_BIB_AUTHORITYTYPE_POS { HelpId = HID_BIB_AUTHORITYTYPE_POS; } hidspecial HID_BIB_AUTHOR_POS { HelpId = HID_BIB_AUTHOR_POS; } -hidspecial HID_BIB_TITLE_POS { HelpId = HID_BIB_TITLE_POS; } -hidspecial HID_BIB_YEAR_POS { HelpId = HID_BIB_YEAR_POS; } -hidspecial HID_BIB_ISBN_POS { HelpId = HID_BIB_ISBN_POS; } hidspecial HID_BIB_BOOKTITLE_POS { HelpId = HID_BIB_BOOKTITLE_POS; } +hidspecial HID_BIB_CHANGESOURCE { HelpId = HID_BIB_CHANGESOURCE; } hidspecial HID_BIB_CHAPTER_POS { HelpId = HID_BIB_CHAPTER_POS; } -hidspecial HID_BIB_EDITION_POS { HelpId = HID_BIB_EDITION_POS; } -hidspecial HID_BIB_EDITOR_POS { HelpId = HID_BIB_EDITOR_POS; } -hidspecial HID_BIB_HOWPUBLISHED_POS { HelpId = HID_BIB_HOWPUBLISHED_POS; } -hidspecial HID_BIB_INSTITUTION_POS { HelpId = HID_BIB_INSTITUTION_POS; } -hidspecial HID_BIB_JOURNAL_POS { HelpId = HID_BIB_JOURNAL_POS; } -hidspecial HID_BIB_MONTH_POS { HelpId = HID_BIB_MONTH_POS; } -hidspecial HID_BIB_NOTE_POS { HelpId = HID_BIB_NOTE_POS; } -hidspecial HID_BIB_ANNOTE_POS { HelpId = HID_BIB_ANNOTE_POS; } -hidspecial HID_BIB_NUMBER_POS { HelpId = HID_BIB_NUMBER_POS; } -hidspecial HID_BIB_ORGANIZATIONS_POS { HelpId = HID_BIB_ORGANIZATIONS_POS; } -hidspecial HID_BIB_PAGES_POS { HelpId = HID_BIB_PAGES_POS; } -hidspecial HID_BIB_PUBLISHER_POS { HelpId = HID_BIB_PUBLISHER_POS; } -hidspecial HID_BIB_ADDRESS_POS { HelpId = HID_BIB_ADDRESS_POS; } -hidspecial HID_BIB_SCHOOL_POS { HelpId = HID_BIB_SCHOOL_POS; } -hidspecial HID_BIB_SERIES_POS { HelpId = HID_BIB_SERIES_POS; } -hidspecial HID_BIB_REPORTTYPE_POS { HelpId = HID_BIB_REPORTTYPE_POS; } -hidspecial HID_BIB_VOLUME_POS { HelpId = HID_BIB_VOLUME_POS; } -hidspecial HID_BIB_URL_POS { HelpId = HID_BIB_URL_POS; } +hidspecial HID_BIB_CONTROL_PAGE { HelpId = HID_BIB_CONTROL_PAGE; } +hidspecial HID_BIB_CONTROL_PARENT { HelpId = HID_BIB_CONTROL_PARENT; } hidspecial HID_BIB_CUSTOM1_POS { HelpId = HID_BIB_CUSTOM1_POS; } hidspecial HID_BIB_CUSTOM2_POS { HelpId = HID_BIB_CUSTOM2_POS; } hidspecial HID_BIB_CUSTOM3_POS { HelpId = HID_BIB_CUSTOM3_POS; } hidspecial HID_BIB_CUSTOM4_POS { HelpId = HID_BIB_CUSTOM4_POS; } hidspecial HID_BIB_CUSTOM5_POS { HelpId = HID_BIB_CUSTOM5_POS; } - -hidspecial HID_BIB_DB_TBX { HelpId = HID_BIB_DB_TBX; } hidspecial HID_BIB_DB_GRIDCTRL { HelpId = HID_BIB_DB_GRIDCTRL; } -hidspecial HID_BIB_CONTROL_PAGE { HelpId = HID_BIB_CONTROL_PAGE; } -hidspecial HID_BIB_CONTROL_PARENT { HelpId = HID_BIB_CONTROL_PARENT; } - -hidspecial HID_GRIDWIZARD_PREVIOUS { HelpId = HID_GRIDWIZARD_PREVIOUS; }; -hidspecial HID_GRIDWIZARD_NEXT { HelpId = HID_GRIDWIZARD_NEXT; } -hidspecial HID_GRIDWIZARD_CANCEL { HelpId = HID_GRIDWIZARD_CANCEL; } -hidspecial HID_GRIDWIZARD_FINISH { HelpId = HID_GRIDWIZARD_FINISH; } -hidspecial HID_GROUPWIZARD_PREVIOUS { HelpId = HID_GROUPWIZARD_PREVIOUS; } -hidspecial HID_GROUPWIZARD_NEXT { HelpId = HID_GROUPWIZARD_NEXT; } -hidspecial HID_GROUPWIZARD_CANCEL { HelpId = HID_GROUPWIZARD_CANCEL; } -hidspecial HID_GROUPWIZARD_FINISH { HelpId = HID_GROUPWIZARD_FINISH; } -hidspecial HID_LISTWIZARD_PREVIOUS { HelpId = HID_LISTWIZARD_PREVIOUS; } -hidspecial HID_LISTWIZARD_NEXT { HelpId = HID_LISTWIZARD_NEXT; } -hidspecial HID_LISTWIZARD_CANCEL { HelpId = HID_LISTWIZARD_CANCEL; } -hidspecial HID_LISTWIZARD_FINISH { HelpId = HID_LISTWIZARD_FINISH; } -hidspecial HID_DBIWIZARD_PREVIOUS { HelpId = HID_DBIWIZARD_PREVIOUS; } -hidspecial HID_DBIWIZARD_NEXT { HelpId = HID_DBIWIZARD_NEXT; } -hidspecial HID_DBIWIZARD_CANCEL { HelpId = HID_DBIWIZARD_CANCEL; } -hidspecial HID_DBIWIZARD_FINISH { HelpId = HID_DBIWIZARD_FINISH; } -hidspecial UID_DBIWIZARD_SOURCESTATS { HelpId = UID_DBIWIZARD_SOURCESTATS; } -hidspecial UID_DBIWIZARD_SOURCEFILE { HelpId = UID_DBIWIZARD_SOURCEFILE; } -hidspecial UID_DBIWIZARD_QUERIES { HelpId = UID_DBIWIZARD_QUERIES; } -hidspecial UID_DBIWIZARD_FORMS { HelpId = UID_DBIWIZARD_FORMS; } -hidspecial UID_DBIWIZARD_FORMS_SAVETO { HelpId = UID_DBIWIZARD_FORMS_SAVETO; } -hidspecial UID_BIB_FRAME_WINDOW { HelpId = UID_BIB_FRAME_WINDOW;} - -hidspecial HID_ABSPILOT_PREVIOUS { HelpId = HID_ABSPILOT_PREVIOUS; } -hidspecial HID_ABSPILOT_NEXT { HelpId = HID_ABSPILOT_NEXT; } -hidspecial HID_ABSPILOT_CANCEL { HelpId = HID_ABSPILOT_CANCEL; } -hidspecial HID_ABSPILOT_FINISH { HelpId = HID_ABSPILOT_FINISH; } -hidspecial HID_ABSPILOT { HelpId = HID_ABSPILOT; } - -hidspecial UID_ABSPILOT_HELP { HelpId = UID_ABSPILOT_HELP; } -hidspecial HID_DBIWIZARD { HelpId = HID_DBIWIZARD; } -hidspecial UID_DBIWIZARD_HELP { HelpId = UID_DBIWIZARD_HELP; } -hidspecial HID_DBIWIZARD_FILESELECTION { HelpId = HID_DBIWIZARD_FILESELECTION; } - +hidspecial HID_BIB_DB_TBX { HelpId = HID_BIB_DB_TBX; } hidspecial HID_BIB_DELETE_RECORD { HelpId = HID_BIB_DELETE_RECORD; } +hidspecial HID_BIB_EDITION_POS { HelpId = HID_BIB_EDITION_POS; } +hidspecial HID_BIB_EDITOR_POS { HelpId = HID_BIB_EDITOR_POS; } +hidspecial HID_BIB_HOWPUBLISHED_POS { HelpId = HID_BIB_HOWPUBLISHED_POS; } +hidspecial HID_BIB_IDENTIFIER_POS { HelpId = HID_BIB_IDENTIFIER_POS; } hidspecial HID_BIB_INSERT_RECORD { HelpId = HID_BIB_INSERT_RECORD; } +hidspecial HID_BIB_INSTITUTION_POS { HelpId = HID_BIB_INSTITUTION_POS; } +hidspecial HID_BIB_ISBN_POS { HelpId = HID_BIB_ISBN_POS; } +hidspecial HID_BIB_JOURNAL_POS { HelpId = HID_BIB_JOURNAL_POS; } +hidspecial HID_BIB_MAPPINGDLG { HelpId = HID_BIB_MAPPINGDLG; } +hidspecial HID_BIB_MONTH_POS { HelpId = HID_BIB_MONTH_POS; } +hidspecial HID_BIB_NOTE_POS { HelpId = HID_BIB_NOTE_POS; } +hidspecial HID_BIB_NUMBER_POS { HelpId = HID_BIB_NUMBER_POS; } +hidspecial HID_BIB_ORGANIZATIONS_POS { HelpId = HID_BIB_ORGANIZATIONS_POS; } +hidspecial HID_BIB_PAGES_POS { HelpId = HID_BIB_PAGES_POS; } +hidspecial HID_BIB_PUBLISHER_POS { HelpId = HID_BIB_PUBLISHER_POS; } +hidspecial HID_BIB_REPORTTYPE_POS { HelpId = HID_BIB_REPORTTYPE_POS; } +hidspecial HID_BIB_SCHOOL_POS { HelpId = HID_BIB_SCHOOL_POS; } +hidspecial HID_BIB_SERIES_POS { HelpId = HID_BIB_SERIES_POS; } +hidspecial HID_BIB_TBX_AUTOFILTER { HelpId = HID_BIB_TBX_AUTOFILTER; } +hidspecial HID_BIB_TBX_SEARCH { HelpId = HID_BIB_TBX_SEARCH; } +hidspecial HID_BIB_TBX_TABLE { HelpId = HID_BIB_TBX_TABLE; } +hidspecial HID_BIB_TITLE_POS { HelpId = HID_BIB_TITLE_POS; } +hidspecial HID_BIB_URL_POS { HelpId = HID_BIB_URL_POS; } +hidspecial HID_BIB_VOLUME_POS { HelpId = HID_BIB_VOLUME_POS; } +hidspecial HID_BIB_YEAR_POS { HelpId = HID_BIB_YEAR_POS; } -hidspecial HID_PROP_TITLE { HelpId = HID_PROP_TITLE; } -hidspecial HID_PROP_STEP { HelpId = HID_PROP_STEP; } -hidspecial HID_PROP_VALUE { HelpId = HID_PROP_VALUE; } -hidspecial HID_PROP_PROGRESSVALUE { HelpId = HID_PROP_PROGRESSVALUE; } -hidspecial HID_PROP_PROGRESSVALUE_MIN { HelpId = HID_PROP_PROGRESSVALUE_MIN; } -hidspecial HID_PROP_PROGRESSVALUE_MAX { HelpId = HID_PROP_PROGRESSVALUE_MAX; } -hidspecial HID_PROP_SCROLLVALUE { HelpId = HID_PROP_SCROLLVALUE; } -hidspecial HID_PROP_SCROLLVALUE_MIN { HelpId = HID_PROP_SCROLLVALUE_MIN; } -hidspecial HID_PROP_SCROLLVALUE_MAX { HelpId = HID_PROP_SCROLLVALUE_MAX; } -hidspecial HID_PROP_LINEINCREMENT { HelpId = HID_PROP_LINEINCREMENT; } -hidspecial HID_PROP_BLOCKINCREMENT { HelpId = HID_PROP_BLOCKINCREMENT; } -hidspecial HID_PROP_VISIBLESIZE { HelpId = HID_PROP_VISIBLESIZE; } -hidspecial HID_PROP_ORIENTATION { HelpId = HID_PROP_ORIENTATION; } -hidspecial HID_PROP_POSITIONX { HelpId = HID_PROP_POSITIONX; } -hidspecial HID_PROP_POSITIONY { HelpId = HID_PROP_POSITIONY; } -hidspecial HID_PROP_PUSHBUTTONTYPE { HelpId = HID_PROP_PUSHBUTTONTYPE; } -hidspecial HID_PROP_STATE { HelpId = HID_PROP_STATE; } -hidspecial HID_PROP_SCALEIMAGE { HelpId = HID_PROP_SCALEIMAGE; } -hidspecial HID_PROP_BOUND_CELL { HelpId = HID_PROP_BOUND_CELL; } -hidspecial HID_PROP_LIST_CELL_RANGE { HelpId = HID_PROP_LIST_CELL_RANGE; } -hidspecial HID_PROP_CELL_EXCHANGE_TYPE { HelpId = HID_PROP_CELL_EXCHANGE_TYPE; } -hidspecial HID_PROP_SELECTEDITEMS { HelpId = HID_PROP_SELECTEDITEMS; } -hidspecial HID_PROP_SCROLLVALUEMIN { HelpId = HID_PROP_SCROLLVALUE_MIN; } -hidspecial HID_PROP_DEFAULT_SCROLLVALUE { HelpId = HID_PROP_DEFAULT_SCROLLVALUE; } -hidspecial HID_PROP_REPEAT_DELAY { HelpId = HID_PROP_REPEAT_DELAY; } -hidspecial HID_PROP_SYMBOLCOLOR { HelpId = HID_PROP_SYMBOLCOLOR; } -hidspecial HID_PROP_SPINVALUE { HelpId = HID_PROP_SPINVALUE; } -hidspecial HID_PROP_SPINVALUE_MIN { HelpId = HID_PROP_SPINVALUE_MIN; } -hidspecial HID_PROP_SPINVALUE_MAX { HelpId = HID_PROP_SPINVALUE_MAX; } -hidspecial HID_PROP_DEFAULT_SPINVALUE { HelpId = HID_PROP_DEFAULT_SPINVALUE; } -hidspecial HID_PROP_SPININCREMENT { HelpId = HID_PROP_SPININCREMENT; } -hidspecial HID_PROP_REPEAT { HelpId = HID_PROP_REPEAT; } -hidspecial UID_PROP_DLG_FONT_TYPE { HelpId = UID_PROP_DLG_FONT_TYPE; } -hidspecial UID_PROP_DLG_ATTR_TARGET_URL { HelpId = UID_PROP_DLG_ATTR_TARGET_URL; } -hidspecial UID_PROP_DLG_IMAGE_URL { HelpId = UID_PROP_DLG_IMAGE_URL; } -hidspecial UID_PROP_DLG_BACKGROUNDCOLOR { HelpId = UID_PROP_DLG_BACKGROUNDCOLOR; } -hidspecial UID_PROP_DLG_CONTROLLABEL { HelpId = UID_PROP_DLG_CONTROLLABEL; } -hidspecial UID_PROP_DLG_NUMBER_FORMAT { HelpId = UID_PROP_DLG_NUMBER_FORMAT; } -hidspecial UID_PROP_DLG_ATTR_DATASOURCE { HelpId = UID_PROP_DLG_ATTR_DATASOURCE; } -hidspecial UID_PROP_DLG_FILLCOLOR { HelpId = UID_PROP_DLG_FILLCOLOR; } -hidspecial UID_PROP_DLG_SYMBOLCOLOR { HelpId = UID_PROP_DLG_SYMBOLCOLOR; } -hidspecial UID_EVT_MACRODLG { HelpId = UID_EVT_MACRODLG; } -hidspecial HID_PROP_WORDBREAK { HelpId = HID_PROP_WORDBREAK; } -hidspecial HID_PROP_SHOW_SCROLLBARS { HelpId = HID_PROP_SHOW_SCROLLBARS; } -hidspecial HID_PROP_TABORDER_CONTROLS { HelpId = HID_PROP_TABORDER_CONTROLS; } -hidspecial HID_PROP_ICONSIZE { HelpId = HID_PROP_ICONSIZE; } -hidspecial HID_PROP_SHOW_POSITION { HelpId = HID_PROP_SHOW_POSITION; } -hidspecial HID_PROP_SHOW_NAVIGATION { HelpId = HID_PROP_SHOW_NAVIGATION; } -hidspecial HID_PROP_SHOW_RECORDACTIONS { HelpId = HID_PROP_SHOW_RECORDACTIONS; } -hidspecial HID_PROP_SHOW_FILTERSORT { HelpId = HID_PROP_SHOW_FILTERSORT; } +hidspecial HID_CHECK_FOR_UPD_CANCEL { HelpId = HID_CHECK_FOR_UPD_CANCEL; } +hidspecial HID_CHECK_FOR_UPD_CLOSE { HelpId = HID_CHECK_FOR_UPD_CLOSE; } +hidspecial HID_CHECK_FOR_UPD_DESCRIPTION { HelpId = HID_CHECK_FOR_UPD_DESCRIPTION; } +hidspecial HID_CHECK_FOR_UPD_DLG { HelpId = HID_CHECK_FOR_UPD_DLG; } +hidspecial HID_CHECK_FOR_UPD_DOWNLOAD { HelpId = HID_CHECK_FOR_UPD_DOWNLOAD; } +hidspecial HID_CHECK_FOR_UPD_DOWNLOAD2 { HelpId = HID_CHECK_FOR_UPD_DOWNLOAD2; } +hidspecial HID_CHECK_FOR_UPD_INSTALL { HelpId = HID_CHECK_FOR_UPD_INSTALL; } +hidspecial HID_CHECK_FOR_UPD_PAUSE { HelpId = HID_CHECK_FOR_UPD_PAUSE; } +hidspecial HID_CHECK_FOR_UPD_RESUME { HelpId = HID_CHECK_FOR_UPD_RESUME; } +hidspecial HID_CHECK_FOR_UPD_STATUS { HelpId = HID_CHECK_FOR_UPD_STATUS; } -hidspecial UID_PROP_DLG_FONT_TYPE { HelpId = UID_PROP_DLG_FONT_TYPE; } -hidspecial UID_PROP_DLG_IMAGE_URL { HelpId = UID_PROP_DLG_IMAGE_URL; } -hidspecial UID_PROP_DLG_BACKGROUNDCOLOR { HelpId = UID_PROP_DLG_BACKGROUNDCOLOR; } -hidspecial UID_PROP_DLG_ATTR_DATASOURCE { HelpId = UID_PROP_DLG_ATTR_DATASOURCE; } -hidspecial UID_PROP_DLG_ATTR_TARGET_URL { HelpId = UID_PROP_DLG_ATTR_TARGET_URL; } -hidspecial UID_PROP_DLG_NUMBER_FORMAT { HelpId = UID_PROP_DLG_NUMBER_FORMAT; } -hidspecial UID_PROP_DLG_CONTROLLABEL { HelpId = UID_PROP_DLG_CONTROLLABEL; } -hidspecial UID_PROP_DLG_FILLCOLOR { HelpId = UID_PROP_DLG_FILLCOLOR; } -hidspecial UID_PROP_DLG_TABINDEX { HelpId = UID_PROP_DLG_TABINDEX; } -hidspecial UID_PROP_DLG_SQLCOMMAND { HelpId = UID_PROP_DLG_SQLCOMMAND; } -hidspecial UID_PROP_DLG_FORMLINKFIELDS { HelpId = UID_PROP_DLG_FORMLINKFIELDS; } -hidspecial HID_FIELDLINK_DETAIL_COLUMN { HelpId = HID_FIELDLINK_DETAIL_COLUMN; } -hidspecial HID_FIELDLINK_MASTER_COLUMN { HelpId = HID_FIELDLINK_MASTER_COLUMN; } -hidspecial UID_FIELDLINK_DETAIL1 { HelpId = UID_FIELDLINK_DETAIL1; } -hidspecial UID_FIELDLINK_MASTER1 { HelpId = UID_FIELDLINK_MASTER1; } -hidspecial UID_FIELDLINK_DETAIL2 { HelpId = UID_FIELDLINK_DETAIL2; } -hidspecial UID_FIELDLINK_MASTER2 { HelpId = UID_FIELDLINK_MASTER2; } -hidspecial UID_FIELDLINK_DETAIL3 { HelpId = UID_FIELDLINK_DETAIL3; } -hidspecial UID_FIELDLINK_MASTER3 { HelpId = UID_FIELDLINK_MASTER3; } -hidspecial UID_FIELDLINK_DETAIL4 { HelpId = UID_FIELDLINK_DETAIL4; } -hidspecial UID_FIELDLINK_MASTER4 { HelpId = UID_FIELDLINK_MASTER4; } -hidspecial UID_PROP_DLG_FILTER { HelpId = UID_PROP_DLG_FILTER; } -hidspecial UID_PROP_DLG_ORDER { HelpId = UID_PROP_DLG_ORDER; } -hidspecial UID_PROP_DLG_SELECTION { HelpId = UID_PROP_DLG_SELECTION; } -hidspecial UID_PROP_DLG_SYMBOLCOLOR { HelpId = UID_PROP_DLG_SYMBOLCOLOR; } -hidspecial UID_BRWEVT_APPROVEACTIONPERFORMED { HelpId = UID_BRWEVT_APPROVEACTIONPERFORMED; } -hidspecial UID_BRWEVT_ACTIONPERFORMED { HelpId = UID_BRWEVT_ACTIONPERFORMED; } -hidspecial UID_BRWEVT_CHANGED { HelpId = UID_BRWEVT_CHANGED; } -hidspecial UID_BRWEVT_TEXTCHANGED { HelpId = UID_BRWEVT_TEXTCHANGED; } -hidspecial UID_BRWEVT_ITEMSTATECHANGED { HelpId = UID_BRWEVT_ITEMSTATECHANGED; } -hidspecial UID_BRWEVT_FOCUSGAINED { HelpId = UID_BRWEVT_FOCUSGAINED; } -hidspecial UID_BRWEVT_FOCUSLOST { HelpId = UID_BRWEVT_FOCUSLOST; } -hidspecial UID_BRWEVT_KEYTYPED { HelpId = UID_BRWEVT_KEYTYPED; } -hidspecial UID_BRWEVT_KEYUP { HelpId = UID_BRWEVT_KEYUP; } -hidspecial UID_BRWEVT_MOUSEENTERED { HelpId = UID_BRWEVT_MOUSEENTERED; } -hidspecial UID_BRWEVT_MOUSEDRAGGED { HelpId = UID_BRWEVT_MOUSEDRAGGED; } -hidspecial UID_BRWEVT_MOUSEMOVED { HelpId = UID_BRWEVT_MOUSEMOVED; } -hidspecial UID_BRWEVT_MOUSEPRESSED { HelpId = UID_BRWEVT_MOUSEPRESSED; } -hidspecial UID_BRWEVT_MOUSERELEASED { HelpId = UID_BRWEVT_MOUSERELEASED; } -hidspecial UID_BRWEVT_MOUSEEXITED { HelpId = UID_BRWEVT_MOUSEEXITED; } -hidspecial UID_BRWEVT_APPROVERESETTED { HelpId = UID_BRWEVT_APPROVERESETTED; } -hidspecial UID_BRWEVT_RESETTED { HelpId = UID_BRWEVT_RESETTED; } -hidspecial UID_BRWEVT_SUBMITTED { HelpId = UID_BRWEVT_SUBMITTED; } -hidspecial UID_BRWEVT_BEFOREUPDATE { HelpId = UID_BRWEVT_BEFOREUPDATE; } -hidspecial UID_BRWEVT_AFTERUPDATE { HelpId = UID_BRWEVT_AFTERUPDATE; } -hidspecial UID_BRWEVT_LOADED { HelpId = UID_BRWEVT_LOADED; } -hidspecial UID_BRWEVT_RELOADING { HelpId = UID_BRWEVT_RELOADING; } -hidspecial UID_BRWEVT_RELOADED { HelpId = UID_BRWEVT_RELOADED; } -hidspecial UID_BRWEVT_UNLOADING { HelpId = UID_BRWEVT_UNLOADING; } -hidspecial UID_BRWEVT_UNLOADED { HelpId = UID_BRWEVT_UNLOADED; } -hidspecial UID_BRWEVT_CONFIRMDELETE { HelpId = UID_BRWEVT_CONFIRMDELETE; } -hidspecial UID_BRWEVT_APPROVEROWCHANGE { HelpId = UID_BRWEVT_APPROVEROWCHANGE; } -hidspecial UID_BRWEVT_ROWCHANGE { HelpId = UID_BRWEVT_ROWCHANGE; } -hidspecial UID_BRWEVT_POSITIONING { HelpId = UID_BRWEVT_POSITIONING; } -hidspecial UID_BRWEVT_POSITIONED { HelpId = UID_BRWEVT_POSITIONED; } -hidspecial UID_BRWEVT_APPROVEPARAMETER { HelpId = UID_BRWEVT_APPROVEPARAMETER; } -hidspecial UID_BRWEVT_ERROROCCURED { HelpId = UID_BRWEVT_ERROROCCURED; } -hidspecial UID_BRWEVT_ADJUSTMENTVALUECHANGED { HelpId = UID_BRWEVT_ADJUSTMENTVALUECHANGED; } -hidspecial HID_PROP_AUTOLINEBREAK { HelpId = HID_PROP_AUTOLINEBREAK; } -hidspecial HID_PROP_TEXTTYPE { HelpId = HID_PROP_TEXTTYPE; } -hidspecial HID_PROP_LINEEND_FORMAT { HelpId = HID_PROP_LINEEND_FORMAT; } +hidspecial HID_DBIWIZARD { HelpId = HID_DBIWIZARD; } +hidspecial HID_DBIWIZARD_CANCEL { HelpId = HID_DBIWIZARD_CANCEL; } +hidspecial HID_DBIWIZARD_FILESELECTION { HelpId = HID_DBIWIZARD_FILESELECTION; } +hidspecial HID_DBIWIZARD_FINISH { HelpId = HID_DBIWIZARD_FINISH; } +hidspecial HID_DBIWIZARD_NEXT { HelpId = HID_DBIWIZARD_NEXT; } +hidspecial HID_DBIWIZARD_PREVIOUS { HelpId = HID_DBIWIZARD_PREVIOUS; } + +hidspecial HID_DLG_DBCHANGE { HelpId = HID_DLG_DBCHANGE; } +hidspecial HID_DLG_MAPPING { HelpId = HID_DLG_MAPPING; } hidspecial HID_EVT_ACTIONPERFORMED { HelpId = HID_EVT_ACTIONPERFORMED; } +hidspecial HID_EVT_ADJUSTMENTVALUECHANGED { HelpId = HID_EVT_ADJUSTMENTVALUECHANGED; } hidspecial HID_EVT_AFTERUPDATE { HelpId = HID_EVT_AFTERUPDATE; } +hidspecial HID_EVT_APPROVEACTIONPERFORMED { HelpId = HID_EVT_APPROVEACTIONPERFORMED; } +hidspecial HID_EVT_APPROVEPARAMETER { HelpId = HID_EVT_APPROVEPARAMETER; } +hidspecial HID_EVT_APPROVERESETTED { HelpId = HID_EVT_APPROVERESETTED; } +hidspecial HID_EVT_APPROVEROWCHANGE { HelpId = HID_EVT_APPROVEROWCHANGE; } hidspecial HID_EVT_BEFOREUPDATE { HelpId = HID_EVT_BEFOREUPDATE; } +hidspecial HID_EVT_CHANGED { HelpId = HID_EVT_CHANGED; } hidspecial HID_EVT_CONFIRMDELETE { HelpId = HID_EVT_CONFIRMDELETE; } hidspecial HID_EVT_ERROROCCURED { HelpId = HID_EVT_ERROROCCURED; } hidspecial HID_EVT_FOCUSGAINED { HelpId = HID_EVT_FOCUSGAINED; } hidspecial HID_EVT_FOCUSLOST { HelpId = HID_EVT_FOCUSLOST; } hidspecial HID_EVT_ITEMSTATECHANGED { HelpId = HID_EVT_ITEMSTATECHANGED; } hidspecial HID_EVT_KEYTYPED { HelpId = HID_EVT_KEYTYPED; } +hidspecial HID_EVT_KEYUP { HelpId = HID_EVT_KEYUP; } hidspecial HID_EVT_LOADED { HelpId = HID_EVT_LOADED; } hidspecial HID_EVT_MOUSEDRAGGED { HelpId = HID_EVT_MOUSEDRAGGED; } hidspecial HID_EVT_MOUSEENTERED { HelpId = HID_EVT_MOUSEENTERED; } @@ -240,74 +124,314 @@ hidspecial HID_EVT_MOUSEMOVED { HelpId = HID_EVT_MOUSEMOVED; } hidspecial HID_EVT_MOUSEPRESSED { HelpId = HID_EVT_MOUSEPRESSED; } hidspecial HID_EVT_MOUSERELEASED { HelpId = HID_EVT_MOUSERELEASED; } hidspecial HID_EVT_POSITIONED { HelpId = HID_EVT_POSITIONED; } +hidspecial HID_EVT_POSITIONING { HelpId = HID_EVT_POSITIONING; } +hidspecial HID_EVT_RELOADED { HelpId = HID_EVT_RELOADED; } +hidspecial HID_EVT_RELOADING { HelpId = HID_EVT_RELOADING; } hidspecial HID_EVT_RESETTED { HelpId = HID_EVT_RESETTED; } +hidspecial HID_EVT_ROWCHANGE { HelpId = HID_EVT_ROWCHANGE; } hidspecial HID_EVT_SUBMITTED { HelpId = HID_EVT_SUBMITTED; } hidspecial HID_EVT_TEXTCHANGED { HelpId = HID_EVT_TEXTCHANGED; } hidspecial HID_EVT_UNLOADED { HelpId = HID_EVT_UNLOADED; } -hidspecial HID_EVT_CHANGED { HelpId = HID_EVT_CHANGED; } -hidspecial HID_EVT_APPROVEACTIONPERFORMED { HelpId = HID_EVT_APPROVEACTIONPERFORMED; } -hidspecial HID_EVT_APPROVERESETTED { HelpId = HID_EVT_APPROVERESETTED; } -hidspecial HID_EVT_KEYUP { HelpId = HID_EVT_KEYUP; } -hidspecial HID_EVT_APPROVEPARAMETER { HelpId = HID_EVT_APPROVEPARAMETER; } -hidspecial HID_EVT_POSITIONING { HelpId = HID_EVT_POSITIONING; } -hidspecial HID_EVT_RELOADED { HelpId = HID_EVT_RELOADED; } -hidspecial HID_EVT_APPROVEROWCHANGE { HelpId = HID_EVT_APPROVEROWCHANGE; } -hidspecial HID_EVT_ROWCHANGE { HelpId = HID_EVT_ROWCHANGE; } -hidspecial HID_EVT_RELOADING { HelpId = HID_EVT_RELOADING; } hidspecial HID_EVT_UNLOADING { HelpId = HID_EVT_UNLOADING; } -hidspecial HID_EVT_ADJUSTMENTVALUECHANGED { HelpId = HID_EVT_ADJUSTMENTVALUECHANGED; } -hidspecial HID_PROP_TOGGLE { HelpId = HID_PROP_TOGGLE; } -hidspecial HID_PROP_FOCUSONCLICK { HelpId = HID_PROP_FOCUSONCLICK; } -hidspecial HID_PROP_HIDEINACTIVESELECTION { HelpId = HID_PROP_HIDEINACTIVESELECTION; } -hidspecial HID_PROP_VISUALEFFECT { HelpId = HID_PROP_VISUALEFFECT; } -hidspecial HID_PROP_BORDERCOLOR { HelpId = HID_PROP_BORDERCOLOR; } -hidspecial UID_PROP_DLG_BORDERCOLOR { HelpId = UID_PROP_DLG_BORDERCOLOR; } -hidspecial HID_PROP_IMAGEPOSITION { HelpId = HID_PROP_IMAGEPOSITION; } -hidspecial HID_PROP_XML_DATA_MODEL { HelpId = HID_PROP_XML_DATA_MODEL; } -hidspecial HID_PROP_BIND_EXPRESSION { HelpId = HID_PROP_BIND_EXPRESSION; } -hidspecial HID_PROP_XSD_REQUIRED { HelpId = HID_PROP_XSD_REQUIRED; } -hidspecial HID_PROP_XSD_RELEVANT { HelpId = HID_PROP_XSD_RELEVANT; } -hidspecial HID_PROP_XSD_READONLY { HelpId = HID_PROP_XSD_READONLY; } -hidspecial HID_PROP_XSD_CONSTRAINT { HelpId = HID_PROP_XSD_CONSTRAINT; } -hidspecial HID_PROP_XSD_CALCULATION { HelpId = HID_PROP_XSD_CALCULATION; } -hidspecial HID_PROP_XSD_DATA_TYPE { HelpId = HID_PROP_XSD_DATA_TYPE; } -hidspecial HID_PROP_XSD_WHITESPACES { HelpId = HID_PROP_XSD_WHITESPACES; } -hidspecial HID_PROP_XSD_PATTERN { HelpId = HID_PROP_XSD_PATTERN; } -hidspecial HID_PROP_XSD_LENGTH { HelpId = HID_PROP_XSD_LENGTH; } -hidspecial HID_PROP_XSD_MIN_LENGTH { HelpId = HID_PROP_XSD_MIN_LENGTH; } -hidspecial HID_PROP_XSD_MAX_LENGTH { HelpId = HID_PROP_XSD_MAX_LENGTH; } -hidspecial UID_PROP_DLG_BIND_EXPRESSION { HelpId = UID_PROP_DLG_BIND_EXPRESSION; } -hidspecial UID_PROP_DLG_XSD_REQUIRED { HelpId = UID_PROP_DLG_XSD_REQUIRED; } -hidspecial UID_PROP_DLG_XSD_RELEVANT { HelpId = UID_PROP_DLG_XSD_RELEVANT; } -hidspecial UID_PROP_DLG_XSD_READONLY { HelpId = UID_PROP_DLG_XSD_READONLY; } -hidspecial UID_PROP_DLG_XSD_CONSTRAINT { HelpId = UID_PROP_DLG_XSD_CONSTRAINT; } -hidspecial UID_PROP_DLG_XSD_CALCULATION { HelpId = UID_PROP_DLG_XSD_CALCULATION; } -hidspecial UID_PROP_ADD_DATA_TYPE { HelpId = UID_PROP_ADD_DATA_TYPE; } -hidspecial UID_PROP_REMOVE_DATA_TYPE { HelpId = UID_PROP_REMOVE_DATA_TYPE; } -hidspecial HID_PROP_XSD_TOTAL_DIGITS { HelpId = HID_PROP_XSD_TOTAL_DIGITS; } -hidspecial HID_PROP_XSD_FRACTION_DIGITS { HelpId = HID_PROP_XSD_FRACTION_DIGITS; } -hidspecial HID_PROP_XSD_MAX_INCLUSIVE { HelpId = HID_PROP_XSD_MAX_INCLUSIVE; } -hidspecial HID_PROP_XSD_MAX_EXCLUSIVE { HelpId = HID_PROP_XSD_MAX_EXCLUSIVE; } -hidspecial HID_PROP_XSD_MIN_INCLUSIVE { HelpId = HID_PROP_XSD_MIN_INCLUSIVE; } -hidspecial HID_PROP_XSD_MIN_EXCLUSIVE { HelpId = HID_PROP_XSD_MIN_EXCLUSIVE; } -hidspecial HID_PROP_UNCHECKEDREFVALUE { HelpId = HID_PROP_UNCHECKEDREFVALUE; } -hidspecial HID_PROP_SUBMISSION_ID { HelpId = HID_PROP_SUBMISSION_ID; } -hidspecial HID_PROP_LIST_BINDING { HelpId = HID_PROP_LIST_BINDING; } -hidspecial HID_PROP_BINDING_NAME { HelpId = HID_PROP_BINDING_NAME; } -hidspecial HID_CHECK_FOR_UPD_DLG { HelpId = HID_CHECK_FOR_UPD_DLG; } -hidspecial HID_CHECK_FOR_UPD_CLOSE { HelpId = HID_CHECK_FOR_UPD_CLOSE; } -hidspecial HID_CHECK_FOR_UPD_PAUSE { HelpId = HID_CHECK_FOR_UPD_PAUSE; } -hidspecial HID_CHECK_FOR_UPD_RESUME { HelpId = HID_CHECK_FOR_UPD_RESUME; } -hidspecial HID_CHECK_FOR_UPD_DOWNLOAD { HelpId = HID_CHECK_FOR_UPD_DOWNLOAD; } -hidspecial HID_CHECK_FOR_UPD_DOWNLOAD2 { HelpId = HID_CHECK_FOR_UPD_DOWNLOAD2; } -hidspecial HID_CHECK_FOR_UPD_INSTALL { HelpId = HID_CHECK_FOR_UPD_INSTALL; } -hidspecial HID_CHECK_FOR_UPD_STATUS { HelpId = HID_CHECK_FOR_UPD_STATUS; } -hidspecial HID_CHECK_FOR_UPD_DESCRIPTION { HelpId = HID_CHECK_FOR_UPD_DESCRIPTION; } -hidspecial HID_CHECK_FOR_UPD_CANCEL { HelpId = HID_CHECK_FOR_UPD_CANCEL; } -hidspecial HID_PROP_NOLABEL { HelpId = HID_PROP_NOLABEL; } -hidspecial HID_PROP_INPUT_REQUIRED { HelpId = HID_PROP_INPUT_REQUIRED; } -hidspecial HID_PROP_WRITING_MODE { HelpId = HID_PROP_WRITING_MODE; } -hidspecial HID_PROP_ENABLE_VISIBLE { HelpId = HID_PROP_ENABLE_VISIBLE; } -hidspecial HID_PROP_WHEEL_BEHAVIOR { HelpId = HID_PROP_WHEEL_BEHAVIOR; } +hidspecial HID_FIELDLINK_DETAIL_COLUMN { HelpId = HID_FIELDLINK_DETAIL_COLUMN; } +hidspecial HID_FIELDLINK_MASTER_COLUMN { HelpId = HID_FIELDLINK_MASTER_COLUMN; } + +hidspecial HID_GRIDWIZARD_CANCEL { HelpId = HID_GRIDWIZARD_CANCEL; } +hidspecial HID_GRIDWIZARD_FINISH { HelpId = HID_GRIDWIZARD_FINISH; } +hidspecial HID_GRIDWIZARD_NEXT { HelpId = HID_GRIDWIZARD_NEXT; } +hidspecial HID_GRIDWIZARD_PREVIOUS { HelpId = HID_GRIDWIZARD_PREVIOUS; }; +hidspecial HID_GROUPWIZARD_CANCEL { HelpId = HID_GROUPWIZARD_CANCEL; } +hidspecial HID_GROUPWIZARD_FINISH { HelpId = HID_GROUPWIZARD_FINISH; } +hidspecial HID_GROUPWIZARD_NEXT { HelpId = HID_GROUPWIZARD_NEXT; } +hidspecial HID_GROUPWIZARD_PREVIOUS { HelpId = HID_GROUPWIZARD_PREVIOUS; } + +hidspecial HID_LISTWIZARD_CANCEL { HelpId = HID_LISTWIZARD_CANCEL; } +hidspecial HID_LISTWIZARD_FINISH { HelpId = HID_LISTWIZARD_FINISH; } +hidspecial HID_LISTWIZARD_NEXT { HelpId = HID_LISTWIZARD_NEXT; } +hidspecial HID_LISTWIZARD_PREVIOUS { HelpId = HID_LISTWIZARD_PREVIOUS; } + +hidspecial HID_PROP_ALIGN { HelpId = HID_PROP_ALIGN; } +hidspecial HID_PROP_ALLOW_ADDITIONS { HelpId = HID_PROP_ALLOW_ADDITIONS; } +hidspecial HID_PROP_ALLOW_DELETIONS { HelpId = HID_PROP_ALLOW_DELETIONS; } +hidspecial HID_PROP_ALLOW_EDITS { HelpId = HID_PROP_ALLOW_EDITS; } hidspecial HID_PROP_ANCHOR_TYPE { HelpId = HID_PROP_ANCHOR_TYPE; } +hidspecial HID_PROP_AUTOCOMPLETE { HelpId = HID_PROP_AUTOCOMPLETE; } +hidspecial HID_PROP_AUTOLINEBREAK { HelpId = HID_PROP_AUTOLINEBREAK; } +hidspecial HID_PROP_BACKGROUNDCOLOR { HelpId = HID_PROP_BACKGROUNDCOLOR; } +hidspecial HID_PROP_BINDING_NAME { HelpId = HID_PROP_BINDING_NAME; } +hidspecial HID_PROP_BIND_EXPRESSION { HelpId = HID_PROP_BIND_EXPRESSION; } +hidspecial HID_PROP_BLOCKINCREMENT { HelpId = HID_PROP_BLOCKINCREMENT; } +hidspecial HID_PROP_BORDER { HelpId = HID_PROP_BORDER; } +hidspecial HID_PROP_BORDERCOLOR { HelpId = HID_PROP_BORDERCOLOR; } +hidspecial HID_PROP_BOUNDCOLUMN { HelpId = HID_PROP_BOUNDCOLUMN; } +hidspecial HID_PROP_BOUND_CELL { HelpId = HID_PROP_BOUND_CELL; } +hidspecial HID_PROP_BUTTONTYPE { HelpId = HID_PROP_BUTTONTYPE; } +hidspecial HID_PROP_CELL_EXCHANGE_TYPE { HelpId = HID_PROP_CELL_EXCHANGE_TYPE; } +hidspecial HID_PROP_CLASSID { HelpId = HID_PROP_CLASSID; } +hidspecial HID_PROP_CONTROLLABEL { HelpId = HID_PROP_CONTROLLABEL; } +hidspecial HID_PROP_CONTROLSOURCE { HelpId = HID_PROP_CONTROLSOURCE; } +hidspecial HID_PROP_CURRENCYSYMBOL { HelpId = HID_PROP_CURRENCYSYMBOL; } +hidspecial HID_PROP_CURRSYM_POSITION { HelpId = HID_PROP_CURRSYM_POSITION; } +hidspecial HID_PROP_CURSORSOURCE { HelpId = HID_PROP_CURSORSOURCE; } +hidspecial HID_PROP_CURSORSOURCETYPE { HelpId = HID_PROP_CURSORSOURCETYPE; } +hidspecial HID_PROP_CURSORTYPE { HelpId = HID_PROP_CURSORTYPE; } +hidspecial HID_PROP_CYCLE { HelpId = HID_PROP_CYCLE; } +hidspecial HID_PROP_DATAENTRY { HelpId = HID_PROP_DATAENTRY; } +hidspecial HID_PROP_DATASOURCE { HelpId = HID_PROP_DATASOURCE; } +hidspecial HID_PROP_DATE { HelpId = HID_PROP_DATE; } +hidspecial HID_PROP_DATEFORMAT { HelpId = HID_PROP_DATEFORMAT; } +hidspecial HID_PROP_DATEMAX { HelpId = HID_PROP_DATEMAX; } +hidspecial HID_PROP_DATEMIN { HelpId = HID_PROP_DATEMIN; } +hidspecial HID_PROP_DECIMAL_ACCURACY { HelpId = HID_PROP_DECIMAL_ACCURACY; } +hidspecial HID_PROP_DECORATION { HelpId = HID_PROP_DECORATION; } +hidspecial HID_PROP_DEFAULTVALUE { HelpId = HID_PROP_DEFAULTVALUE; } +hidspecial HID_PROP_DEFAULT_BUTTON { HelpId = HID_PROP_DEFAULT_BUTTON; } +hidspecial HID_PROP_DEFAULT_DATE { HelpId = HID_PROP_DEFAULT_DATE; } +hidspecial HID_PROP_DEFAULT_LONG_VALUE { HelpId = HID_PROP_DEFAULT_LONG_VALUE; } +hidspecial HID_PROP_DEFAULT_SCROLLVALUE { HelpId = HID_PROP_DEFAULT_SCROLLVALUE; } +hidspecial HID_PROP_DEFAULT_SELECT_SEQ { HelpId = HID_PROP_DEFAULT_SELECT_SEQ; } +hidspecial HID_PROP_DEFAULT_SPINVALUE { HelpId = HID_PROP_DEFAULT_SPINVALUE; } +hidspecial HID_PROP_DEFAULT_STATE { HelpId = HID_PROP_DEFAULT_STATE; } +hidspecial HID_PROP_DEFAULT_TIME { HelpId = HID_PROP_DEFAULT_TIME; } +hidspecial HID_PROP_DIRTY { HelpId = HID_PROP_DIRTY; } +hidspecial HID_PROP_DROPDOWN { HelpId = HID_PROP_DROPDOWN; } +hidspecial HID_PROP_ECHO_CHAR { HelpId = HID_PROP_ECHO_CHAR; } +hidspecial HID_PROP_EDITABLE { HelpId = HID_PROP_EDITABLE; } +hidspecial HID_PROP_EDITMASK { HelpId = HID_PROP_EDITMASK; } +hidspecial HID_PROP_EFFECTIVEDEFAULT { HelpId = HID_PROP_EFFECTIVEDEFAULT; } +hidspecial HID_PROP_EFFECTIVEMAX { HelpId = HID_PROP_EFFECTIVEMAX; } +hidspecial HID_PROP_EFFECTIVEMIN { HelpId = HID_PROP_EFFECTIVEMIN; } +hidspecial HID_PROP_EMPTY_IS_NULL { HelpId = HID_PROP_EMPTY_IS_NULL; } +hidspecial HID_PROP_ENABLED { HelpId = HID_PROP_ENABLED; } +hidspecial HID_PROP_ENABLE_VISIBLE { HelpId = HID_PROP_ENABLE_VISIBLE; } +hidspecial HID_PROP_ESCAPE_PROCESSING { HelpId = HID_PROP_ESCAPE_PROCESSING; } +hidspecial HID_PROP_FILLCOLOR { HelpId = HID_PROP_FILLCOLOR; } +hidspecial HID_PROP_FILTER { HelpId = HID_PROP_FILTER; } +hidspecial HID_PROP_FILTERPROPOSAL { HelpId = HID_PROP_FILTERPROPOSAL; } +hidspecial HID_PROP_FOCUSONCLICK { HelpId = HID_PROP_FOCUSONCLICK; } +hidspecial HID_PROP_FONT { HelpId = HID_PROP_FONT; } +hidspecial HID_PROP_FORMATKEY { HelpId = HID_PROP_FORMATKEY; } +hidspecial HID_PROP_GROUPBOX { HelpId = HID_PROP_GROUPBOX; } +hidspecial HID_PROP_HEIGHT { HelpId = HID_PROP_HEIGHT; } +hidspecial HID_PROP_HELPTEXT { HelpId = HID_PROP_HELPTEXT; } +hidspecial HID_PROP_HELPURL { HelpId = HID_PROP_HELPURL; } +hidspecial HID_PROP_HIDDEN_VALUE { HelpId = HID_PROP_HIDDEN_VALUE; } +hidspecial HID_PROP_HIDEINACTIVESELECTION { HelpId = HID_PROP_HIDEINACTIVESELECTION; } +hidspecial HID_PROP_HSCROLL { HelpId = HID_PROP_HSCROLL; } +hidspecial HID_PROP_ICONSIZE { HelpId = HID_PROP_ICONSIZE; } +hidspecial HID_PROP_IMAGEPOSITION { HelpId = HID_PROP_IMAGEPOSITION; } +hidspecial HID_PROP_IMAGE_URL { HelpId = HID_PROP_IMAGE_URL; } +hidspecial HID_PROP_INPUT_REQUIRED { HelpId = HID_PROP_INPUT_REQUIRED; } +hidspecial HID_PROP_INVOKES_STOP_NOT_EDITING { HelpId = HID_PROP_INVOKES_STOP_NOT_EDITING; } +hidspecial HID_PROP_LABEL { HelpId = HID_PROP_LABEL; } +hidspecial HID_PROP_LEFT { HelpId = HID_PROP_LEFT; } +hidspecial HID_PROP_LINECOLOR { HelpId = HID_PROP_LINECOLOR; } +hidspecial HID_PROP_LINECOUNT { HelpId = HID_PROP_LINECOUNT; } +hidspecial HID_PROP_LINEEND_FORMAT { HelpId = HID_PROP_LINEEND_FORMAT; } +hidspecial HID_PROP_LINEINCREMENT { HelpId = HID_PROP_LINEINCREMENT; } +hidspecial HID_PROP_LISTINDEX { HelpId = HID_PROP_LISTINDEX; } +hidspecial HID_PROP_LISTSOURCE { HelpId = HID_PROP_LISTSOURCE; } +hidspecial HID_PROP_LISTSOURCETYPE { HelpId = HID_PROP_LISTSOURCETYPE; } +hidspecial HID_PROP_LIST_BINDING { HelpId = HID_PROP_LIST_BINDING; } +hidspecial HID_PROP_LIST_CELL_RANGE { HelpId = HID_PROP_LIST_CELL_RANGE; } +hidspecial HID_PROP_LITERALMASK { HelpId = HID_PROP_LITERALMASK; } +hidspecial HID_PROP_LOCKED { HelpId = HID_PROP_LOCKED; } +hidspecial HID_PROP_MASTERFIELDS { HelpId = HID_PROP_MASTERFIELDS; } +hidspecial HID_PROP_MAXTEXTLEN { HelpId = HID_PROP_MAXTEXTLEN; } +hidspecial HID_PROP_MULTILINE { HelpId = HID_PROP_MULTILINE; } +hidspecial HID_PROP_MULTISELECTION { HelpId = HID_PROP_MULTISELECTION; } +hidspecial HID_PROP_NAME { HelpId = HID_PROP_NAME; } +hidspecial HID_PROP_NAVIGATION { HelpId = HID_PROP_NAVIGATION; } +hidspecial HID_PROP_NAVIGATIONBAR { HelpId = HID_PROP_NAVIGATIONBAR; } +hidspecial HID_PROP_NOLABEL { HelpId = HID_PROP_NOLABEL; } +hidspecial HID_PROP_OLDVALUE { HelpId = HID_PROP_OLDVALUE; } +hidspecial HID_PROP_ORIENTATION { HelpId = HID_PROP_ORIENTATION; } +hidspecial HID_PROP_POSITIONX { HelpId = HID_PROP_POSITIONX; } +hidspecial HID_PROP_POSITIONY { HelpId = HID_PROP_POSITIONY; } +hidspecial HID_PROP_PRINTABLE { HelpId = HID_PROP_PRINTABLE; } +hidspecial HID_PROP_PROGRESSVALUE { HelpId = HID_PROP_PROGRESSVALUE; } +hidspecial HID_PROP_PROGRESSVALUE_MAX { HelpId = HID_PROP_PROGRESSVALUE_MAX; } +hidspecial HID_PROP_PROGRESSVALUE_MIN { HelpId = HID_PROP_PROGRESSVALUE_MIN; } +hidspecial HID_PROP_PUSHBUTTONTYPE { HelpId = HID_PROP_PUSHBUTTONTYPE; } +hidspecial HID_PROP_READONLY { HelpId = HID_PROP_READONLY; } +hidspecial HID_PROP_RECORDMARKER { HelpId = HID_PROP_RECORDMARKER; } +hidspecial HID_PROP_REFVALUE { HelpId = HID_PROP_REFVALUE; } +hidspecial HID_PROP_REPEAT { HelpId = HID_PROP_REPEAT; } +hidspecial HID_PROP_REPEAT_DELAY { HelpId = HID_PROP_REPEAT_DELAY; } +hidspecial HID_PROP_REQUIRED { HelpId = HID_PROP_REQUIRED; } +hidspecial HID_PROP_RIGHT { HelpId = HID_PROP_RIGHT; } +hidspecial HID_PROP_ROOT_DISPLAYED { HelpId = HID_PROP_ROOT_DISPLAYED; } +hidspecial HID_PROP_ROWHEIGHT { HelpId = HID_PROP_ROWHEIGHT; } +hidspecial HID_PROP_ROW_HEIGHT { HelpId = HID_PROP_ROW_HEIGHT; } +hidspecial HID_PROP_SCALEIMAGE { HelpId = HID_PROP_SCALEIMAGE; } +hidspecial HID_PROP_SCROLLVALUE { HelpId = HID_PROP_SCROLLVALUE; } +hidspecial HID_PROP_SCROLLVALUEMIN { HelpId = HID_PROP_SCROLLVALUE_MIN; } +hidspecial HID_PROP_SCROLLVALUE_MAX { HelpId = HID_PROP_SCROLLVALUE_MAX; } +hidspecial HID_PROP_SCROLLVALUE_MIN { HelpId = HID_PROP_SCROLLVALUE_MIN; } +hidspecial HID_PROP_SEARCHING { HelpId = HID_PROP_SEARCHING; } +hidspecial HID_PROP_SELECTEDITEMS { HelpId = HID_PROP_SELECTEDITEMS; } +hidspecial HID_PROP_SELECTION_TYPE { HelpId = HID_PROP_SELECTION_TYPE; } +hidspecial HID_PROP_SHOWS_HANDLES { HelpId = HID_PROP_SHOWS_HANDLES; } +hidspecial HID_PROP_SHOWS_ROOT_HANDLES { HelpId = HID_PROP_SHOWS_ROOT_HANDLES; } +hidspecial HID_PROP_SHOWTHOUSANDSEP { HelpId = HID_PROP_SHOWTHOUSANDSEP; } +hidspecial HID_PROP_SHOW_FILTERSORT { HelpId = HID_PROP_SHOW_FILTERSORT; } +hidspecial HID_PROP_SHOW_NAVIGATION { HelpId = HID_PROP_SHOW_NAVIGATION; } +hidspecial HID_PROP_SHOW_POSITION { HelpId = HID_PROP_SHOW_POSITION; } +hidspecial HID_PROP_SHOW_RECORDACTIONS { HelpId = HID_PROP_SHOW_RECORDACTIONS; } +hidspecial HID_PROP_SHOW_SCROLLBARS { HelpId = HID_PROP_SHOW_SCROLLBARS; } +hidspecial HID_PROP_SLAVEFIELDS { HelpId = HID_PROP_SLAVEFIELDS; } +hidspecial HID_PROP_SORT_CRITERIA { HelpId = HID_PROP_SORT_CRITERIA; } +hidspecial HID_PROP_SPIN { HelpId = HID_PROP_SPIN; } +hidspecial HID_PROP_SPININCREMENT { HelpId = HID_PROP_SPININCREMENT; } +hidspecial HID_PROP_SPINVALUE { HelpId = HID_PROP_SPINVALUE; } +hidspecial HID_PROP_SPINVALUE_MAX { HelpId = HID_PROP_SPINVALUE_MAX; } +hidspecial HID_PROP_SPINVALUE_MIN { HelpId = HID_PROP_SPINVALUE_MIN; } +hidspecial HID_PROP_STATE { HelpId = HID_PROP_STATE; } +hidspecial HID_PROP_STEP { HelpId = HID_PROP_STEP; } +hidspecial HID_PROP_STRICTFORMAT { HelpId = HID_PROP_STRICTFORMAT; } +hidspecial HID_PROP_STRINGITEMLIST { HelpId = HID_PROP_STRINGITEMLIST; } +hidspecial HID_PROP_SUBMISSION_ID { HelpId = HID_PROP_SUBMISSION_ID; } +hidspecial HID_PROP_SUBMIT_ACTION { HelpId = HID_PROP_SUBMIT_ACTION; } +hidspecial HID_PROP_SUBMIT_ENCODING { HelpId = HID_PROP_SUBMIT_ENCODING; } +hidspecial HID_PROP_SUBMIT_METHOD { HelpId = HID_PROP_SUBMIT_METHOD; } +hidspecial HID_PROP_SUBMIT_TARGET { HelpId = HID_PROP_SUBMIT_TARGET; } +hidspecial HID_PROP_SYMBOLCOLOR { HelpId = HID_PROP_SYMBOLCOLOR; } +hidspecial HID_PROP_TABINDEX { HelpId = HID_PROP_TABINDEX; } +hidspecial HID_PROP_TABORDER_CONTROLS { HelpId = HID_PROP_TABORDER_CONTROLS; } +hidspecial HID_PROP_TABSTOP { HelpId = HID_PROP_TABSTOP; } +hidspecial HID_PROP_TAG { HelpId = HID_PROP_TAG; } +hidspecial HID_PROP_TARGET_FRAME { HelpId = HID_PROP_TARGET_FRAME; } +hidspecial HID_PROP_TARGET_URL { HelpId = HID_PROP_TARGET_URL; } +hidspecial HID_PROP_TEXT { HelpId = HID_PROP_TEXT; } +hidspecial HID_PROP_TEXTTYPE { HelpId = HID_PROP_TEXTTYPE; } +hidspecial HID_PROP_TIME { HelpId = HID_PROP_TIME; } +hidspecial HID_PROP_TIMEFORMAT { HelpId = HID_PROP_TIMEFORMAT; } +hidspecial HID_PROP_TIMEMAX { HelpId = HID_PROP_TIMEMAX; } +hidspecial HID_PROP_TIMEMIN { HelpId = HID_PROP_TIMEMIN; } +hidspecial HID_PROP_TITLE { HelpId = HID_PROP_TITLE; } +hidspecial HID_PROP_TOGGLE { HelpId = HID_PROP_TOGGLE; } +hidspecial HID_PROP_TRISTATE { HelpId = HID_PROP_TRISTATE; } +hidspecial HID_PROP_UNCHECKEDREFVALUE { HelpId = HID_PROP_UNCHECKEDREFVALUE; } +hidspecial HID_PROP_UNIQUE { HelpId = HID_PROP_UNIQUE; } +hidspecial HID_PROP_VALUE { HelpId = HID_PROP_VALUE; } +hidspecial HID_PROP_VALUEMAX { HelpId = HID_PROP_VALUEMAX; } +hidspecial HID_PROP_VALUEMIN { HelpId = HID_PROP_VALUEMIN; } +hidspecial HID_PROP_VALUESTEP { HelpId = HID_PROP_VALUESTEP; } +hidspecial HID_PROP_VERTICAL_ALIGN { HelpId = HID_PROP_VERTICAL_ALIGN; } +hidspecial HID_PROP_VISIBLESIZE { HelpId = HID_PROP_VISIBLESIZE; } +hidspecial HID_PROP_VISUALEFFECT { HelpId = HID_PROP_VISUALEFFECT; } +hidspecial HID_PROP_VSCROLL { HelpId = HID_PROP_VSCROLL; } +hidspecial HID_PROP_WHEEL_BEHAVIOR { HelpId = HID_PROP_WHEEL_BEHAVIOR; } +hidspecial HID_PROP_WIDTH { HelpId = HID_PROP_WIDTH; } +hidspecial HID_PROP_WORDBREAK { HelpId = HID_PROP_WORDBREAK; } +hidspecial HID_PROP_WRITING_MODE { HelpId = HID_PROP_WRITING_MODE; } +hidspecial HID_PROP_XML_DATA_MODEL { HelpId = HID_PROP_XML_DATA_MODEL; } +hidspecial HID_PROP_XSD_CALCULATION { HelpId = HID_PROP_XSD_CALCULATION; } +hidspecial HID_PROP_XSD_CONSTRAINT { HelpId = HID_PROP_XSD_CONSTRAINT; } +hidspecial HID_PROP_XSD_DATA_TYPE { HelpId = HID_PROP_XSD_DATA_TYPE; } +hidspecial HID_PROP_XSD_FRACTION_DIGITS { HelpId = HID_PROP_XSD_FRACTION_DIGITS; } +hidspecial HID_PROP_XSD_LENGTH { HelpId = HID_PROP_XSD_LENGTH; } +hidspecial HID_PROP_XSD_MAX_EXCLUSIVE { HelpId = HID_PROP_XSD_MAX_EXCLUSIVE; } +hidspecial HID_PROP_XSD_MAX_INCLUSIVE { HelpId = HID_PROP_XSD_MAX_INCLUSIVE; } +hidspecial HID_PROP_XSD_MAX_LENGTH { HelpId = HID_PROP_XSD_MAX_LENGTH; } +hidspecial HID_PROP_XSD_MIN_EXCLUSIVE { HelpId = HID_PROP_XSD_MIN_EXCLUSIVE; } +hidspecial HID_PROP_XSD_MIN_INCLUSIVE { HelpId = HID_PROP_XSD_MIN_INCLUSIVE; } +hidspecial HID_PROP_XSD_MIN_LENGTH { HelpId = HID_PROP_XSD_MIN_LENGTH; } +hidspecial HID_PROP_XSD_PATTERN { HelpId = HID_PROP_XSD_PATTERN; } +hidspecial HID_PROP_XSD_READONLY { HelpId = HID_PROP_XSD_READONLY; } +hidspecial HID_PROP_XSD_RELEVANT { HelpId = HID_PROP_XSD_RELEVANT; } +hidspecial HID_PROP_XSD_REQUIRED { HelpId = HID_PROP_XSD_REQUIRED; } +hidspecial HID_PROP_XSD_TOTAL_DIGITS { HelpId = HID_PROP_XSD_TOTAL_DIGITS; } +hidspecial HID_PROP_XSD_WHITESPACES { HelpId = HID_PROP_XSD_WHITESPACES; } + +hidspecial HID_PROTOCOLS { HelpId = HID_PROTOCOLS; } +hidspecial HID_SELECTION_TLB { HelpId = HID_SELECTION_TLB; } + +hidspecial UID_ABSPILOT_HELP { HelpId = UID_ABSPILOT_HELP; } +hidspecial UID_BIB_FRAME_WINDOW { HelpId = UID_BIB_FRAME_WINDOW;} + +hidspecial UID_BRWEVT_ACTIONPERFORMED { HelpId = UID_BRWEVT_ACTIONPERFORMED; } +hidspecial UID_BRWEVT_ADJUSTMENTVALUECHANGED { HelpId = UID_BRWEVT_ADJUSTMENTVALUECHANGED; } +hidspecial UID_BRWEVT_AFTERUPDATE { HelpId = UID_BRWEVT_AFTERUPDATE; } +hidspecial UID_BRWEVT_APPROVEACTIONPERFORMED { HelpId = UID_BRWEVT_APPROVEACTIONPERFORMED; } +hidspecial UID_BRWEVT_APPROVEPARAMETER { HelpId = UID_BRWEVT_APPROVEPARAMETER; } +hidspecial UID_BRWEVT_APPROVERESETTED { HelpId = UID_BRWEVT_APPROVERESETTED; } +hidspecial UID_BRWEVT_APPROVEROWCHANGE { HelpId = UID_BRWEVT_APPROVEROWCHANGE; } +hidspecial UID_BRWEVT_BEFOREUPDATE { HelpId = UID_BRWEVT_BEFOREUPDATE; } +hidspecial UID_BRWEVT_CHANGED { HelpId = UID_BRWEVT_CHANGED; } +hidspecial UID_BRWEVT_CONFIRMDELETE { HelpId = UID_BRWEVT_CONFIRMDELETE; } +hidspecial UID_BRWEVT_ERROROCCURED { HelpId = UID_BRWEVT_ERROROCCURED; } +hidspecial UID_BRWEVT_FOCUSGAINED { HelpId = UID_BRWEVT_FOCUSGAINED; } +hidspecial UID_BRWEVT_FOCUSLOST { HelpId = UID_BRWEVT_FOCUSLOST; } +hidspecial UID_BRWEVT_ITEMSTATECHANGED { HelpId = UID_BRWEVT_ITEMSTATECHANGED; } +hidspecial UID_BRWEVT_KEYTYPED { HelpId = UID_BRWEVT_KEYTYPED; } +hidspecial UID_BRWEVT_KEYUP { HelpId = UID_BRWEVT_KEYUP; } +hidspecial UID_BRWEVT_LOADED { HelpId = UID_BRWEVT_LOADED; } +hidspecial UID_BRWEVT_MOUSEDRAGGED { HelpId = UID_BRWEVT_MOUSEDRAGGED; } +hidspecial UID_BRWEVT_MOUSEENTERED { HelpId = UID_BRWEVT_MOUSEENTERED; } +hidspecial UID_BRWEVT_MOUSEEXITED { HelpId = UID_BRWEVT_MOUSEEXITED; } +hidspecial UID_BRWEVT_MOUSEMOVED { HelpId = UID_BRWEVT_MOUSEMOVED; } +hidspecial UID_BRWEVT_MOUSEPRESSED { HelpId = UID_BRWEVT_MOUSEPRESSED; } +hidspecial UID_BRWEVT_MOUSERELEASED { HelpId = UID_BRWEVT_MOUSERELEASED; } +hidspecial UID_BRWEVT_POSITIONED { HelpId = UID_BRWEVT_POSITIONED; } +hidspecial UID_BRWEVT_POSITIONING { HelpId = UID_BRWEVT_POSITIONING; } +hidspecial UID_BRWEVT_RELOADED { HelpId = UID_BRWEVT_RELOADED; } +hidspecial UID_BRWEVT_RELOADING { HelpId = UID_BRWEVT_RELOADING; } +hidspecial UID_BRWEVT_RESETTED { HelpId = UID_BRWEVT_RESETTED; } +hidspecial UID_BRWEVT_ROWCHANGE { HelpId = UID_BRWEVT_ROWCHANGE; } +hidspecial UID_BRWEVT_SUBMITTED { HelpId = UID_BRWEVT_SUBMITTED; } +hidspecial UID_BRWEVT_TEXTCHANGED { HelpId = UID_BRWEVT_TEXTCHANGED; } +hidspecial UID_BRWEVT_UNLOADED { HelpId = UID_BRWEVT_UNLOADED; } +hidspecial UID_BRWEVT_UNLOADING { HelpId = UID_BRWEVT_UNLOADING; } + +hidspecial UID_DBIWIZARD_FORMS { HelpId = UID_DBIWIZARD_FORMS; } +hidspecial UID_DBIWIZARD_FORMS_SAVETO { HelpId = UID_DBIWIZARD_FORMS_SAVETO; } +hidspecial UID_DBIWIZARD_HELP { HelpId = UID_DBIWIZARD_HELP; } +hidspecial UID_DBIWIZARD_QUERIES { HelpId = UID_DBIWIZARD_QUERIES; } +hidspecial UID_DBIWIZARD_SOURCEFILE { HelpId = UID_DBIWIZARD_SOURCEFILE; } +hidspecial UID_DBIWIZARD_SOURCESTATS { HelpId = UID_DBIWIZARD_SOURCESTATS; } + +hidspecial UID_EVT_MACRODLG { HelpId = UID_EVT_MACRODLG; } + +hidspecial UID_FIELDLINK_DETAIL1 { HelpId = UID_FIELDLINK_DETAIL1; } +hidspecial UID_FIELDLINK_DETAIL2 { HelpId = UID_FIELDLINK_DETAIL2; } +hidspecial UID_FIELDLINK_DETAIL3 { HelpId = UID_FIELDLINK_DETAIL3; } +hidspecial UID_FIELDLINK_DETAIL4 { HelpId = UID_FIELDLINK_DETAIL4; } +hidspecial UID_FIELDLINK_MASTER1 { HelpId = UID_FIELDLINK_MASTER1; } +hidspecial UID_FIELDLINK_MASTER2 { HelpId = UID_FIELDLINK_MASTER2; } +hidspecial UID_FIELDLINK_MASTER3 { HelpId = UID_FIELDLINK_MASTER3; } +hidspecial UID_FIELDLINK_MASTER4 { HelpId = UID_FIELDLINK_MASTER4; } + +hidspecial UID_PROP_ADD_DATA_TYPE { HelpId = UID_PROP_ADD_DATA_TYPE; } +hidspecial UID_PROP_DLG_ATTR_DATASOURCE { HelpId = UID_PROP_DLG_ATTR_DATASOURCE; } +hidspecial UID_PROP_DLG_ATTR_DATASOURCE { HelpId = UID_PROP_DLG_ATTR_DATASOURCE; } +hidspecial UID_PROP_DLG_ATTR_TARGET_URL { HelpId = UID_PROP_DLG_ATTR_TARGET_URL; } +hidspecial UID_PROP_DLG_ATTR_TARGET_URL { HelpId = UID_PROP_DLG_ATTR_TARGET_URL; } +hidspecial UID_PROP_DLG_BACKGROUNDCOLOR { HelpId = UID_PROP_DLG_BACKGROUNDCOLOR; } +hidspecial UID_PROP_DLG_BACKGROUNDCOLOR { HelpId = UID_PROP_DLG_BACKGROUNDCOLOR; } +hidspecial UID_PROP_DLG_BIND_EXPRESSION { HelpId = UID_PROP_DLG_BIND_EXPRESSION; } +hidspecial UID_PROP_DLG_BORDERCOLOR { HelpId = UID_PROP_DLG_BORDERCOLOR; } +hidspecial UID_PROP_DLG_CONTROLLABEL { HelpId = UID_PROP_DLG_CONTROLLABEL; } +hidspecial UID_PROP_DLG_CONTROLLABEL { HelpId = UID_PROP_DLG_CONTROLLABEL; } +hidspecial UID_PROP_DLG_FILLCOLOR { HelpId = UID_PROP_DLG_FILLCOLOR; } +hidspecial UID_PROP_DLG_FILLCOLOR { HelpId = UID_PROP_DLG_FILLCOLOR; } +hidspecial UID_PROP_DLG_FILTER { HelpId = UID_PROP_DLG_FILTER; } +hidspecial UID_PROP_DLG_FONT_TYPE { HelpId = UID_PROP_DLG_FONT_TYPE; } +hidspecial UID_PROP_DLG_FONT_TYPE { HelpId = UID_PROP_DLG_FONT_TYPE; } +hidspecial UID_PROP_DLG_FORMLINKFIELDS { HelpId = UID_PROP_DLG_FORMLINKFIELDS; } +hidspecial UID_PROP_DLG_IMAGE_URL { HelpId = UID_PROP_DLG_IMAGE_URL; } +hidspecial UID_PROP_DLG_IMAGE_URL { HelpId = UID_PROP_DLG_IMAGE_URL; } +hidspecial UID_PROP_DLG_NUMBER_FORMAT { HelpId = UID_PROP_DLG_NUMBER_FORMAT; } +hidspecial UID_PROP_DLG_NUMBER_FORMAT { HelpId = UID_PROP_DLG_NUMBER_FORMAT; } +hidspecial UID_PROP_DLG_ORDER { HelpId = UID_PROP_DLG_ORDER; } +hidspecial UID_PROP_DLG_SELECTION { HelpId = UID_PROP_DLG_SELECTION; } +hidspecial UID_PROP_DLG_SQLCOMMAND { HelpId = UID_PROP_DLG_SQLCOMMAND; } +hidspecial UID_PROP_DLG_SYMBOLCOLOR { HelpId = UID_PROP_DLG_SYMBOLCOLOR; } +hidspecial UID_PROP_DLG_TABINDEX { HelpId = UID_PROP_DLG_TABINDEX; } +hidspecial UID_PROP_DLG_XSD_CALCULATION { HelpId = UID_PROP_DLG_XSD_CALCULATION; } +hidspecial UID_PROP_DLG_XSD_CONSTRAINT { HelpId = UID_PROP_DLG_XSD_CONSTRAINT; } +hidspecial UID_PROP_DLG_XSD_READONLY { HelpId = UID_PROP_DLG_XSD_READONLY; } +hidspecial UID_PROP_DLG_XSD_RELEVANT { HelpId = UID_PROP_DLG_XSD_RELEVANT; } +hidspecial UID_PROP_DLG_XSD_REQUIRED { HelpId = UID_PROP_DLG_XSD_REQUIRED; } +hidspecial UID_PROP_REMOVE_DATA_TYPE { HelpId = UID_PROP_REMOVE_DATA_TYPE; } diff --git a/forms/qa/integration/forms/TestSkeleton.java b/forms/qa/integration/forms/TestSkeleton.java index f16083664cbe..8f2765b3a6d5 100644 --- a/forms/qa/integration/forms/TestSkeleton.java +++ b/forms/qa/integration/forms/TestSkeleton.java @@ -6,9 +6,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: TestSkeleton.java,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -29,61 +26,50 @@ ************************************************************************/ package integration.forms; -import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.Exception; -import com.sun.star.lang.XMultiServiceFactory; - -import com.sun.star.util.XCloseable; - -import integration.forms.DocumentHelper; - -public class TestSkeleton extends complexlib.ComplexTestCase +public class TestSkeleton extends TestCase { - private DocumentHelper m_document; - private FormLayer m_formLayer; - private XMultiServiceFactory m_orb; - - /** Creates a new instance of ValueBinding */ + /** Creates a new instance of TestSkeleton */ public TestSkeleton() { + super( DocumentType.WRITER ); } /* ------------------------------------------------------------------ */ public String[] getTestMethodNames() { return new String[] { - "checkSomething" + "checkTestSkeleton" }; } /* ------------------------------------------------------------------ */ public String getTestObjectName() { - return "Form Control Spreadsheet Cell Binding Test"; + return "Test Skeleton"; } /* ------------------------------------------------------------------ */ - public void before() throws com.sun.star.uno.Exception, java.lang.Exception + public void checkTestSkeleton() throws com.sun.star.uno.Exception, java.lang.Exception { - m_orb = (XMultiServiceFactory)param.getMSF(); - m_document = DocumentHelper.blankTextDocument( m_orb ); - m_formLayer = new FormLayer( m_document ); } /* ------------------------------------------------------------------ */ - public void after() throws com.sun.star.uno.Exception, java.lang.Exception + public void before() throws Exception, java.lang.Exception { - // close our document - if ( m_document != null ) - { - XCloseable closeDoc = (XCloseable)UnoRuntime.queryInterface( XCloseable.class, - m_document.getDocument() ); - closeDoc.close( true ); - } + super.before(); } /* ------------------------------------------------------------------ */ - public void checkSomething() throws com.sun.star.uno.Exception, java.lang.Exception + public void after() throws Exception, java.lang.Exception { + super.before(); } -} + + /* ------------------------------------------------------------------ */ + protected void prepareDocument() throws com.sun.star.uno.Exception, java.lang.Exception + { + super.prepareDocument(); + } + } diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index ed3e85a905ec..23c05be9f89f 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -2151,9 +2151,9 @@ sal_Bool OBoundControlModel::connectToField(const Reference& rForm) try { + sal_Int32 nFieldType = DataType::OTHER; if ( xFieldCandidate.is() ) { - sal_Int32 nFieldType = 0; xFieldCandidate->getPropertyValue( PROPERTY_FIELDTYPE ) >>= nFieldType; if ( approveDbColumnType( nFieldType ) ) impl_setField_noNotify( xFieldCandidate ); @@ -2165,6 +2165,8 @@ sal_Bool OBoundControlModel::connectToField(const Reference& rForm) { if( m_xField->getPropertySetInfo()->hasPropertyByName( PROPERTY_VALUE ) ) { + m_nFieldType = nFieldType; + // an wertaenderungen horchen m_xField->addPropertyChangeListener( PROPERTY_VALUE, this ); m_xColumnUpdate = Reference< XColumnUpdate >( m_xField, UNO_QUERY );