Changeset 34691
- Timestamp:
- 03/23/06 17:10:44 (4 years ago)
- Files:
-
- com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/resources/Comment.java (added)
- com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/resources/ResourceFactory.java (modified) (2 diffs)
- com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/resources/ResourceManager.java (modified) (1 diff)
- com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/resources/query/GetCommentsQuery.java (added)
- com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/resources/query/Queries.java (modified) (1 diff)
- com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/vocabulary/CPS.java (modified) (2 diffs)
- com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/vocabulary/CPSM.java (modified) (1 diff)
- com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/ui/views/NotesProvider.java (added)
- com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/ui/views/NotesView.java (modified) (1 diff)
- com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/ui/views/SearchView.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/resources/ResourceFactory.java
r29811 r34691 26 26 import com.nuxeo.sdr.core.util.Assert; 27 27 import com.nuxeo.sdr.core.vocabulary.CPS; 28 import com.nuxeo.sdr.core.vocabulary.CPSM; 28 29 import com.nuxeo.sdr.core.vocabulary.SDR; 29 30 … … 75 76 76 77 77 78 public final static ResourceDescriptor COMMENT 79 = new ResourceDescriptor(CPSM.COMMENT, Comment.class, 80 "documents", null, null); 78 81 79 82 public final static ResourceDescriptor ATTACHMENT com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/resources/ResourceManager.java
r32700 r34691 77 77 return new IResource[] {}; 78 78 } 79 80 79 80 81 public static IResource[] getComments(IResource resource) { 82 IResourceStore store = RepositoryCore.getDefaultRepository().getDocumentStore(); 83 Queries.GET_COMMENTS.setUri(resource.getUri()); 84 try { 85 return (IResource[])Queries.GET_COMMENTS.run(store); 86 } catch (QueryException e) { 87 e.printStackTrace(); 88 } 89 return new IResource[] {}; 90 } 91 81 92 82 93 /** com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/resources/query/Queries.java
r32700 r34691 42 42 public final static GetRevisionsQuery GET_REVISIONS = new GetRevisionsQuery(); 43 43 public final static GetSelectedResourcesQuery GET_SELECTED_RESOURCES= new GetSelectedResourcesQuery(); 44 45 public final static GetCommentsQuery GET_COMMENTS= new GetCommentsQuery(); 44 46 } 45 47 com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/vocabulary/CPS.java
r32700 r34691 73 73 public static final String PN_LEGIFRANCE_ARTICLE_RANGE = PREFIX + ":" + SN_LEGIFRANCE_ARTICLE_RANGE; 74 74 75 76 77 75 public static final String OUVRAGE = NAMESPACE + SN_OUVRAGE; 78 76 public static final String SECTIONOUVRAGE = NAMESPACE + SN_SECTIONOUVRAGE; … … 91 89 public static final String LEGIFRANCE_ARTICLE_RANGE = NAMESPACE + SN_LEGIFRANCE_ARTICLE_RANGE; 92 90 91 public final static String SN_HASCOMMENT = "hasComment"; 92 public final static String PN_HASCOMMENT = PREFIX + ":" + SN_HASCOMMENT; 93 public final static String HASCOMMENT = NAMESPACE+ SN_HASCOMMENT; 93 94 94 95 } com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/core/vocabulary/CPSM.java
r31681 r34691 22 22 public final static String PN_DOCUMENTTYPE = PREFIX + ":" + SN_DOCUMENTTYPE; 23 23 public final static String DOCUMENTTYPE = NAMESPACE+ SN_DOCUMENTTYPE; 24 25 public final static String SN_AUTHOR = "author"; 26 public final static String PN_AUTHOR = PREFIX + ":" + SN_AUTHOR; 27 public final static String AUTHOR = NAMESPACE+ SN_AUTHOR; 28 29 public final static String SN_CREATOR = "Creator"; 30 public final static String PN_CREATOR = PREFIX + ":" + SN_CREATOR; 31 public final static String CREATOR = NAMESPACE+ SN_CREATOR; 24 32 33 public final static String SN_MODIFICATIONDATE = "ModificationDate"; 34 public final static String PN_MODIFICATIONDATE = PREFIX + ":" + SN_MODIFICATIONDATE; 35 public final static String MODIFICATIONDATE = NAMESPACE+ SN_MODIFICATIONDATE; 36 37 public final static String SN_COMMENT = "comment"; 38 public final static String PN_COMMENT = PREFIX + ":" + SN_COMMENT; 39 public final static String COMMENT = NAMESPACE+ SN_COMMENT; 25 40 } com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/ui/views/NotesView.java
r28128 r34691 1 1 /* 2 * (C) Copyright 2002 - 2005 Nuxeo SARL <http://nuxeo.com>3 *4 * This program is free software; you can redistribute it and/or modify5 * it under the terms of the GNU General Public License version 2 as published6 * by the Free Software Foundation.7 *8 * This program is distributed in the hope that it will be useful,9 * but WITHOUT ANY WARRANTY; without even the implied warranty of10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11 * GNU General Public License for more details.12 *13 * You should have received a copy of the GNU General Public License14 * along with this program; if not, write to the Free Software15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA16 * 02111-1307, USA.17 *18 *19 * $Id$20 */2 * (C) Copyright 2002 - 2005 Nuxeo SARL <http://nuxeo.com> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 2 as published 6 * by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program; if not, write to the Free Software 15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 16 * 02111-1307, USA. 17 * 18 * 19 * $Id$ 20 */ 21 21 22 22 package com.nuxeo.sdr.ui.views; 23 23 24 import org.eclipse.jface.viewers.TableViewer; 25 import org.eclipse.swt.SWT; 26 import org.eclipse.swt.widgets.Composite; 27 import org.eclipse.swt.widgets.Table; 28 import org.eclipse.swt.widgets.TableColumn; 29 import org.eclipse.ui.IEditorPart; 30 import org.nuxeo.eclipse.ui.UI; 31 32 import com.nuxeo.sdr.core.resources.Document; 33 import com.nuxeo.sdr.core.resources.IResource; 24 34 import com.nuxeo.sdr.core.util.IResourceActionListener; 35 import com.nuxeo.sdr.ui.browser.BrowserEditor; 25 36 26 public class NotesView extends EditorInfoView implements IResourceActionListener{ 37 public class NotesView extends EditorInfoView implements 38 IResourceActionListener { 27 39 28 public void actionPerformed(Object target, int actionID) { 40 protected TableViewer mTable; 41 42 protected NotesProvider mProvider; 43 44 public void createPartControl(Composite parent) { 45 mProvider = new NotesProvider(); 46 mTable = new TableViewer(parent); 47 Table table = mTable.getTable(); 48 table.setLinesVisible(true); 49 table.setHeaderVisible(true); 50 51 TableColumn col = null; 52 53 col = new TableColumn(table, SWT.LEFT); 54 col.setText("Title"); 55 col.setResizable(true); 56 col.setWidth(150); 57 58 col = new TableColumn(table, SWT.LEFT); 59 col.setText("Author"); 60 col.setResizable(true); 61 col.setWidth(100); 62 63 col = new TableColumn(table, SWT.LEFT); 64 col.setText("Comment"); 65 col.setResizable(true); 66 col.setWidth(200); 67 68 col = new TableColumn(table, SWT.LEFT); 69 col.setText("Modification Date"); 70 col.setResizable(true); 71 col.setWidth(75); 29 72 30 73 74 mTable.setContentProvider(mProvider); 75 mTable.setLabelProvider(mProvider); 76 editorChanged(getActiveEditor()); 77 } 78 79 public void editorChanged(IEditorPart editor) { 80 if (editor instanceof BrowserEditor) { 81 IResource resource = (IResource)editor.getEditorInput().getAdapter(IResource.class); 82 if(resource instanceof Document) { 83 mTable.setInput(resource); 84 } 85 } else { 86 mTable.setInput(null); 87 } 88 } 89 90 91 public void actionPerformed(Object target, int actionID) { 92 31 93 } 32 94 com.nuxeo.sdr/trunk/src/com/nuxeo/sdr/ui/views/SearchView.java
r34615 r34691 105 105 mViewer = new TableViewer( parent, SWT.H_SCROLL | SWT.V_SCROLL ); 106 106 updateProvider(); 107 108 109 110 // Tree tree = mViewer.getTree(); 107 111 108 Table table = mViewer.getTable(); 112 109 table.setLinesVisible(true); … … 114 111 115 112 116 // Listener keyListener = new Listener() {117 // public void handleEvent(Event event) {118 // if ( event.type == SWT.KeyUp && event.keyCode == SWT.CONTROL ){119 // mIsCtrlPressed = false;120 // }121 // if ( event.type == SWT.KeyDown && event.keyCode == SWT.CONTROL ){122 // mIsCtrlPressed = true;123 // }124 // }125 // };126 // mViewer.getTable().addListener(SWT.KeyDown, keyListener);127 // mViewer.getTable().addListener(SWT.KeyUp, keyListener);128 129 113 mViewer.getTable().addMouseListener(new MouseListener(){ 130 114 public void mouseDoubleClick(MouseEvent mouseEvent) {} … … 136 120 }); 137 121 138 139 140 141 122 142 123
