Sandbox-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- 1825 discussions
r388 - in testTreeTooltipSession/trunk/src/main/java/org/nuiton/test: . resources table tree
by echatellier@users.nuiton.org 05 Mar '10
by echatellier@users.nuiton.org 05 Mar '10
05 Mar '10
Author: echatellier
Date: 2010-03-05 10:09:13 +0100 (Fri, 05 Mar 2010)
New Revision: 388
Log:
Use SAF framework without modification.
Added:
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/MainPanel.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/MyApplication.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/MyApplication.properties
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/table/
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/table/BasicTableModel.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/table/BasicTableRenderer.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/tree/
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/tree/BasicTreeModel.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/tree/CustomTreeFilter.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/tree/TreeFilter.java
Removed:
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTableModel.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTreeModel.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/CustomTreeFilter.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/Main.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/TreeFilter.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/MainApplication.properties
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/saf/
Deleted: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTableModel.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTableModel.java 2010-03-04 16:06:40 UTC (rev 387)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTableModel.java 2010-03-05 09:09:13 UTC (rev 388)
@@ -1,128 +0,0 @@
-/* *
- * Copyright (C) 2010 ceric35
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- **/
-package org.nuiton.test;
-
-import java.io.File;
-
-import javax.swing.event.TreeModelListener;
-import javax.swing.table.AbstractTableModel;
-import javax.swing.tree.TreeModel;
-import javax.swing.tree.TreePath;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.views.AbstractView;
-
-/**
- * BasicTableModel
- *
- * TODO ADD COMMENT HERE !
- *
- * @author ceric35
- * Date : 4 mars 2010
- */
-public class BasicTableModel extends AbstractTableModel {
-
- /** Logger */
- private static Logger logger = LoggerFactory.getLogger(BasicTableModel.class);
-
- protected File root;
-
- protected File[] children;
-
- public BasicTableModel(File rootFile) {
- this.root = rootFile;
- children = root.listFiles();
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
- */
- public Object getChild(Object parent, int index) {
-
- File parentFile = (File)parent;
- File[] children = parentFile.listFiles();
- return children[index];
- }
-
- /*
- * @see javax.swing.table.TableModel#getRowCount()
- */
- @Override
- public int getRowCount() {
- return children.length;
- }
-
- /*
- * @see javax.swing.table.TableModel#getColumnCount()
- */
- @Override
- public int getColumnCount() {
- return 2;
- }
-
-
- /*
- * @see javax.swing.table.AbstractTableModel#getColumnName(int)
- */
- @Override
- public String getColumnName(int column) {
- String result = "n/a";
-
- switch (column) {
- case 0: result = "File"; break;
- case 1: result = "Size"; break;
- }
-
- return result;
- }
-
- /*
- * @see javax.swing.table.AbstractTableModel#getColumnClass(int)
- */
- @Override
- public Class<?> getColumnClass(int columnIndex) {
- Class<?> result = null;
-
- switch (columnIndex) {
- case 0: result = String.class; break;
- case 1: result = Long.class; break;
- }
-
- return result;
- }
-
- /*
- * @see javax.swing.table.TableModel#getValueAt(int, int)
- */
- @Override
- public Object getValueAt(int rowIndex, int columnIndex) {
-
- Object result = null;
- File f = children[rowIndex];
- switch (columnIndex) {
- case 0: result = f.getAbsolutePath(); break;
- case 1: result = f.length(); break;
- }
-
- return result;
- }
-
-
-
-}
Deleted: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTreeModel.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTreeModel.java 2010-03-04 16:06:40 UTC (rev 387)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTreeModel.java 2010-03-05 09:09:13 UTC (rev 388)
@@ -1,119 +0,0 @@
-/* *
- * Copyright (C) 2010 ceric35
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- **/
-package org.nuiton.test;
-
-import java.io.File;
-
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.TreeModel;
-import javax.swing.tree.TreePath;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * BasicTreeModel
- *
- * TODO ADD COMMENT HERE !
- *
- * @author ceric35
- * Date : 4 mars 2010
- */
-public class BasicTreeModel implements TreeModel {
-
- /** Logger */
- private static Logger logger = LoggerFactory.getLogger(BasicTreeModel.class);
-
- protected File root;
-
- public BasicTreeModel(File rootFile) {
- this.root = rootFile;
- }
-
- /* @see javax.swing.tree.TreeModel#getRoot()
- */
- @Override
- public Object getRoot() {
- return root;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
- */
- @Override
- public Object getChild(Object parent, int index) {
-
- File parentFile = (File)parent;
- File[] children = parentFile.listFiles();
- return children[index];
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeModel#getChildCount(java.lang.Object)
- */
- @Override
- public int getChildCount(Object parent) {
- File parentFile = (File)parent;
- File[] children = parentFile.listFiles();
- return children == null ? 0 : children.length;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeModel#isLeaf(java.lang.Object)
- */
- @Override
- public boolean isLeaf(Object node) {
- return getChildCount(node) == 0;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeModel#valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object)
- */
- @Override
- public void valueForPathChanged(TreePath path, Object newValue) {
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeModel#getIndexOfChild(java.lang.Object, java.lang.Object)
- */
- @Override
- public int getIndexOfChild(Object parent, Object child) {
- return 0;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeModel#addTreeModelListener(javax.swing.event.TreeModelListener)
- */
- @Override
- public void addTreeModelListener(TreeModelListener l) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeModel#removeTreeModelListener(javax.swing.event.TreeModelListener)
- */
- @Override
- public void removeTreeModelListener(TreeModelListener l) {
- // TODO Auto-generated method stub
-
- }
-
-
-}
Deleted: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/CustomTreeFilter.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/CustomTreeFilter.java 2010-03-04 16:06:40 UTC (rev 387)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/CustomTreeFilter.java 2010-03-05 09:09:13 UTC (rev 388)
@@ -1,36 +0,0 @@
-/* *
- * Copyright (C) 2010 ceric35
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- **/
-package org.nuiton.test;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * CustomTreeFilter
- *
- * TODO ADD COMMENT HERE !
- *
- * @author ceric35
- * Date : 4 mars 2010
- */
-public class CustomTreeFilter {
-
- /** Logger */
- private static Logger logger = LoggerFactory.getLogger(Main.class);
-
-}
Deleted: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/Main.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/Main.java 2010-03-04 16:06:40 UTC (rev 387)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/Main.java 2010-03-05 09:09:13 UTC (rev 388)
@@ -1,200 +0,0 @@
-/* *
- * Copyright (C) 2010 ceric35
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- **/
-package org.nuiton.test;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.Window;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.io.File;
-import java.io.IOException;
-
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JSplitPane;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.JToolTip;
-import javax.swing.JTree;
-
-import net.java.balloontip.BalloonTip;
-import net.java.balloontip.styles.RoundedBalloonStyle;
-import net.java.balloontip.utils.ToolTipUtils;
-
-import org.jdesktop.application.SessionStorage;
-import org.nuiton.test.saf.SafApplicationContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.xduke.xswing.DataTipManager;
-
-/**
- * Main
- *
- * @author ceric35
- * Date : 4 mars 2010
- */
-public class Main extends JFrame {
-
- /** Logger */
- private static Logger logger = LoggerFactory.getLogger(Main.class);
-
- public Main() throws IOException {
-
- // label filter
- JPanel leftPanel = new JPanel(new GridBagLayout());
- JLabel filterLabel = new JLabel("Filtre : ");
- leftPanel.add(filterLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0,
- GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
- new Insets(2, 2, 2, 2), 0, 0));
-
- // field filter
- JTextField filterField = new JTextField();
- leftPanel.add(filterField, new GridBagConstraints(1, 0, 1, 1, 1, 0,
- GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
- new Insets(2, 2, 2, 2), 0, 0));
-
- // tree
- BasicTreeModel treeModel = new BasicTreeModel(new File(".")
- .getCanonicalFile());
- JTree tree = new JTree(treeModel);
- tree.setName("tree");
- leftPanel.add(new JScrollPane(tree), new GridBagConstraints(0, 1, 2, 1,
- 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
- new Insets(2, 2, 2, 2), 0, 0));
- DataTipManager.get().register(tree);
-
- JPanel rigthPanel = new JPanel(new GridBagLayout());
- // label tootip
- JLabel testToottip = new JLabel("Over me !!!!!") {
- @Override
- public JToolTip createToolTip() {
- JToolTip tt = new JToolTip();
- /*BalloonTip bt = new BalloonTip(this, this.getToolTipText(), new RoundedBalloonStyle(5,5,Color.WHITE, Color.BLACK), false);
- bt.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent e) {
-
- BalloonTip source = (BalloonTip)e.getSource();
- source.closeBalloon();
-
- BalloonTip bt = new BalloonTip(source, source.getToolTipText(), new RoundedBalloonStyle(5,5,Color.WHITE, Color.BLACK), true);
- bt.setVisible(true);
- }
-
- });
- //ToolTipUtils.balloonToToolTip(bt, 500, 3000);
- tt.setComponent(this);*/
- return tt;
- }
- };
- testToottip.setToolTipText("Alors ?");
-
- BalloonTip bt = new BalloonTip(testToottip, testToottip
- .getToolTipText(), new RoundedBalloonStyle(5, 5, Color.WHITE,
- Color.BLACK), false);
- bt.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent e) {
- logger.debug("Called");
- BalloonTip source = (BalloonTip) e.getSource();
- source.setVisible(false);
- source.setEnabled(false);
- BalloonTip bt = new BalloonTip(
- source.getAttachedComponent(),
- source.getAttachedComponent().getToolTipText(),
- new RoundedBalloonStyle(5, 5, Color.WHITE, Color.BLACK),
- true);
- bt.setVisible(true);
- }
- });
- ToolTipUtils.balloonToToolTip(bt, 500, 3000);
- rigthPanel.add(testToottip, new GridBagConstraints(0, 0, 1, 1, 1, 0,
- GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(
- 2, 2, 2, 2), 0, 0));
-
- // table
- BasicTableModel tableModel = new BasicTableModel(new File(".")
- .getCanonicalFile());
- JTable table = new JTable(tableModel);
- table.setName("table");
- rigthPanel.add(new JScrollPane(table), new GridBagConstraints(0, 1, 1,
- 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
- new Insets(2, 2, 2, 2), 0, 0));
- DataTipManager.get().register(table);
-
- // end UI
-
- JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, rigthPanel);
- pane.setName("mainViewPane");
-
- add(pane);
- }
-
- public static void main(String[] args) throws IOException {
- final Main m = new Main();
- m.setName("mainFrame");
-
- // centering
- centerWindow(m);
-
- SafApplicationContext context = new SafApplicationContext();
- final SessionStorage sessionStorage = context.getSessionStorage();
- sessionStorage.restore(m, m.getName() + "-session.xml");
-
- m.addWindowListener(new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- try {
- sessionStorage.save(m, m.getName() + "-session.xml");
- System.exit(0);
- } catch (IOException ex) {
- logger.error("Can't save frame session", ex);
- }
- }
- });
- m.setVisible(true);
- }
-
- protected static void centerWindow(Window root) {
- // If the window's bounds don't appear to have been set, do it
- if (root instanceof Window) {
- Window window = (Window) root;
- if (!root.isValid() || (root.getWidth() == 0)
- || (root.getHeight() == 0)) {
- window.pack();
- }
- if (!window.isLocationByPlatform() && (root.getX() == 0)
- && (root.getY() == 0)) {
- Component owner = window.getOwner();
- //if (owner == null) {
- // owner = (window != mainFrame) ? mainFrame : null;
- //}
- window.setLocationRelativeTo(owner); // center the window
- }
- }
- }
-}
Copied: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/MainPanel.java (from rev 387, testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/Main.java)
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/MainPanel.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/MainPanel.java 2010-03-05 09:09:13 UTC (rev 388)
@@ -0,0 +1,211 @@
+/* *
+ * Copyright (C) 2010 ceric35
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ **/
+package org.nuiton.test;
+
+import java.awt.Color;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.io.File;
+import java.io.IOException;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JToolTip;
+import javax.swing.JTree;
+
+import net.java.balloontip.BalloonTip;
+import net.java.balloontip.styles.RoundedBalloonStyle;
+import net.java.balloontip.utils.ToolTipUtils;
+
+import org.nuiton.test.table.BasicTableModel;
+import org.nuiton.test.table.BasicTableRenderer;
+import org.nuiton.test.tree.BasicTreeModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.xduke.xswing.DataTipManager;
+
+/**
+ * Main
+ *
+ * @author ceric35
+ * Date : 4 mars 2010
+ */
+public class MainPanel extends JPanel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -4867848058485235754L;
+
+ /** Logger */
+ private static Logger logger = LoggerFactory.getLogger(MainPanel.class);
+
+ public MainPanel() {
+
+ // label filter
+ JPanel leftPanel = new JPanel(new GridBagLayout());
+ JLabel filterLabel = new JLabel("Filtre : ");
+ leftPanel.add(filterLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0,
+ GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
+ new Insets(2, 2, 2, 2), 0, 0));
+
+ // field filter
+ JTextField filterField = new JTextField();
+ leftPanel.add(filterField, new GridBagConstraints(1, 0, 1, 1, 1, 0,
+ GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
+ new Insets(2, 2, 2, 2), 0, 0));
+
+ // tree
+ try {
+ BasicTreeModel treeModel = new BasicTreeModel(new File(".")
+ .getCanonicalFile());
+
+ JTree tree = new JTree(treeModel);
+ tree.setName("tree");
+ leftPanel.add(new JScrollPane(tree), new GridBagConstraints(0, 1, 2, 1,
+ 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+ new Insets(2, 2, 2, 2), 0, 0));
+ DataTipManager.get().register(tree);
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+
+ JPanel rigthPanel = new JPanel(new GridBagLayout());
+ // label tootip
+ JLabel testToottip = new JLabel("Over me !!!!!") {
+ @Override
+ public JToolTip createToolTip() {
+ JToolTip tt = new JToolTip();
+ /*BalloonTip bt = new BalloonTip(this, this.getToolTipText(), new RoundedBalloonStyle(5,5,Color.WHITE, Color.BLACK), false);
+ bt.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent e) {
+
+ BalloonTip source = (BalloonTip)e.getSource();
+ source.closeBalloon();
+
+ BalloonTip bt = new BalloonTip(source, source.getToolTipText(), new RoundedBalloonStyle(5,5,Color.WHITE, Color.BLACK), true);
+ bt.setVisible(true);
+ }
+
+ });
+ //ToolTipUtils.balloonToToolTip(bt, 500, 3000);
+ tt.setComponent(this);*/
+ return tt;
+ }
+ };
+ testToottip.setToolTipText("Alors ?");
+
+ BalloonTip bt = new BalloonTip(testToottip, testToottip
+ .getToolTipText(), new RoundedBalloonStyle(5, 5, Color.WHITE,
+ Color.BLACK), false);
+ bt.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ logger.debug("Called");
+ BalloonTip source = (BalloonTip) e.getSource();
+ source.setVisible(false);
+ source.setEnabled(false);
+ BalloonTip bt = new BalloonTip(
+ source.getAttachedComponent(),
+ source.getAttachedComponent().getToolTipText(),
+ new RoundedBalloonStyle(5, 5, Color.WHITE, Color.BLACK),
+ true);
+ bt.setVisible(true);
+ }
+ });
+ ToolTipUtils.balloonToToolTip(bt, 500, 3000);
+ rigthPanel.add(testToottip, new GridBagConstraints(0, 0, 1, 1, 1, 0,
+ GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(
+ 2, 2, 2, 2), 0, 0));
+
+ // table
+ try {
+ BasicTableModel tableModel = new BasicTableModel(new File(".")
+ .getCanonicalFile());
+
+ JTable table = new JTable(tableModel);
+ table.setDefaultRenderer(String.class, new BasicTableRenderer());
+ table.setName("table");
+ rigthPanel.add(new JScrollPane(table), new GridBagConstraints(0, 1, 1,
+ 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+ new Insets(2, 2, 2, 2), 0, 0));
+
+ DataTipManager.get().register(table);
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+
+ // end UI
+
+ JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, rigthPanel);
+ pane.setName("mainViewPane");
+
+ add(pane);
+ }
+
+ /*public static void main(String[] args) {
+ final MainFrame m = new MainFrame();
+ m.setName("mainFrame");
+
+ // centering
+ centerWindow(m);
+
+ SafApplicationContext context = new SafApplicationContext();
+ final SessionStorage sessionStorage = context.getSessionStorage();
+ sessionStorage.restore(m, m.getName() + ".session.xml");
+
+ m.addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent e) {
+ try {
+ sessionStorage.save(m, m.getName() + ".session.xml");
+ System.exit(0);
+ } catch (IOException ex) {
+ logger.error("Can't save frame session", ex);
+ }
+ }
+ });
+ m.setVisible(true);
+ }
+
+ protected static void centerWindow(Window root) {
+ // If the window's bounds don't appear to have been set, do it
+ if (root instanceof Window) {
+ Window window = (Window) root;
+ if (!root.isValid() || (root.getWidth() == 0)
+ || (root.getHeight() == 0)) {
+ window.pack();
+ }
+ if (!window.isLocationByPlatform() && (root.getX() == 0)
+ && (root.getY() == 0)) {
+ Component owner = window.getOwner();
+ //if (owner == null) {
+ // owner = (window != mainFrame) ? mainFrame : null;
+ //}
+ window.setLocationRelativeTo(owner); // center the window
+ }
+ }
+ }*/
+}
Added: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/MyApplication.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/MyApplication.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/MyApplication.java 2010-03-05 09:09:13 UTC (rev 388)
@@ -0,0 +1,47 @@
+/* *##%
+ * Copyright (C) 2010 Code Lutin, Chatellier Eric
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package org.nuiton.test;
+
+import org.jdesktop.application.SingleFrameApplication;
+
+/**
+ * TODO add comment here.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class MyApplication extends SingleFrameApplication {
+
+ public static void main(String args[]) {
+ launch(MyApplication.class, args);
+ }
+
+ /*
+ * @see org.jdesktop.application.Application#startup()
+ */
+ @Override
+ protected void startup() {
+ super.getMainFrame().setName("mainFrame");
+ show(new MainPanel());
+ }
+
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/MyApplication.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Deleted: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/TreeFilter.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/TreeFilter.java 2010-03-04 16:06:40 UTC (rev 387)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/TreeFilter.java 2010-03-05 09:09:13 UTC (rev 388)
@@ -1,31 +0,0 @@
-/* *
- * Copyright (C) 2010 ceric35
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- **/
-package org.nuiton.test;
-
-/**
- * TreeFilter
- *
- * TODO ADD COMMENT HERE !
- *
- * @author ceric35
- * Date : 4 mars 2010
- */
-public interface TreeFilter {
-
- public boolean include(Object o);
-}
Deleted: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/MainApplication.properties
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/MainApplication.properties 2010-03-04 16:06:40 UTC (rev 387)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/MainApplication.properties 2010-03-05 09:09:13 UTC (rev 388)
@@ -1 +0,0 @@
-Application.id=testtesttest
\ No newline at end of file
Copied: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/MyApplication.properties (from rev 387, testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/MainApplication.properties)
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/MyApplication.properties (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/MyApplication.properties 2010-03-05 09:09:13 UTC (rev 388)
@@ -0,0 +1,4 @@
+Application.id = myapplication
+Application.title = My frame title
+Application.vendor = CodeLutin
+Application.vendorId = codelutin
Copied: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/table/BasicTableModel.java (from rev 387, testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTableModel.java)
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/table/BasicTableModel.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/table/BasicTableModel.java 2010-03-05 09:09:13 UTC (rev 388)
@@ -0,0 +1,128 @@
+/* *
+ * Copyright (C) 2010 ceric35
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ **/
+package org.nuiton.test.table;
+
+import java.io.File;
+
+import javax.swing.event.TreeModelListener;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.views.AbstractView;
+
+/**
+ * BasicTableModel
+ *
+ * TODO ADD COMMENT HERE !
+ *
+ * @author ceric35
+ * Date : 4 mars 2010
+ */
+public class BasicTableModel extends AbstractTableModel {
+
+ /** Logger */
+ private static Logger logger = LoggerFactory.getLogger(BasicTableModel.class);
+
+ protected File root;
+
+ protected File[] children;
+
+ public BasicTableModel(File rootFile) {
+ this.root = rootFile;
+ children = root.listFiles();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
+ */
+ public Object getChild(Object parent, int index) {
+
+ File parentFile = (File)parent;
+ File[] children = parentFile.listFiles();
+ return children[index];
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getRowCount()
+ */
+ @Override
+ public int getRowCount() {
+ return children.length;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getColumnCount()
+ */
+ @Override
+ public int getColumnCount() {
+ return 2;
+ }
+
+
+ /*
+ * @see javax.swing.table.AbstractTableModel#getColumnName(int)
+ */
+ @Override
+ public String getColumnName(int column) {
+ String result = "n/a";
+
+ switch (column) {
+ case 0: result = "File"; break;
+ case 1: result = "Size"; break;
+ }
+
+ return result;
+ }
+
+ /*
+ * @see javax.swing.table.AbstractTableModel#getColumnClass(int)
+ */
+ @Override
+ public Class<?> getColumnClass(int columnIndex) {
+ Class<?> result = null;
+
+ switch (columnIndex) {
+ case 0: result = String.class; break;
+ case 1: result = Long.class; break;
+ }
+
+ return result;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getValueAt(int, int)
+ */
+ @Override
+ public Object getValueAt(int rowIndex, int columnIndex) {
+
+ Object result = null;
+ File f = children[rowIndex];
+ switch (columnIndex) {
+ case 0: result = f.getAbsolutePath(); break;
+ case 1: result = f.length(); break;
+ }
+
+ return result;
+ }
+
+
+
+}
Added: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/table/BasicTableRenderer.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/table/BasicTableRenderer.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/table/BasicTableRenderer.java 2010-03-05 09:09:13 UTC (rev 388)
@@ -0,0 +1,122 @@
+/* *##%
+ * Copyright (C) 2010 Code Lutin, Chatellier Eric
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package org.nuiton.test.table;
+
+import java.awt.Component;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+
+import javax.swing.JComponent;
+import javax.swing.JTable;
+import javax.swing.table.DefaultTableCellRenderer;
+
+/**
+ * TODO add comment here.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class BasicTableRenderer extends DefaultTableCellRenderer implements MouseListener {
+
+ /*
+ * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int)
+ */
+ @Override
+ public Component getTableCellRendererComponent(final JTable table, Object value,
+ boolean isSelected, boolean hasFocus, final int row, final int column) {
+
+ JComponent c = (JComponent)super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+
+ /*JLabel b = new JLabel(value.toString()) {
+ @Override
+ public JToolTip createToolTip() {
+ JToolTip tt = super.createToolTip();
+
+ //TablecellBalloonTip tip = new TablecellBalloonTip(table, "etst", row, column, new RoundedBalloonStyle(5,5
+ // , Color.WHITE, Color.BLACK), Orientation.RIGHT_ABOVE, AttachLocation.ALIGNED, 5, 5, true);
+ BalloonTip bt = new BalloonTip(this, this.getToolTipText(), new RoundedBalloonStyle(5,5,Color.WHITE, Color.BLACK), false);
+ /*bt.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent e) {
+
+ BalloonTip source = (BalloonTip)e.getSource();
+ source.closeBalloon();
+
+ BalloonTip bt = new BalloonTip(source, source.getToolTipText(), new RoundedBalloonStyle(5,5,Color.WHITE, Color.BLACK), true);
+ bt.setVisible(true);
+ }
+
+ });
+ ToolTipUtils.balloonToToolTip(bt, 500, 3000);
+ tt.setComponent(bt);
+
+ return tt;
+ }
+ };
+ b.setToolTipText("Tooltip = " + value.toString());*/
+
+ this.addMouseListener(new BasicTableRenderer());
+
+ return this;
+ }
+
+ /*
+ * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
+ */
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ System.out.println("mouseClicked");
+ }
+
+ /*
+ * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
+ */
+ @Override
+ public void mousePressed(MouseEvent e) {
+ System.out.println("mousePressed");
+ }
+
+ /*
+ * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
+ */
+ @Override
+ public void mouseReleased(MouseEvent e) {
+ System.out.println("mouseReleased");
+ }
+
+ /*
+ * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
+ */
+ @Override
+ public void mouseEntered(MouseEvent e) {
+ System.out.println("mouseEntered");
+ }
+
+ /*
+ * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
+ */
+ @Override
+ public void mouseExited(MouseEvent e) {
+ System.out.println("mouseExited");
+ }
+
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/table/BasicTableRenderer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Copied: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/tree/BasicTreeModel.java (from rev 387, testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTreeModel.java)
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/tree/BasicTreeModel.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/tree/BasicTreeModel.java 2010-03-05 09:09:13 UTC (rev 388)
@@ -0,0 +1,119 @@
+/* *
+ * Copyright (C) 2010 ceric35
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ **/
+package org.nuiton.test.tree;
+
+import java.io.File;
+
+import javax.swing.event.TreeModelListener;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * BasicTreeModel
+ *
+ * TODO ADD COMMENT HERE !
+ *
+ * @author ceric35
+ * Date : 4 mars 2010
+ */
+public class BasicTreeModel implements TreeModel {
+
+ /** Logger */
+ private static Logger logger = LoggerFactory.getLogger(BasicTreeModel.class);
+
+ protected File root;
+
+ public BasicTreeModel(File rootFile) {
+ this.root = rootFile;
+ }
+
+ /* @see javax.swing.tree.TreeModel#getRoot()
+ */
+ @Override
+ public Object getRoot() {
+ return root;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
+ */
+ @Override
+ public Object getChild(Object parent, int index) {
+
+ File parentFile = (File)parent;
+ File[] children = parentFile.listFiles();
+ return children[index];
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#getChildCount(java.lang.Object)
+ */
+ @Override
+ public int getChildCount(Object parent) {
+ File parentFile = (File)parent;
+ File[] children = parentFile.listFiles();
+ return children == null ? 0 : children.length;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#isLeaf(java.lang.Object)
+ */
+ @Override
+ public boolean isLeaf(Object node) {
+ return getChildCount(node) == 0;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object)
+ */
+ @Override
+ public void valueForPathChanged(TreePath path, Object newValue) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#getIndexOfChild(java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public int getIndexOfChild(Object parent, Object child) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#addTreeModelListener(javax.swing.event.TreeModelListener)
+ */
+ @Override
+ public void addTreeModelListener(TreeModelListener l) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#removeTreeModelListener(javax.swing.event.TreeModelListener)
+ */
+ @Override
+ public void removeTreeModelListener(TreeModelListener l) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+}
Copied: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/tree/CustomTreeFilter.java (from rev 387, testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/CustomTreeFilter.java)
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/tree/CustomTreeFilter.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/tree/CustomTreeFilter.java 2010-03-05 09:09:13 UTC (rev 388)
@@ -0,0 +1,37 @@
+/* *
+ * Copyright (C) 2010 ceric35
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ **/
+package org.nuiton.test.tree;
+
+import org.nuiton.test.MainPanel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * CustomTreeFilter
+ *
+ * TODO ADD COMMENT HERE !
+ *
+ * @author ceric35
+ * Date : 4 mars 2010
+ */
+public class CustomTreeFilter {
+
+ /** Logger */
+ private static Logger logger = LoggerFactory.getLogger(MainPanel.class);
+
+}
Copied: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/tree/TreeFilter.java (from rev 387, testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/TreeFilter.java)
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/tree/TreeFilter.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/tree/TreeFilter.java 2010-03-05 09:09:13 UTC (rev 388)
@@ -0,0 +1,31 @@
+/* *
+ * Copyright (C) 2010 ceric35
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ **/
+package org.nuiton.test.tree;
+
+/**
+ * TreeFilter
+ *
+ * TODO ADD COMMENT HERE !
+ *
+ * @author ceric35
+ * Date : 4 mars 2010
+ */
+public interface TreeFilter {
+
+ public boolean include(Object o);
+}
1
0
r387 - in testTreeTooltipSession/trunk: . src src/main src/main/java src/main/java/com src/main/java/com/xduke src/main/java/com/xduke/xswing src/main/java/org src/main/java/org/nuiton src/main/java/org/nuiton/test src/main/java/org/nuiton/test/resources src/main/java/org/nuiton/test/saf
by echatellier@users.nuiton.org 04 Mar '10
by echatellier@users.nuiton.org 04 Mar '10
04 Mar '10
Author: echatellier
Date: 2010-03-04 17:06:40 +0100 (Thu, 04 Mar 2010)
New Revision: 387
Log:
Init commit.
Added:
testTreeTooltipSession/trunk/pom.xml
testTreeTooltipSession/trunk/src/
testTreeTooltipSession/trunk/src/main/
testTreeTooltipSession/trunk/src/main/java/
testTreeTooltipSession/trunk/src/main/java/com/
testTreeTooltipSession/trunk/src/main/java/com/xduke/
testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/
testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipCell.java
testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipComponent.java
testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipListener.java
testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipManager.java
testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipPopup.java
testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/ListDataTipCell.java
testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/ListDataTipListener.java
testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TableDataTipCell.java
testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TableDataTipListener.java
testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TreeDataTipCell.java
testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TreeDataTipListener.java
testTreeTooltipSession/trunk/src/main/java/org/
testTreeTooltipSession/trunk/src/main/java/org/nuiton/
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTableModel.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTreeModel.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/CustomTreeFilter.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/Main.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/TreeFilter.java
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/MainApplication.properties
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/saf/
testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/saf/SafApplicationContext.java
testTreeTooltipSession/trunk/src/main/resources/
Modified:
testTreeTooltipSession/trunk/
Property changes on: testTreeTooltipSession/trunk
___________________________________________________________________
Added: svn:ignore
+ .settings
target
.classpath
.project
Added: testTreeTooltipSession/trunk/pom.xml
===================================================================
--- testTreeTooltipSession/trunk/pom.xml (rev 0)
+++ testTreeTooltipSession/trunk/pom.xml 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.ceric35</groupId>
+ <artifactId>testtrees</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>TestTrees</name>
+ <description>TestTrees</description>
+ <inceptionYear>2010</inceptionYear>
+
+ <licenses>
+ <license>
+ <name>GPL</name>
+ <url>http://www.gnu.org/licenses/gpl.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <developers>
+ <developer>
+ <id>ceric35</id>
+ <name>Eric Chatellier</name>
+ <email>chatellier(a)codelutin.com</email>
+ <organization>CodeLutin</organization>
+ <timezone>+2</timezone>
+ <roles>
+ <role>Développeur</role>
+ </roles>
+ </developer>
+ </developers>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputDirectory>UTF-8</project.reporting.outputDirectory>
+ <maven.compiler.source>1.6</maven.compiler.source>
+ <maven.compiler.target>1.6</maven.compiler.target>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <mainClass>org.nuiton.test.Main</mainClass>
+ <classpathScope>runtime</classpathScope>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.11</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>0.9.18</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ <version>5.11</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.swinglabs</groupId>
+ <artifactId>swingx</artifactId>
+ <version>1.6</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.java.balloontip</groupId>
+ <artifactId>balloontip</artifactId>
+ <version>1.0</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jdesktop</groupId>
+ <artifactId>appframework</artifactId>
+ <version>1.0.3</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>nuiton.repository</id>
+ <url>http://maven.nuiton.org/release</url>
+ </repository>
+ <repository>
+ <id>jboss.repository</id>
+ <url>http://repository.jboss.com/maven2</url>
+ </repository>
+ <repository>
+ <id>maven2-repository.dev.java.net</id>
+ <url>http://download.java.net/maven/2/</url>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>nuiton.repository</id>
+ <url>http://maven.nuiton.org/release</url>
+ </pluginRepository>
+ </pluginRepositories>
+</project>
Added: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipCell.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipCell.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipCell.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2002 - 2005, Stephen Kelvin Friedrich. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this list
+ * of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice, this
+ * list of conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ * - Neither the name of the copyright holder nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.xduke.xswing;
+
+import java.awt.*;
+
+interface DataTipCell {
+
+ boolean isSet();
+
+ Component getRendererComponent();
+
+ Rectangle getCellBounds();
+
+ /**
+ * 'Null' value for cells (location is outside of any cell bounds).
+ */
+ DataTipCell NONE = new DataTipCell() {
+
+ public boolean isSet() {
+ return false;
+ }
+
+ public Component getRendererComponent() {
+ return null;
+ }
+
+ public Rectangle getCellBounds() {
+ return null;
+ }
+
+ public boolean equals(Object obj) {
+ return false;
+ }
+
+ public int hashCode() {
+ return 0;
+ }
+ };
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipCell.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipComponent.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipComponent.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipComponent.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2002 - 2005, Stephen Kelvin Friedrich. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this list
+ * of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice, this
+ * list of conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ * - Neither the name of the copyright holder nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.xduke.xswing;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseWheelEvent;
+
+/**
+ * Note: It's important to inherit from JToolTip: Mouse events get dispatched to the parent.<br/>
+ * I do not really know why this is so. At least PopupFactory creates a different type of popup
+ * if the content is instance of JToolTip.
+ */
+class DataTipComponent extends JToolTip {
+ private DataTipCell cell;
+ private CellRendererPane rendererPane;
+ private Rectangle withoutBorderRectangle;
+ private Color backgroundColor;
+ private boolean isHeavyWeight;
+
+ DataTipComponent(DataTipCell cell, Rectangle withoutBorderRectangle, Color backgroundColor) {
+ this.cell = cell;
+ this.withoutBorderRectangle = withoutBorderRectangle;
+ this.backgroundColor = backgroundColor;
+ rendererPane = new CellRendererPane();
+ add(rendererPane);
+ setFocusable(false);
+ setBorder(null);
+ enableEvents(AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_WHEEL_EVENT_MASK);
+ }
+
+ /**
+ * Overriden, so that Swing does not create a ToolTipUI.
+ */
+ public void updateUI() {
+ }
+
+ /**
+ * Overriden to always return false, so that no component ever receives mouse events.
+ * Instead a mouse press will be caught on the popup's window ancestor, the popup will be hidden and the mouse press redispatched
+ * to the underlying component.
+ */
+ public boolean contains(int x, int y) {
+ return isHeavyWeight;
+ }
+
+ protected void processMouseEvent(MouseEvent e) {
+ DataTipManager.get().handleEventFromDataTipComponent(e);
+ }
+
+ protected void processMouseMotionEvent(MouseEvent e) {
+ DataTipManager.get().handleEventFromDataTipComponent(e);
+ }
+
+ protected void processMouseWheelEvent(MouseWheelEvent e) {
+ DataTipManager.get().handleEventFromDataTipComponent(e);
+ }
+
+ public void paintComponent(Graphics g) {
+ Component component = cell.getRendererComponent();
+
+ // Leave the component's opacity settings as is, just paint the background myself.
+ // This seems to be the only viable solution: DefaultTableCellRenderer overrides isOpaque() and returns
+ // true only if renderer color does not equal parent color. The problem is that rendererPane.paintComponent()
+ // re-parents the renderer.
+ g.setColor(backgroundColor);
+ int width = getWidth();
+ int height = getHeight();
+ g.fillRect(0, 0, width, height);
+
+ g.setColor(Color.black);
+ g.drawRect(0, 0, width - 1, height - 1);
+
+ if (withoutBorderRectangle != null) {
+ Shape oldClip = g.getClip();
+ g.setClip(withoutBorderRectangle);
+ g.setColor(backgroundColor);
+ g.fillRect(0, 0, width, height);
+ g.setClip(oldClip);
+ }
+
+ g.setClip(1, 1, width - 2, height - 2);
+ rendererPane.paintComponent(g, component, this, 0, 0, width, height);
+ g.setClip(withoutBorderRectangle);
+ rendererPane.paintComponent(g, component, this, 0, 0, width, height);
+ }
+
+ public void setHeavyWeight(boolean isHeavyWeight) {
+ this.isHeavyWeight = isHeavyWeight;
+ }
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipComponent.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipListener.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipListener.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipListener.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2002 - 2005, Stephen Kelvin Friedrich. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this list
+ * of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice, this
+ * list of conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ * - Neither the name of the copyright holder nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.xduke.xswing;
+
+import javax.swing.*;
+import javax.swing.event.MouseInputAdapter;
+import java.awt.*;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.awt.event.MouseEvent;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+abstract class DataTipListener extends MouseInputAdapter implements ComponentListener {
+ private DataTipPopup dataTipPopup;
+
+ // When running under JDK 1.5 (or higher) DataTipListener will check if the tip must be updated when the parent
+ // component changes size or moves.
+ // With JDK 1.4 or earlier this does not work, because no mouse event gets posted (even though the relative mouse
+ // position changes) - yet to be able to compile with 1.4 the necessary JDK 1.5 methods are called by reflection.
+ // On JDK 1.4 the popup is just always hidden qwhen the component changes (and reshown when the user first moves
+ // the mouse again).
+ private static final Class[] NO_PARAMETERS = new Class[0];
+ private static final Object[] NO_ARGUMENTS = new Object[0];
+ private static Class mouseInfoClass;
+ private static Method getPointerInfoMethod;
+ private static Class pointerInfoClass;
+ private static Method getLocationMethod;
+
+ static {
+ try {
+ mouseInfoClass = Class.forName("java.awt.MouseInfo");
+ getPointerInfoMethod = mouseInfoClass.getMethod("getPointerInfo", NO_PARAMETERS);
+ pointerInfoClass = Class.forName("java.awt.PointerInfo");
+ getLocationMethod = pointerInfoClass.getMethod("getLocation", NO_PARAMETERS);
+ }
+ catch(NoSuchMethodException e) {
+ // fine probably running on pre-1.5-JDK
+ }
+ catch(ClassNotFoundException e) {
+ // fine probably running on pre-1.5-JDK
+ }
+ }
+
+ DataTipListener() {
+ }
+
+ /**
+ * @return the cell that is at position 'point' in the component or DataTipCell.NONE if there isn't a cell at that
+ * point.
+ */
+ abstract DataTipCell getCell(JComponent component, Point point);
+
+ /**
+ * If the user presses a mouse button on a popup, Swing's behaviour depends on the popup type:
+ * - lightweight popup:
+ * This case is handled here. Because the TipComponent.contains(int x, int y) is overriden to always return false
+ * Swing will dispath the event directly to the parent component.
+ * - heavyweight popup:
+ * Swing will dispatch the event to the popup's window, which is handled in DataTipPopup.
+ */
+ public void mousePressed(MouseEvent e) {
+ //hideTip(); Can't: Double click would not work. Click count of the second click would be '1', because it would
+ // go to a different window (for heavyweight datatips).
+ }
+
+ public void mouseEntered(MouseEvent event) {
+ checkShowOrHide(event);
+ }
+
+ public void mouseExited(MouseEvent event) {
+ checkShowOrHide(event);
+ }
+
+ public void mouseDragged(MouseEvent event) {
+ checkShowOrHide(event);
+ }
+
+ public void mouseMoved(MouseEvent event) {
+ checkShowOrHide(event);
+ }
+
+ private void checkShowOrHide(MouseEvent event) {
+ JComponent component = (JComponent) event.getSource();
+ Point mousePosition = event.getPoint();
+ checkShowOrHide(component, mousePosition);
+ }
+
+ private void checkShowOrHide(JComponent component, Point mousePosition) {
+ Window windowAncestor = SwingUtilities.getWindowAncestor(component);
+ if (windowAncestor == null || !windowAncestor.isActive()) {
+ hideTip();
+ return;
+ }
+
+ DataTipCell dataTipCell = getCell(component, mousePosition);
+ Rectangle visRect = component.getVisibleRect();
+
+ if(!visRect.contains(mousePosition)) {
+ dataTipCell = DataTipCell.NONE;
+ }
+
+ DataTipCell currentPopupCell = getCurrentPopupCell();
+ if(dataTipCell.equals(currentPopupCell)) {
+ return;
+ }
+
+ hideTip();
+ if(!dataTipCell.isSet()) {
+ return;
+ }
+
+ dataTipPopup = createPopup(component, mousePosition, dataTipCell);
+ }
+
+ private DataTipCell getCurrentPopupCell() {
+ if(!isTipShown()) {
+ return DataTipCell.NONE;
+ }
+ return dataTipPopup.getCell();
+ }
+
+ private DataTipPopup createPopup(JComponent component, Point mousePosition, DataTipCell dataTipCell) {
+ Rectangle cellBounds = dataTipCell.getCellBounds();
+
+ Rectangle visRect = component.getVisibleRect();
+ Rectangle visibleCellRectangle = cellBounds.intersection(visRect);
+ if (!visibleCellRectangle.contains(mousePosition)) {
+ return null;
+ }
+
+ Component rendererComponent = dataTipCell.getRendererComponent();
+ Dimension rendCompDim = rendererComponent.getMinimumSize();
+ Rectangle rendCompBounds = new Rectangle(cellBounds.getLocation(), rendCompDim);
+ if(cellBounds.contains(rendCompBounds) && visRect.contains(rendCompBounds)) {
+ return null;
+ }
+
+ Dimension preferredSize = rendererComponent.getPreferredSize();
+ Point tipPosition = cellBounds.getLocation();
+ int width = Math.max(cellBounds.width, preferredSize.width);
+ int height = Math.max(cellBounds.height, preferredSize.height);
+ Dimension tipDimension = new Dimension(width, height);
+ DataTipPopup dataTipPopup = new DataTipPopup(component, dataTipCell, tipPosition, tipDimension);
+
+ return dataTipPopup;
+ }
+
+ private boolean isTipShown() {
+ return dataTipPopup != null && dataTipPopup.isTipShown();
+ }
+
+ private void hideTip() {
+ if (dataTipPopup != null) {
+ dataTipPopup.hideTip();
+ dataTipPopup = null;
+ }
+ }
+
+ public void componentResized(ComponentEvent e) {
+ checkShowOrHide(e);
+ }
+
+ public void componentMoved(ComponentEvent e) {
+ checkShowOrHide(e);
+ }
+
+ public void componentShown(ComponentEvent e) {
+ checkShowOrHide(e);
+ }
+
+ public void componentHidden(ComponentEvent e) {
+ hideTip();
+ }
+
+ private void checkShowOrHide(ComponentEvent e) {
+ JComponent component = (JComponent) e.getSource();
+ Point mousePosition = getCurrentMousePosition();
+ if(mousePosition == null) {
+ hideTip();
+ }
+ else {
+ SwingUtilities.convertPointFromScreen(mousePosition, component);
+ checkShowOrHide(component, mousePosition);
+ }
+ }
+
+ private static Point getCurrentMousePosition() {
+ if(mouseInfoClass == null) {
+ return null;
+ }
+ try {
+ Object pointerInfo = getPointerInfoMethod.invoke(null, NO_ARGUMENTS);
+ Point mousePosition = (Point) getLocationMethod.invoke(pointerInfo, NO_ARGUMENTS);
+ return mousePosition;
+ }
+ catch(IllegalAccessException e) {
+ // strange, but nothing I can do here
+ }
+ catch(InvocationTargetException e) {
+ // strange, but nothing I can do here
+ }
+
+ return null;
+ }
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipListener.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipManager.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipManager.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipManager.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2002 - 2005, Stephen Kelvin Friedrich. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this list
+ * of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice, this
+ * list of conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ * - Neither the name of the copyright holder nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.xduke.xswing;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.AWTEventListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseWheelEvent;
+import java.security.AccessControlException;
+
+/**
+ * <code>DataTipManager</code> provides data tips for tree, table and list components. Whenever the mouse cursor is
+ * over a cell whose content is partially hidden a popup with the complete cell content is shown.
+ * The cell content can be hidden because it is clipped at either the parent component bounds (e.g. scrollpane) or at
+ * the cell bounds (e.g. table row height is too small).
+ */
+public class DataTipManager {
+ private static DataTipManager instance;
+
+ private ListDataTipListener listMouseListener = new ListDataTipListener();
+ private TableDataTipListener tableMouseListener = new TableDataTipListener();
+ private TreeDataTipListener treeMouseListener = new TreeDataTipListener();
+ private Component parentComponent;
+ private Window tipComponentWindow;
+ private MouseEvent lastMouseEvent;
+ private static boolean allowUntrustedUsage;
+
+ private DataTipManager() {
+ try {
+ long eventMask = AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_WHEEL_EVENT_MASK;
+ Toolkit.getDefaultToolkit().addAWTEventListener(new MouseEventModifier(), eventMask);
+ }
+ catch(AccessControlException e) {
+ if(!allowUntrustedUsage) {
+ throw new RuntimeException("DataTipManager needs to run in a trusted application", e);
+ }
+ }
+ }
+
+ static void enableUntrustedUsage(boolean enable) {
+ allowUntrustedUsage = enable;
+ }
+
+ /**
+ * @return the single, shared instance of the DataTipmanager
+ */
+ public static synchronized DataTipManager get() {
+ if(instance == null) {
+ instance = new DataTipManager();
+ }
+ return instance;
+ }
+
+ /**
+ * Enable data tips for a list component.
+ * @param list the list which should be enhanced with data tips.
+ */
+ public synchronized void register(JList list) {
+ list.addMouseListener(listMouseListener);
+ list.addMouseMotionListener(listMouseListener);
+ list.addComponentListener(listMouseListener);
+ }
+
+ /**
+ * Enable data tips for a tree component.
+ * @param tree the tree which should be enhanced with data tips.
+ */
+ public synchronized void register(JTree tree) {
+ tree.addMouseListener(treeMouseListener);
+ tree.addMouseMotionListener(treeMouseListener);
+ tree.addComponentListener(treeMouseListener);
+ }
+
+ /**
+ * Enable data tips for a list component.
+ * @param table the table which should be enhanced with data tips.
+ */
+ public synchronized void register(JTable table) {
+ table.addMouseListener(tableMouseListener);
+ table.addMouseMotionListener(tableMouseListener);
+ table.addComponentListener(tableMouseListener);
+ }
+
+ void setTipWindow(Component parentComponent, Window dataTipComponent) {
+ this.parentComponent = parentComponent;
+ tipComponentWindow = dataTipComponent;
+ }
+
+ public boolean handleEventFromParentComponent(MouseEvent mouseEvent) {
+ // filter out events that come from client explicitly calling this method, but we have already handled in awt event listener
+ if(mouseEvent == lastMouseEvent) {
+ return false;
+ }
+ Object source = mouseEvent.getSource();
+ if(source != parentComponent) {
+ return false;
+ }
+ int id = mouseEvent.getID();
+ int x = mouseEvent.getX();
+ int y = mouseEvent.getY();
+ long when = mouseEvent.getWhen();
+ int modifiers = mouseEvent.getModifiers();
+ int clickCount = mouseEvent.getClickCount();
+ boolean isPopupTrigger = mouseEvent.isPopupTrigger();
+ if(id == MouseEvent.MOUSE_EXITED) {
+ Point point = SwingUtilities.convertPoint(parentComponent, x, y, tipComponentWindow);
+ if(tipComponentWindow.contains(point)) {
+ MouseEvent newEvent = new MouseEvent(parentComponent, MouseEvent.MOUSE_MOVED, when, modifiers,
+ x, y, clickCount, isPopupTrigger);
+ parentComponent.dispatchEvent(newEvent);
+ // If the datatip has been hidden as a result, then process the exit event, too, so that
+ // e.g. tooltips will hide.
+ boolean stillVisible = parentComponent != null;
+ return stillVisible;
+ }
+ }
+ return false;
+ }
+
+ public void handleEventFromDataTipComponent(MouseEvent mouseEvent) {
+ mouseEvent.consume();
+ int id = mouseEvent.getID();
+ if(id != MouseEvent.MOUSE_ENTERED) {
+ int x = mouseEvent.getX();
+ int y = mouseEvent.getY();
+ Point point = SwingUtilities.convertPoint(mouseEvent.getComponent(), x, y, parentComponent);
+
+ if(id == MouseEvent.MOUSE_EXITED && parentComponent.contains(point)) {
+ return;
+ }
+ long when = mouseEvent.getWhen();
+ int modifiers = mouseEvent.getModifiers();
+ int clickCount = mouseEvent.getClickCount();
+ boolean isPopupTrigger = mouseEvent.isPopupTrigger();
+ MouseEvent newEvent;
+ if(id == MouseEvent.MOUSE_WHEEL) {
+ MouseWheelEvent mouseWheelEvent = (MouseWheelEvent) mouseEvent;
+ int scrollType = mouseWheelEvent.getScrollType();
+ int scrollAmount = mouseWheelEvent.getScrollAmount();
+ int wheelRotation = mouseWheelEvent.getWheelRotation();
+ newEvent = new MouseWheelEvent(parentComponent, id, when, modifiers, point.x, point.y,
+ clickCount, isPopupTrigger, scrollType, scrollAmount,
+ wheelRotation);
+ }
+ else {
+ newEvent = new MouseEvent(parentComponent, id, when, modifiers, point.x, point.y,
+ clickCount, isPopupTrigger);
+ }
+ Component parentComponentBackup = parentComponent;
+ parentComponent.dispatchEvent(newEvent);
+ if(parentComponent == null && id != MouseEvent.MOUSE_EXITED) {
+ MouseEvent exitEvent = new MouseEvent(parentComponentBackup, MouseEvent.MOUSE_EXITED, when,
+ modifiers, point.x, point.y, clickCount, isPopupTrigger);
+ parentComponentBackup.dispatchEvent(exitEvent);
+ }
+ if(tipComponentWindow != null && id != MouseEvent.MOUSE_MOVED) {
+ // mouse click might have changed appearance (e.g. selection color)
+ tipComponentWindow.repaint();
+ }
+ }
+ }
+
+ private class MouseEventModifier implements AWTEventListener {
+ private MouseEventModifier() {
+ }
+
+ public void eventDispatched(AWTEvent event) {
+ if(tipComponentWindow == null) {
+ return;
+ }
+ Object source = event.getSource();
+
+ if(source == parentComponent) {
+ MouseEvent mouseEvent = (MouseEvent) event;
+ boolean filter = handleEventFromParentComponent(mouseEvent);
+ if(filter) {
+ mouseEvent.consume();
+ }
+ else {
+ lastMouseEvent = mouseEvent;
+ }
+ }
+ }
+ }
+}
+
Property changes on: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipManager.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipPopup.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipPopup.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipPopup.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2002 - 2005, Stephen Kelvin Friedrich. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this list
+ * of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice, this
+ * list of conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ * - Neither the name of the copyright holder nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.xduke.xswing;
+
+import javax.swing.*;
+import java.awt.*;
+
+class DataTipPopup {
+ private Popup popup;
+ private DataTipCell cell;
+
+ DataTipPopup(JComponent parent, DataTipCell cell, Point tipPosition, Dimension tipDimension) {
+ this.cell = cell;
+ Rectangle parentVisibleRect = parent.getVisibleRect();
+ Rectangle withoutBorderRectangle = parentVisibleRect.intersection(new Rectangle(tipPosition, tipDimension));
+ withoutBorderRectangle.translate(-tipPosition.x, -tipPosition.y);
+
+ DataTipComponent dataTipComponent = new DataTipComponent(cell, withoutBorderRectangle, parent.getBackground());
+
+ Dimension tipDimensionClipped = new Dimension(tipDimension.width, tipDimension.height);
+ Window windowAncestor = SwingUtilities.getWindowAncestor(parent);
+ GraphicsConfiguration gc = windowAncestor.getGraphicsConfiguration();
+ Rectangle screenBounds = gc.getBounds();
+ Point tipScreenPosition = new Point(tipPosition.x, tipPosition.y);
+ SwingUtilities.convertPointToScreen(tipScreenPosition, parent);
+ Point tipPositionClipped = new Point();
+ tipPositionClipped.x = Math.max(tipScreenPosition.x, screenBounds.x);
+ tipPositionClipped.y = Math.max(tipScreenPosition.y, screenBounds.y);
+ tipDimensionClipped.width = Math.min(screenBounds.x + screenBounds.width - tipPositionClipped.x, tipDimensionClipped.width);
+ tipDimensionClipped.height = Math.min(screenBounds.y + screenBounds.height - tipPositionClipped.y, tipDimensionClipped.height);
+ SwingUtilities.convertPointFromScreen(tipPositionClipped, parent);
+ dataTipComponent.setPreferredSize(tipDimensionClipped);
+ SwingUtilities.convertPointToScreen(tipPosition, parent);
+
+ PopupFactory popupFactory = PopupFactory.getSharedInstance();
+ popup = popupFactory.getPopup(parent, dataTipComponent, tipPosition.x, tipPosition.y);
+ popup.show();
+ Window componentWindow = SwingUtilities.windowForComponent(parent);
+ Window tipWindow = SwingUtilities.windowForComponent(dataTipComponent);
+ //noinspection ObjectEquality
+ boolean isHeavyWeight = tipWindow != null && tipWindow != componentWindow;
+ dataTipComponent.setHeavyWeight(isHeavyWeight);
+ if (isHeavyWeight) {
+// ToolTipManager.sharedInstance().registerComponent(dataTipComponent);
+ DataTipManager.get().setTipWindow(parent, tipWindow);
+ }
+ }
+
+ DataTipCell getCell() {
+ return cell;
+ }
+
+ void hideTip() {
+ if (popup != null) {
+ popup.hide();
+ popup = null;
+
+ DataTipManager.get().setTipWindow(null, null);
+ }
+ }
+
+ public boolean isTipShown() {
+ return popup != null;
+ }
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/DataTipPopup.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/ListDataTipCell.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/ListDataTipCell.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/ListDataTipCell.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2002 - 2005, Stephen Kelvin Friedrich. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this list
+ * of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice, this
+ * list of conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ * - Neither the name of the copyright holder nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.xduke.xswing;
+
+import com.xduke.xswing.DataTipCell;
+
+import javax.swing.*;
+import java.awt.*;
+
+class ListDataTipCell implements DataTipCell {
+ private final JList list;
+ private final int rowIndex;
+
+ ListDataTipCell(JList list, int rowIndex) {
+ this.list = list;
+ this.rowIndex = rowIndex;
+ }
+
+ public boolean isSet() {
+ return rowIndex >= 0;
+ }
+
+ public Rectangle getCellBounds() {
+ Rectangle cellRect = list.getCellBounds(rowIndex, rowIndex);
+ return cellRect;
+ }
+
+ public Component getRendererComponent() {
+ Object item = list.getModel().getElementAt(rowIndex);
+ boolean isSelected = list.isSelectedIndex(rowIndex);
+ boolean isFocussed = list.hasFocus() && rowIndex == list.getLeadSelectionIndex();
+ ListCellRenderer renderer = list.getCellRenderer();
+ Component component = renderer.getListCellRendererComponent(list, item, rowIndex, isSelected, isFocussed);
+ return component;
+ }
+
+ public boolean equals(Object o) {
+ if(this == o) {
+ return true;
+ }
+ if(o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ ListDataTipCell listDataTipCell = (ListDataTipCell) o;
+
+ if(rowIndex != listDataTipCell.rowIndex) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode() {
+ return rowIndex;
+ }
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/ListDataTipCell.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/ListDataTipListener.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/ListDataTipListener.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/ListDataTipListener.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2002 - 2005, Stephen Kelvin Friedrich. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this list
+ * of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice, this
+ * list of conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ * - Neither the name of the copyright holder nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.xduke.xswing;
+
+import com.xduke.xswing.DataTipCell;
+import com.xduke.xswing.DataTipListener;
+import com.xduke.xswing.ListDataTipCell;
+
+import javax.swing.*;
+import java.awt.*;
+
+class ListDataTipListener extends DataTipListener {
+ ListDataTipListener() {
+ }
+
+ DataTipCell getCell(JComponent component, Point point) {
+ JList list = (JList) component;
+ int index = list.locationToIndex(point);
+ if (index < 0) {
+ return DataTipCell.NONE;
+ }
+ return new ListDataTipCell(list, index);
+ }
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/ListDataTipListener.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TableDataTipCell.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TableDataTipCell.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TableDataTipCell.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2002 - 2005, Stephen Kelvin Friedrich. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this list
+ * of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice, this
+ * list of conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ * - Neither the name of the copyright holder nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.xduke.xswing;
+
+import com.xduke.xswing.DataTipCell;
+
+import javax.swing.*;
+import javax.swing.table.TableCellRenderer;
+import java.awt.*;
+
+class TableDataTipCell implements DataTipCell {
+ private final JTable table;
+ private final int rowIndex;
+ private final int columnIndex;
+
+ TableDataTipCell(JTable table, int rowIndex, int columnIndex) {
+ this.table = table;
+ this.rowIndex = rowIndex;
+ this.columnIndex = columnIndex;
+ }
+
+ public boolean isSet() {
+ return rowIndex >= 0 && columnIndex >= 0;
+ }
+
+ public Rectangle getCellBounds() {
+ Rectangle cellRect = table.getCellRect(rowIndex, columnIndex, false);
+ return cellRect;
+ }
+
+ public Component getRendererComponent() {
+ TableCellRenderer cellRenderer = table.getCellRenderer(rowIndex, columnIndex);
+ Component component = table.prepareRenderer(cellRenderer, rowIndex, columnIndex);
+ return component;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ TableDataTipCell cellPosition = (TableDataTipCell) o;
+
+ if (columnIndex != cellPosition.columnIndex) {
+ return false;
+ }
+ if (rowIndex != cellPosition.rowIndex) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = rowIndex;
+ result = 29 * result + columnIndex;
+ return result;
+ }
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TableDataTipCell.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TableDataTipListener.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TableDataTipListener.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TableDataTipListener.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2002 - 2005, Stephen Kelvin Friedrich. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this list
+ * of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice, this
+ * list of conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ * - Neither the name of the copyright holder nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.xduke.xswing;
+
+import com.xduke.xswing.DataTipCell;
+import com.xduke.xswing.DataTipListener;
+import com.xduke.xswing.TableDataTipCell;
+
+import javax.swing.*;
+import java.awt.*;
+
+class TableDataTipListener extends DataTipListener {
+ TableDataTipListener() {
+ }
+
+ DataTipCell getCell(JComponent component, Point point) {
+ JTable table = (JTable) component;
+ int rowIndex = table.rowAtPoint(point);
+ int columnIndex = table.columnAtPoint(point);
+ if (rowIndex < 0 || columnIndex < 0) {
+ return DataTipCell.NONE;
+ }
+ TableDataTipCell cellPosition = new TableDataTipCell(table, rowIndex, columnIndex);
+ return cellPosition;
+ }
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TableDataTipListener.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TreeDataTipCell.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TreeDataTipCell.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TreeDataTipCell.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2002 - 2005, Stephen Kelvin Friedrich. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this list
+ * of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice, this
+ * list of conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ * - Neither the name of the copyright holder nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.xduke.xswing;
+
+import com.xduke.xswing.DataTipCell;
+
+import javax.swing.*;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+import javax.swing.tree.TreeCellRenderer;
+import java.awt.*;
+
+class TreeDataTipCell implements DataTipCell {
+ private final JTree tree;
+ private final int rowIndex;
+
+ public TreeDataTipCell(JTree tree, int rowIndex) {
+ this.tree = tree;
+ this.rowIndex = rowIndex;
+ }
+
+ public boolean isSet() {
+ return rowIndex >= 0;
+ }
+
+ public Rectangle getCellBounds() {
+ TreePath treePath = tree.getPathForRow(rowIndex);
+ Rectangle cellRect = tree.getPathBounds(treePath);
+ return cellRect;
+ }
+
+ public Component getRendererComponent() {
+ TreeModel treeModel = tree.getModel();
+ TreePath treePath = tree.getPathForRow(rowIndex);
+ TreeCellRenderer renderer = tree.getCellRenderer();
+ boolean isSelected = tree.isPathSelected(treePath);
+ boolean isExpanded = tree.isExpanded(treePath);
+ boolean hasFocus = tree.hasFocus() && rowIndex == tree.getLeadSelectionRow();
+ Object item = treePath.getLastPathComponent();
+ boolean isLeaf = treeModel.isLeaf(item);
+ Component component = renderer.getTreeCellRendererComponent(tree, item, isSelected, isExpanded, isLeaf, rowIndex, hasFocus);
+ component.setFont(tree.getFont());
+ return component;
+ }
+
+ public boolean equals(Object o) {
+ if(this == o) {
+ return true;
+ }
+ if(o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ TreeDataTipCell treeDataTipCell = (TreeDataTipCell) o;
+
+ if(rowIndex != treeDataTipCell.rowIndex) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode() {
+ return rowIndex;
+ }
+}
+
Property changes on: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TreeDataTipCell.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TreeDataTipListener.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TreeDataTipListener.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TreeDataTipListener.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2002 - 2005, Stephen Kelvin Friedrich. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this list
+ * of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice, this
+ * list of conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ * - Neither the name of the copyright holder nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.xduke.xswing;
+
+import com.xduke.xswing.DataTipCell;
+import com.xduke.xswing.DataTipListener;
+import com.xduke.xswing.TreeDataTipCell;
+
+import javax.swing.*;
+import java.awt.*;
+
+class TreeDataTipListener extends DataTipListener {
+ TreeDataTipListener() {
+ }
+
+ DataTipCell getCell(JComponent component, Point point) {
+ JTree tree = (JTree) component;
+ int rowIndex = tree.getRowForLocation(point.x, point.y);
+ if (rowIndex < 0) {
+ return DataTipCell.NONE;
+ }
+ return new TreeDataTipCell(tree, rowIndex);
+ }
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/com/xduke/xswing/TreeDataTipListener.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTableModel.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTableModel.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTableModel.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,128 @@
+/* *
+ * Copyright (C) 2010 ceric35
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ **/
+package org.nuiton.test;
+
+import java.io.File;
+
+import javax.swing.event.TreeModelListener;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.views.AbstractView;
+
+/**
+ * BasicTableModel
+ *
+ * TODO ADD COMMENT HERE !
+ *
+ * @author ceric35
+ * Date : 4 mars 2010
+ */
+public class BasicTableModel extends AbstractTableModel {
+
+ /** Logger */
+ private static Logger logger = LoggerFactory.getLogger(BasicTableModel.class);
+
+ protected File root;
+
+ protected File[] children;
+
+ public BasicTableModel(File rootFile) {
+ this.root = rootFile;
+ children = root.listFiles();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
+ */
+ public Object getChild(Object parent, int index) {
+
+ File parentFile = (File)parent;
+ File[] children = parentFile.listFiles();
+ return children[index];
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getRowCount()
+ */
+ @Override
+ public int getRowCount() {
+ return children.length;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getColumnCount()
+ */
+ @Override
+ public int getColumnCount() {
+ return 2;
+ }
+
+
+ /*
+ * @see javax.swing.table.AbstractTableModel#getColumnName(int)
+ */
+ @Override
+ public String getColumnName(int column) {
+ String result = "n/a";
+
+ switch (column) {
+ case 0: result = "File"; break;
+ case 1: result = "Size"; break;
+ }
+
+ return result;
+ }
+
+ /*
+ * @see javax.swing.table.AbstractTableModel#getColumnClass(int)
+ */
+ @Override
+ public Class<?> getColumnClass(int columnIndex) {
+ Class<?> result = null;
+
+ switch (columnIndex) {
+ case 0: result = String.class; break;
+ case 1: result = Long.class; break;
+ }
+
+ return result;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getValueAt(int, int)
+ */
+ @Override
+ public Object getValueAt(int rowIndex, int columnIndex) {
+
+ Object result = null;
+ File f = children[rowIndex];
+ switch (columnIndex) {
+ case 0: result = f.getAbsolutePath(); break;
+ case 1: result = f.length(); break;
+ }
+
+ return result;
+ }
+
+
+
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTableModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTreeModel.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTreeModel.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTreeModel.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,119 @@
+/* *
+ * Copyright (C) 2010 ceric35
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ **/
+package org.nuiton.test;
+
+import java.io.File;
+
+import javax.swing.event.TreeModelListener;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * BasicTreeModel
+ *
+ * TODO ADD COMMENT HERE !
+ *
+ * @author ceric35
+ * Date : 4 mars 2010
+ */
+public class BasicTreeModel implements TreeModel {
+
+ /** Logger */
+ private static Logger logger = LoggerFactory.getLogger(BasicTreeModel.class);
+
+ protected File root;
+
+ public BasicTreeModel(File rootFile) {
+ this.root = rootFile;
+ }
+
+ /* @see javax.swing.tree.TreeModel#getRoot()
+ */
+ @Override
+ public Object getRoot() {
+ return root;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
+ */
+ @Override
+ public Object getChild(Object parent, int index) {
+
+ File parentFile = (File)parent;
+ File[] children = parentFile.listFiles();
+ return children[index];
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#getChildCount(java.lang.Object)
+ */
+ @Override
+ public int getChildCount(Object parent) {
+ File parentFile = (File)parent;
+ File[] children = parentFile.listFiles();
+ return children == null ? 0 : children.length;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#isLeaf(java.lang.Object)
+ */
+ @Override
+ public boolean isLeaf(Object node) {
+ return getChildCount(node) == 0;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object)
+ */
+ @Override
+ public void valueForPathChanged(TreePath path, Object newValue) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#getIndexOfChild(java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public int getIndexOfChild(Object parent, Object child) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#addTreeModelListener(javax.swing.event.TreeModelListener)
+ */
+ @Override
+ public void addTreeModelListener(TreeModelListener l) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeModel#removeTreeModelListener(javax.swing.event.TreeModelListener)
+ */
+ @Override
+ public void removeTreeModelListener(TreeModelListener l) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/BasicTreeModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/CustomTreeFilter.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/CustomTreeFilter.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/CustomTreeFilter.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,36 @@
+/* *
+ * Copyright (C) 2010 ceric35
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ **/
+package org.nuiton.test;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * CustomTreeFilter
+ *
+ * TODO ADD COMMENT HERE !
+ *
+ * @author ceric35
+ * Date : 4 mars 2010
+ */
+public class CustomTreeFilter {
+
+ /** Logger */
+ private static Logger logger = LoggerFactory.getLogger(Main.class);
+
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/CustomTreeFilter.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/Main.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/Main.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/Main.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,200 @@
+/* *
+ * Copyright (C) 2010 ceric35
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ **/
+package org.nuiton.test;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.Window;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.File;
+import java.io.IOException;
+
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JToolTip;
+import javax.swing.JTree;
+
+import net.java.balloontip.BalloonTip;
+import net.java.balloontip.styles.RoundedBalloonStyle;
+import net.java.balloontip.utils.ToolTipUtils;
+
+import org.jdesktop.application.SessionStorage;
+import org.nuiton.test.saf.SafApplicationContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.xduke.xswing.DataTipManager;
+
+/**
+ * Main
+ *
+ * @author ceric35
+ * Date : 4 mars 2010
+ */
+public class Main extends JFrame {
+
+ /** Logger */
+ private static Logger logger = LoggerFactory.getLogger(Main.class);
+
+ public Main() throws IOException {
+
+ // label filter
+ JPanel leftPanel = new JPanel(new GridBagLayout());
+ JLabel filterLabel = new JLabel("Filtre : ");
+ leftPanel.add(filterLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0,
+ GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
+ new Insets(2, 2, 2, 2), 0, 0));
+
+ // field filter
+ JTextField filterField = new JTextField();
+ leftPanel.add(filterField, new GridBagConstraints(1, 0, 1, 1, 1, 0,
+ GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
+ new Insets(2, 2, 2, 2), 0, 0));
+
+ // tree
+ BasicTreeModel treeModel = new BasicTreeModel(new File(".")
+ .getCanonicalFile());
+ JTree tree = new JTree(treeModel);
+ tree.setName("tree");
+ leftPanel.add(new JScrollPane(tree), new GridBagConstraints(0, 1, 2, 1,
+ 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+ new Insets(2, 2, 2, 2), 0, 0));
+ DataTipManager.get().register(tree);
+
+ JPanel rigthPanel = new JPanel(new GridBagLayout());
+ // label tootip
+ JLabel testToottip = new JLabel("Over me !!!!!") {
+ @Override
+ public JToolTip createToolTip() {
+ JToolTip tt = new JToolTip();
+ /*BalloonTip bt = new BalloonTip(this, this.getToolTipText(), new RoundedBalloonStyle(5,5,Color.WHITE, Color.BLACK), false);
+ bt.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent e) {
+
+ BalloonTip source = (BalloonTip)e.getSource();
+ source.closeBalloon();
+
+ BalloonTip bt = new BalloonTip(source, source.getToolTipText(), new RoundedBalloonStyle(5,5,Color.WHITE, Color.BLACK), true);
+ bt.setVisible(true);
+ }
+
+ });
+ //ToolTipUtils.balloonToToolTip(bt, 500, 3000);
+ tt.setComponent(this);*/
+ return tt;
+ }
+ };
+ testToottip.setToolTipText("Alors ?");
+
+ BalloonTip bt = new BalloonTip(testToottip, testToottip
+ .getToolTipText(), new RoundedBalloonStyle(5, 5, Color.WHITE,
+ Color.BLACK), false);
+ bt.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ logger.debug("Called");
+ BalloonTip source = (BalloonTip) e.getSource();
+ source.setVisible(false);
+ source.setEnabled(false);
+ BalloonTip bt = new BalloonTip(
+ source.getAttachedComponent(),
+ source.getAttachedComponent().getToolTipText(),
+ new RoundedBalloonStyle(5, 5, Color.WHITE, Color.BLACK),
+ true);
+ bt.setVisible(true);
+ }
+ });
+ ToolTipUtils.balloonToToolTip(bt, 500, 3000);
+ rigthPanel.add(testToottip, new GridBagConstraints(0, 0, 1, 1, 1, 0,
+ GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(
+ 2, 2, 2, 2), 0, 0));
+
+ // table
+ BasicTableModel tableModel = new BasicTableModel(new File(".")
+ .getCanonicalFile());
+ JTable table = new JTable(tableModel);
+ table.setName("table");
+ rigthPanel.add(new JScrollPane(table), new GridBagConstraints(0, 1, 1,
+ 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+ new Insets(2, 2, 2, 2), 0, 0));
+ DataTipManager.get().register(table);
+
+ // end UI
+
+ JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, rigthPanel);
+ pane.setName("mainViewPane");
+
+ add(pane);
+ }
+
+ public static void main(String[] args) throws IOException {
+ final Main m = new Main();
+ m.setName("mainFrame");
+
+ // centering
+ centerWindow(m);
+
+ SafApplicationContext context = new SafApplicationContext();
+ final SessionStorage sessionStorage = context.getSessionStorage();
+ sessionStorage.restore(m, m.getName() + "-session.xml");
+
+ m.addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent e) {
+ try {
+ sessionStorage.save(m, m.getName() + "-session.xml");
+ System.exit(0);
+ } catch (IOException ex) {
+ logger.error("Can't save frame session", ex);
+ }
+ }
+ });
+ m.setVisible(true);
+ }
+
+ protected static void centerWindow(Window root) {
+ // If the window's bounds don't appear to have been set, do it
+ if (root instanceof Window) {
+ Window window = (Window) root;
+ if (!root.isValid() || (root.getWidth() == 0)
+ || (root.getHeight() == 0)) {
+ window.pack();
+ }
+ if (!window.isLocationByPlatform() && (root.getX() == 0)
+ && (root.getY() == 0)) {
+ Component owner = window.getOwner();
+ //if (owner == null) {
+ // owner = (window != mainFrame) ? mainFrame : null;
+ //}
+ window.setLocationRelativeTo(owner); // center the window
+ }
+ }
+ }
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/Main.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/TreeFilter.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/TreeFilter.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/TreeFilter.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,31 @@
+/* *
+ * Copyright (C) 2010 ceric35
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ **/
+package org.nuiton.test;
+
+/**
+ * TreeFilter
+ *
+ * TODO ADD COMMENT HERE !
+ *
+ * @author ceric35
+ * Date : 4 mars 2010
+ */
+public interface TreeFilter {
+
+ public boolean include(Object o);
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/TreeFilter.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/MainApplication.properties
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/MainApplication.properties (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/resources/MainApplication.properties 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1 @@
+Application.id=testtesttest
\ No newline at end of file
Added: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/saf/SafApplicationContext.java
===================================================================
--- testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/saf/SafApplicationContext.java (rev 0)
+++ testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/saf/SafApplicationContext.java 2010-03-04 16:06:40 UTC (rev 387)
@@ -0,0 +1,39 @@
+/* *##%
+ * Copyright (C) 2010 Code Lutin, Chatellier Eric
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package org.nuiton.test.saf;
+
+import org.jdesktop.application.Application;
+import org.jdesktop.application.ApplicationContext;
+
+/**
+ * TODO add comment here.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class SafApplicationContext extends ApplicationContext {
+
+ public SafApplicationContext() {
+ super();
+ setApplicationClass(Application.class);
+ }
+}
Property changes on: testTreeTooltipSession/trunk/src/main/java/org/nuiton/test/saf/SafApplicationContext.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
1
0
Author: echatellier
Date: 2010-03-04 17:06:00 +0100 (Thu, 04 Mar 2010)
New Revision: 386
Log:
Initial import.
Added:
testTreeTooltipSession/
testTreeTooltipSession/trunk/
1
0
Author: athimel
Date: 2010-02-17 18:25:40 +0100 (Wed, 17 Feb 2010)
New Revision: 385
Added:
release-plugin-bug/
release-plugin-bug/other-project/
release-plugin-bug/other-project/other-project-api/
release-plugin-bug/other-project/other-project-api/pom.xml
release-plugin-bug/other-project/other-project-api/src/
release-plugin-bug/other-project/other-project-api/src/main/
release-plugin-bug/other-project/other-project-api/src/main/java/
release-plugin-bug/other-project/other-project-api/src/main/java/bws/
release-plugin-bug/other-project/other-project-api/src/main/java/bws/entities/
release-plugin-bug/other-project/other-project-api/src/main/java/bws/entities/DummyEntity.java
release-plugin-bug/other-project/other-project-api/src/main/java/bws/services/
release-plugin-bug/other-project/other-project-api/src/main/java/bws/services/Service.java
release-plugin-bug/other-project/other-project-impl/
release-plugin-bug/other-project/other-project-impl/pom.xml
release-plugin-bug/other-project/other-project-impl/src/
release-plugin-bug/other-project/other-project-impl/src/main/
release-plugin-bug/other-project/other-project-impl/src/main/java/
release-plugin-bug/other-project/other-project-impl/src/main/java/bws/
release-plugin-bug/other-project/other-project-impl/src/main/java/bws/services/
release-plugin-bug/other-project/other-project-impl/src/main/java/bws/services/impl/
release-plugin-bug/other-project/other-project-impl/src/main/java/bws/services/impl/ServiceImpl.java
release-plugin-bug/other-project/pom.xml
release-plugin-bug/test/
release-plugin-bug/test/pom.xml
release-plugin-bug/test/test-api/
release-plugin-bug/test/test-api/pom.xml
release-plugin-bug/test/test-api/src/
release-plugin-bug/test/test-api/src/main/
release-plugin-bug/test/test-api/src/main/java/
release-plugin-bug/test/test-api/src/main/java/bws/
release-plugin-bug/test/test-api/src/main/java/bws/entities/
release-plugin-bug/test/test-api/src/main/java/bws/entities/DummyEntity.java
release-plugin-bug/test/test-api/src/main/java/bws/services/
release-plugin-bug/test/test-api/src/main/java/bws/services/Service.java
release-plugin-bug/test/test-impl/
release-plugin-bug/test/test-impl/pom.xml
release-plugin-bug/test/test-impl/src/
release-plugin-bug/test/test-impl/src/main/
release-plugin-bug/test/test-impl/src/main/java/
release-plugin-bug/test/test-impl/src/main/java/bws/
release-plugin-bug/test/test-impl/src/main/java/bws/services/
release-plugin-bug/test/test-impl/src/main/java/bws/services/impl/
release-plugin-bug/test/test-impl/src/main/java/bws/services/impl/ServiceImpl.java
Log:
Add backbone to test some maven-release-plugin bug
Added: release-plugin-bug/other-project/other-project-api/pom.xml
===================================================================
--- release-plugin-bug/other-project/other-project-api/pom.xml (rev 0)
+++ release-plugin-bug/other-project/other-project-api/pom.xml 2010-02-17 17:25:40 UTC (rev 385)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <groupId>org.nuiton.sandbox</groupId>
+ <artifactId>other-project-api</artifactId>
+
+ <parent>
+ <groupId>org.nuiton.sandbox</groupId>
+ <artifactId>other-project</artifactId>
+ <version>0.0-SNAPSHOT</version>
+ </parent>
+
+ <!-- POM Relationships : Inheritance : Dependencies -->
+ <dependencies>
+
+ </dependencies>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>org.nuiton.sandbox.other-project-api</name>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>jar</packaging>
+
+ <build>
+ </build>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Environment ************************************** -->
+ <!-- ************************************************************* -->
+
+ <repositories>
+ </repositories>
+
+ <profiles>
+ </profiles>
+
+</project>
+
Added: release-plugin-bug/other-project/other-project-api/src/main/java/bws/entities/DummyEntity.java
===================================================================
--- release-plugin-bug/other-project/other-project-api/src/main/java/bws/entities/DummyEntity.java (rev 0)
+++ release-plugin-bug/other-project/other-project-api/src/main/java/bws/entities/DummyEntity.java 2010-02-17 17:25:40 UTC (rev 385)
@@ -0,0 +1,16 @@
+package bws.entities;
+
+public class DummyEntity {
+
+ private String id;
+
+ public String getId() {
+ return this.id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+}
+
Added: release-plugin-bug/other-project/other-project-api/src/main/java/bws/services/Service.java
===================================================================
--- release-plugin-bug/other-project/other-project-api/src/main/java/bws/services/Service.java (rev 0)
+++ release-plugin-bug/other-project/other-project-api/src/main/java/bws/services/Service.java 2010-02-17 17:25:40 UTC (rev 385)
@@ -0,0 +1,11 @@
+package bws.services;
+
+import java.util.List;
+import bws.entities.DummyEntity;
+
+public interface Service {
+
+ List<DummyEntity> findAll();
+
+}
+
Added: release-plugin-bug/other-project/other-project-impl/pom.xml
===================================================================
--- release-plugin-bug/other-project/other-project-impl/pom.xml (rev 0)
+++ release-plugin-bug/other-project/other-project-impl/pom.xml 2010-02-17 17:25:40 UTC (rev 385)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <groupId>org.nuiton.sandbox</groupId>
+ <artifactId>other-project-impl</artifactId>
+
+ <parent>
+ <groupId>org.nuiton.sandbox</groupId>
+ <artifactId>other-project</artifactId>
+ <version>0.0-SNAPSHOT</version>
+ </parent>
+
+ <!-- POM Relationships : Inheritance : Dependencies -->
+ <dependencies>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>other-project-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>org.nuiton.sandbox.other-project-impl</name>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>jar</packaging>
+
+ <build>
+ </build>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Environment ************************************** -->
+ <!-- ************************************************************* -->
+
+ <repositories>
+ </repositories>
+
+ <profiles>
+ </profiles>
+
+</project>
+
Added: release-plugin-bug/other-project/other-project-impl/src/main/java/bws/services/impl/ServiceImpl.java
===================================================================
--- release-plugin-bug/other-project/other-project-impl/src/main/java/bws/services/impl/ServiceImpl.java (rev 0)
+++ release-plugin-bug/other-project/other-project-impl/src/main/java/bws/services/impl/ServiceImpl.java 2010-02-17 17:25:40 UTC (rev 385)
@@ -0,0 +1,16 @@
+package bws.services.impl;
+
+import java.util.List;
+
+import bws.entities.DummyEntity;
+import bws.services.Service;
+
+public class ServiceImpl implements Service {
+
+ @Override
+ public List<DummyEntity> findAll() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Added: release-plugin-bug/other-project/pom.xml
===================================================================
--- release-plugin-bug/other-project/pom.xml (rev 0)
+++ release-plugin-bug/other-project/pom.xml 2010-02-17 17:25:40 UTC (rev 385)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <groupId>org.nuiton.sandbox</groupId>
+ <artifactId>other-project</artifactId>
+ <version>0.0-SNAPSHOT</version>
+
+ <modules>
+ <module>other-project-api</module>
+ <module>other-project-impl</module>
+ </modules>
+
+ <!-- Source control management. -->
+ <scm>
+ <connection>scm:svn:http://svn.nuiton.org/svn/sandbox/release-plugin-bug/other-project</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/sandbox/release-plugin-bug/other-project</developerConnection>
+ <url>http://svn.nuiton.org/svn/sandbox/release-plugin-bug/other-project</url>
+ </scm>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>org.sharengo.sandbox.other-project</name>
+
+ <description>Test project for some bug on maven-release-plugin</description>
+ <inceptionYear>2010</inceptionYear>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>pom</packaging>
+
+ <properties>
+ <!-- for a multi-module, we have to set the projectId -->
+ <projectId>test</projectId>
+ </properties>
+
+</project>
+
Added: release-plugin-bug/test/pom.xml
===================================================================
--- release-plugin-bug/test/pom.xml (rev 0)
+++ release-plugin-bug/test/pom.xml 2010-02-17 17:25:40 UTC (rev 385)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <groupId>org.nuiton.sandbox</groupId>
+ <artifactId>test</artifactId>
+ <version>0.0-SNAPSHOT</version>
+
+ <modules>
+ <module>test-api</module>
+ <module>test-impl</module>
+ </modules>
+
+ <!-- Source control management. -->
+ <scm>
+ <connection>scm:svn:http://svn.nuiton.org/svn/sandbox/release-plugin-bug/test</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/sandbox/release-plugin-bug/test</developerConnection>
+ <url>http://svn.nuiton.org/svn/sandbox/release-plugin-bug/test</url>
+ </scm>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>org.sharengo.sandbox.test</name>
+
+ <description>Test project for some bug on maven-release-plugin</description>
+ <inceptionYear>2010</inceptionYear>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>pom</packaging>
+
+ <properties>
+ <!-- for a multi-module, we have to set the projectId -->
+ <projectId>test</projectId>
+ </properties>
+
+</project>
+
Added: release-plugin-bug/test/test-api/pom.xml
===================================================================
--- release-plugin-bug/test/test-api/pom.xml (rev 0)
+++ release-plugin-bug/test/test-api/pom.xml 2010-02-17 17:25:40 UTC (rev 385)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <groupId>org.nuiton.sandbox</groupId>
+ <artifactId>test-api</artifactId>
+
+ <parent>
+ <groupId>org.nuiton.sandbox</groupId>
+ <artifactId>test</artifactId>
+ <version>0.0-SNAPSHOT</version>
+ </parent>
+
+ <!-- POM Relationships : Inheritance : Dependencies -->
+ <dependencies>
+
+ <dependency>
+ <groupId>org.nuiton.sandbox</groupId>
+ <artifactId>other-project-api</artifactId>
+ <version>0.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>org.nuiton.sandbox.test-api</name>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>jar</packaging>
+
+ <build>
+ </build>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Environment ************************************** -->
+ <!-- ************************************************************* -->
+
+ <repositories>
+ </repositories>
+
+ <profiles>
+ </profiles>
+
+</project>
+
Added: release-plugin-bug/test/test-api/src/main/java/bws/entities/DummyEntity.java
===================================================================
--- release-plugin-bug/test/test-api/src/main/java/bws/entities/DummyEntity.java (rev 0)
+++ release-plugin-bug/test/test-api/src/main/java/bws/entities/DummyEntity.java 2010-02-17 17:25:40 UTC (rev 385)
@@ -0,0 +1,16 @@
+package bws.entities;
+
+public class DummyEntity {
+
+ private String id;
+
+ public String getId() {
+ return this.id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+}
+
Added: release-plugin-bug/test/test-api/src/main/java/bws/services/Service.java
===================================================================
--- release-plugin-bug/test/test-api/src/main/java/bws/services/Service.java (rev 0)
+++ release-plugin-bug/test/test-api/src/main/java/bws/services/Service.java 2010-02-17 17:25:40 UTC (rev 385)
@@ -0,0 +1,11 @@
+package bws.services;
+
+import java.util.List;
+import bws.entities.DummyEntity;
+
+public interface Service {
+
+ List<DummyEntity> findAll();
+
+}
+
Added: release-plugin-bug/test/test-impl/pom.xml
===================================================================
--- release-plugin-bug/test/test-impl/pom.xml (rev 0)
+++ release-plugin-bug/test/test-impl/pom.xml 2010-02-17 17:25:40 UTC (rev 385)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <groupId>org.nuiton.sandbox</groupId>
+ <artifactId>test-impl</artifactId>
+
+ <parent>
+ <groupId>org.nuiton.sandbox</groupId>
+ <artifactId>test</artifactId>
+ <version>0.0-SNAPSHOT</version>
+ </parent>
+
+ <!-- POM Relationships : Inheritance : Dependencies -->
+ <dependencies>
+
+ <dependency>
+ <groupId>org.nuiton.sandbox</groupId>
+ <artifactId>other-project-impl</artifactId>
+ <version>0.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>test-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>org.nuiton.sandbox.test-impl</name>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>jar</packaging>
+
+ <build>
+ </build>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Environment ************************************** -->
+ <!-- ************************************************************* -->
+
+ <repositories>
+ </repositories>
+
+ <profiles>
+ </profiles>
+
+</project>
+
Added: release-plugin-bug/test/test-impl/src/main/java/bws/services/impl/ServiceImpl.java
===================================================================
--- release-plugin-bug/test/test-impl/src/main/java/bws/services/impl/ServiceImpl.java (rev 0)
+++ release-plugin-bug/test/test-impl/src/main/java/bws/services/impl/ServiceImpl.java 2010-02-17 17:25:40 UTC (rev 385)
@@ -0,0 +1,16 @@
+package bws.services.impl;
+
+import java.util.List;
+
+import bws.entities.DummyEntity;
+import bws.services.Service;
+
+public class ServiceImpl implements Service {
+
+ @Override
+ public List<DummyEntity> findAll() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
1
0
r384 - in wikengo_core-wikitty: . wikengo_core-wikitty-api wikengo_core-wikitty-jdbc-impl wikengo_core-wikitty-solr-impl
by kmorin@users.nuiton.org 09 Feb '10
by kmorin@users.nuiton.org 09 Feb '10
09 Feb '10
Author: kmorin
Date: 2010-02-09 10:32:53 +0100 (Tue, 09 Feb 2010)
New Revision: 384
Modified:
wikengo_core-wikitty/pom.xml
wikengo_core-wikitty/wikengo_core-wikitty-api/pom.xml
wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/pom.xml
wikengo_core-wikitty/wikengo_core-wikitty-solr-impl/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: wikengo_core-wikitty/pom.xml
===================================================================
--- wikengo_core-wikitty/pom.xml 2010-02-09 09:32:45 UTC (rev 383)
+++ wikengo_core-wikitty/pom.xml 2010-02-09 09:32:53 UTC (rev 384)
@@ -9,7 +9,7 @@
<groupId>org.sharengo.wikengo</groupId>
<artifactId>core-wikitty</artifactId>
- <version>1.0.0-alpha-6</version>
+ <version>1.0.0-alpha-7-SNAPSHOT</version>
<modules>
<module>wikengo_core-wikitty-api</module>
@@ -62,9 +62,9 @@
</distributionManagement>
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/sandbox/tags/core-wikitty-1.0.0-alpha-6</connection>
- <developerConnection>scm:svn:http://svn.nuiton.org/svn/sandbox/tags/core-wikitty-1.0.0-alpha-6</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/sandbox/tags/core-wikitty-1.0.0-a…</url>
+ <connection>scm:svn:http://svn.nuiton.org/svn/sandbox/wikengo_core-wikitty/</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/sandbox/wikengo_core-wikitty</developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/sandbox/wikengo_core-wikitty</url>
</scm>
<!-- ************************************************************* -->
Modified: wikengo_core-wikitty/wikengo_core-wikitty-api/pom.xml
===================================================================
--- wikengo_core-wikitty/wikengo_core-wikitty-api/pom.xml 2010-02-09 09:32:45 UTC (rev 383)
+++ wikengo_core-wikitty/wikengo_core-wikitty-api/pom.xml 2010-02-09 09:32:53 UTC (rev 384)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.sharengo.wikengo</groupId>
<artifactId>core-wikitty</artifactId>
- <version>1.0.0-alpha-6</version>
+ <version>1.0.0-alpha-7-SNAPSHOT</version>
</parent>
<dependencies>
Modified: wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/pom.xml
===================================================================
--- wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/pom.xml 2010-02-09 09:32:45 UTC (rev 383)
+++ wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/pom.xml 2010-02-09 09:32:53 UTC (rev 384)
@@ -7,7 +7,7 @@
<parent>
<groupId>org.sharengo.wikengo</groupId>
<artifactId>core-wikitty</artifactId>
- <version>1.0.0-alpha-6</version>
+ <version>1.0.0-alpha-7-SNAPSHOT</version>
</parent>
<dependencies>
Modified: wikengo_core-wikitty/wikengo_core-wikitty-solr-impl/pom.xml
===================================================================
--- wikengo_core-wikitty/wikengo_core-wikitty-solr-impl/pom.xml 2010-02-09 09:32:45 UTC (rev 383)
+++ wikengo_core-wikitty/wikengo_core-wikitty-solr-impl/pom.xml 2010-02-09 09:32:53 UTC (rev 384)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.sharengo.wikengo</groupId>
<artifactId>core-wikitty</artifactId>
- <version>1.0.0-alpha-6</version>
+ <version>1.0.0-alpha-7-SNAPSHOT</version>
</parent>
<dependencies>
1
0
Author: kmorin
Date: 2010-02-09 10:32:45 +0100 (Tue, 09 Feb 2010)
New Revision: 383
Added:
tags/core-wikitty-1.0.0-alpha-6/
Log:
[maven-scm] copy for tag core-wikitty-1.0.0-alpha-6
1
0
r382 - in wikengo_core-wikitty: . wikengo_core-wikitty-api wikengo_core-wikitty-jdbc-impl wikengo_core-wikitty-solr-impl
by kmorin@users.nuiton.org 09 Feb '10
by kmorin@users.nuiton.org 09 Feb '10
09 Feb '10
Author: kmorin
Date: 2010-02-09 10:32:40 +0100 (Tue, 09 Feb 2010)
New Revision: 382
Modified:
wikengo_core-wikitty/pom.xml
wikengo_core-wikitty/wikengo_core-wikitty-api/pom.xml
wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/pom.xml
wikengo_core-wikitty/wikengo_core-wikitty-solr-impl/pom.xml
Log:
[maven-release-plugin] prepare release core-wikitty-1.0.0-alpha-6
Modified: wikengo_core-wikitty/pom.xml
===================================================================
--- wikengo_core-wikitty/pom.xml 2010-02-08 09:35:55 UTC (rev 381)
+++ wikengo_core-wikitty/pom.xml 2010-02-09 09:32:40 UTC (rev 382)
@@ -9,7 +9,7 @@
<groupId>org.sharengo.wikengo</groupId>
<artifactId>core-wikitty</artifactId>
- <version>1.0.0-alpha-6-SNAPSHOT</version>
+ <version>1.0.0-alpha-6</version>
<modules>
<module>wikengo_core-wikitty-api</module>
@@ -62,9 +62,9 @@
</distributionManagement>
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/sandbox/wikengo_core-wikitty/</connection>
- <developerConnection>scm:svn:http://svn.nuiton.org/svn/sandbox/wikengo_core-wikitty</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/sandbox/wikengo_core-wikitty</url>
+ <connection>scm:svn:http://svn.nuiton.org/svn/sandbox/tags/core-wikitty-1.0.0-alpha-6</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/sandbox/tags/core-wikitty-1.0.0-alpha-6</developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/sandbox/tags/core-wikitty-1.0.0-a…</url>
</scm>
<!-- ************************************************************* -->
Modified: wikengo_core-wikitty/wikengo_core-wikitty-api/pom.xml
===================================================================
--- wikengo_core-wikitty/wikengo_core-wikitty-api/pom.xml 2010-02-08 09:35:55 UTC (rev 381)
+++ wikengo_core-wikitty/wikengo_core-wikitty-api/pom.xml 2010-02-09 09:32:40 UTC (rev 382)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.sharengo.wikengo</groupId>
<artifactId>core-wikitty</artifactId>
- <version>1.0.0-alpha-6-SNAPSHOT</version>
+ <version>1.0.0-alpha-6</version>
</parent>
<dependencies>
Modified: wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/pom.xml
===================================================================
--- wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/pom.xml 2010-02-08 09:35:55 UTC (rev 381)
+++ wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/pom.xml 2010-02-09 09:32:40 UTC (rev 382)
@@ -7,7 +7,7 @@
<parent>
<groupId>org.sharengo.wikengo</groupId>
<artifactId>core-wikitty</artifactId>
- <version>1.0.0-alpha-6-SNAPSHOT</version>
+ <version>1.0.0-alpha-6</version>
</parent>
<dependencies>
Modified: wikengo_core-wikitty/wikengo_core-wikitty-solr-impl/pom.xml
===================================================================
--- wikengo_core-wikitty/wikengo_core-wikitty-solr-impl/pom.xml 2010-02-08 09:35:55 UTC (rev 381)
+++ wikengo_core-wikitty/wikengo_core-wikitty-solr-impl/pom.xml 2010-02-09 09:32:40 UTC (rev 382)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.sharengo.wikengo</groupId>
<artifactId>core-wikitty</artifactId>
- <version>1.0.0-alpha-6-SNAPSHOT</version>
+ <version>1.0.0-alpha-6</version>
</parent>
<dependencies>
1
0
r381 - in wikengo_core-wikitty: wikengo_core-wikitty-api/src/main/java/org/sharengo/wikitty wikengo_core-wikitty-jdbc-impl/src/main/java/org/sharengo/wikitty/jdbc
by schorlet@users.nuiton.org 08 Feb '10
by schorlet@users.nuiton.org 08 Feb '10
08 Feb '10
Author: schorlet
Date: 2010-02-08 10:35:55 +0100 (Mon, 08 Feb 2010)
New Revision: 381
Modified:
wikengo_core-wikitty/wikengo_core-wikitty-api/src/main/java/org/sharengo/wikitty/AbstractWikittyService.java
wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/src/main/java/org/sharengo/wikitty/jdbc/WikittyStorageJDBC.java
Log:
remplacement des system.out par log.debug
Modified: wikengo_core-wikitty/wikengo_core-wikitty-api/src/main/java/org/sharengo/wikitty/AbstractWikittyService.java
===================================================================
--- wikengo_core-wikitty/wikengo_core-wikitty-api/src/main/java/org/sharengo/wikitty/AbstractWikittyService.java 2010-02-08 09:27:40 UTC (rev 380)
+++ wikengo_core-wikitty/wikengo_core-wikitty-api/src/main/java/org/sharengo/wikitty/AbstractWikittyService.java 2010-02-08 09:35:55 UTC (rev 381)
@@ -255,7 +255,7 @@
public PagedResult<Wikitty> findAllByCriteria(Criteria criteria) {
- System.out.println("facetField : " + criteria.getFacetField());
+ log.debug("facetField : " + criteria.getFacetField());
PagedResult<String> resultId = getSearchEngine().findAllByCriteria(criteria);
PagedResult<Wikitty> result = resultId.cast(getWikittyStorage());
return result;
Modified: wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/src/main/java/org/sharengo/wikitty/jdbc/WikittyStorageJDBC.java
===================================================================
--- wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/src/main/java/org/sharengo/wikitty/jdbc/WikittyStorageJDBC.java 2010-02-08 09:27:40 UTC (rev 380)
+++ wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/src/main/java/org/sharengo/wikitty/jdbc/WikittyStorageJDBC.java 2010-02-08 09:35:55 UTC (rev 381)
@@ -341,7 +341,7 @@
wikitty.getId(), ext.getName(),
fieldName, booleanValue.toString()));
} else {
- System.out.println("#####DEBUG####" + type.toDefinition(fieldName));
+ log.debug(type.toDefinition(fieldName));
if (type.isNotNull()) {
throw new WikittyException(String.format("Field %s in extension %s can't be null",
fieldName, ext.getName()));
@@ -356,7 +356,7 @@
wikitty.getId(), ext.getName(), fieldName,
"'" + new Timestamp(dateValue.getTime()) + "'"));
} else {
- System.out.println("#####DEBUG####" + type.toDefinition(fieldName));
+ log.debug(type.toDefinition(fieldName));
if (type.isNotNull()) {
throw new WikittyException(String.format("Field %s in extension %s can't be null",
fieldName, ext.getName()));
@@ -371,7 +371,7 @@
wikitty.getId(), ext.getName(),
fieldName, numberValue.toString()));
} else {
- System.out.println("#####DEBUG####" + type.toDefinition(fieldName));
+ log.debug(type.toDefinition(fieldName));
if (type.isNotNull()) {
throw new WikittyException(String.format("Field %s in extension %s can't be null",
fieldName, ext.getName()));
@@ -386,7 +386,7 @@
wikitty.getId(), ext.getName(),
fieldName, "'" + stringValue.replace("'", "''") + "'"));
} else {
- System.out.println("#####DEBUG####" + type.toDefinition(fieldName));
+ log.debug(type.toDefinition(fieldName));
if (type.isNotNull()) {
throw new WikittyException(String.format("Field %s in extension %s can't be null",
fieldName, ext.getName()));
@@ -401,7 +401,7 @@
wikitty.getId(), ext.getName(),
fieldName, "'" + objectValue.toString().replace("'", "''") + "'"));
} else {
- System.out.println("#####DEBUG####" + type.toDefinition(fieldName));
+ log.debug(type.toDefinition(fieldName));
if (type.isNotNull()) {
throw new WikittyException(String.format("Field %s in extension %s can't be null",
fieldName, ext.getName()));
@@ -416,7 +416,7 @@
wikitty.getId(), ext.getName(),
fieldName, "'" + objectValue.toString().replace("'", "''") + "'"));
} else {
- System.out.println("#####DEBUG####" + type.toDefinition(fieldName));
+ log.debug(type.toDefinition(fieldName));
if (type.isNotNull()) {
throw new WikittyException(String.format("Field %s in extension %s can't be null",
fieldName, ext.getName()));
1
0
r380 - in testgenerationpdf/trunk: . lib src/main/java/org/codelutin src/main/resources
by echatellier@users.nuiton.org 08 Feb '10
by echatellier@users.nuiton.org 08 Feb '10
08 Feb '10
Author: echatellier
Date: 2010-02-08 10:27:40 +0100 (Mon, 08 Feb 2010)
New Revision: 380
Added:
testgenerationpdf/trunk/lib/
testgenerationpdf/trunk/lib/readme.txt
Removed:
testgenerationpdf/trunk/src/main/java/org/codelutin/itext/
Modified:
testgenerationpdf/trunk/pom.xml
testgenerationpdf/trunk/src/main/resources/index.html
Log:
Update (test yahp 1.2.20a)
Added: testgenerationpdf/trunk/lib/readme.txt
===================================================================
--- testgenerationpdf/trunk/lib/readme.txt (rev 0)
+++ testgenerationpdf/trunk/lib/readme.txt 2010-02-08 09:27:40 UTC (rev 380)
@@ -0,0 +1,9 @@
+You need all yahp libaries and deps to compile this project.
+
+yahp-1.2.20a.jar
+yahp-internal-1.2.20a.jar
+yahp-itext-1.2.20a.jar (official 2.0.8 not working)
+yahp-shanijar-1.2.20a.jar
+yahp-xmlapi-1.2.20a.jar
+core-renderer-r8.jar (from https://xhtmlrenderer.dev.java.net/ official working)
+yahp-jtidy-1.2.20a.jar (official may work ???)
\ No newline at end of file
Modified: testgenerationpdf/trunk/pom.xml
===================================================================
--- testgenerationpdf/trunk/pom.xml 2010-02-07 07:39:23 UTC (rev 379)
+++ testgenerationpdf/trunk/pom.xml 2010-02-08 09:27:40 UTC (rev 380)
@@ -37,9 +37,16 @@
<scope>compile</scope>
</dependency>
<dependency>
- <groupId>com.lowagie</groupId>
- <artifactId>itext</artifactId>
- <version>2.1.7</version>
- </dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ <version>1.1.1</version>
+ <scope>compile</scope>
+ </dependency>
</dependencies>
</project>
Modified: testgenerationpdf/trunk/src/main/resources/index.html
===================================================================
--- testgenerationpdf/trunk/src/main/resources/index.html 2010-02-07 07:39:23 UTC (rev 379)
+++ testgenerationpdf/trunk/src/main/resources/index.html 2010-02-08 09:27:40 UTC (rev 380)
@@ -10,7 +10,7 @@
</head>
<body>
-C'était un bel été<br />
+C'était un bel été<br />
Il pleuvait !
</body>
</html>
1
0
r379 - wikengo_core-wikitty/wikengo_core-wikitty-api/src/main/java/org/sharengo/wikitty
by schorlet@users.nuiton.org 07 Feb '10
by schorlet@users.nuiton.org 07 Feb '10
07 Feb '10
Author: schorlet
Date: 2010-02-07 08:39:23 +0100 (Sun, 07 Feb 2010)
New Revision: 379
Modified:
wikengo_core-wikitty/wikengo_core-wikitty-api/src/main/java/org/sharengo/wikitty/WikittyProxy.java
Log:
ajout du support des criteres de tri dans la recherche
Modified: wikengo_core-wikitty/wikengo_core-wikitty-api/src/main/java/org/sharengo/wikitty/WikittyProxy.java
===================================================================
--- wikengo_core-wikitty/wikengo_core-wikitty-api/src/main/java/org/sharengo/wikitty/WikittyProxy.java 2010-02-05 21:58:45 UTC (rev 378)
+++ wikengo_core-wikitty/wikengo_core-wikitty-api/src/main/java/org/sharengo/wikitty/WikittyProxy.java 2010-02-07 07:39:23 UTC (rev 379)
@@ -17,7 +17,15 @@
package org.sharengo.wikitty;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.Map.Entry;
import org.sharengo.wikitty.search.Element;
@@ -216,6 +224,17 @@
Criteria serviceCriteria = search.criteria(criteria.getName());
serviceCriteria.setFirstIndex(criteria.getFirstIndex());
serviceCriteria.setEndIndex(criteria.getEndIndex());
+
+ List<String> sortAscending = criteria.getSortAscending();
+ if (sortAscending != null) {
+ serviceCriteria.setSortAscending(sortAscending.toArray(new String[sortAscending.size()]));
+ }
+
+ List<String> sortDescending = criteria.getSortDescending();
+ if (sortDescending != null) {
+ serviceCriteria.setSortDescending(sortDescending.toArray(new String[sortDescending.size()]));
+ }
+
List<String> fieldFacets = criteria.getFacetField();
if(fieldFacets != null) {
serviceCriteria.setFacetField(fieldFacets.toArray(new String[fieldFacets.size()]));
1
0