|
From: Robert E. <sky...@us...> - 2006-05-15 13:34:56
|
Update of /cvsroot/jcommander/plugins/org.jcommander.ui.filepanel/src/org/jcommander/ui/filepanel/bookmarks In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19072/src/org/jcommander/ui/filepanel/bookmarks Modified Files: BookmarkPanel.java BookmarkComposite.java Log Message: Reorganized the bookmark panel's "Go to parent" button Index: BookmarkPanel.java =================================================================== RCS file: /cvsroot/jcommander/plugins/org.jcommander.ui.filepanel/src/org/jcommander/ui/filepanel/bookmarks/BookmarkPanel.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** BookmarkPanel.java 25 Apr 2006 08:00:28 -0000 1.17 --- BookmarkPanel.java 15 May 2006 13:34:52 -0000 1.18 *************** *** 13,16 **** --- 13,20 ---- import org.jcommander.phileas.bookmarks.*; import org.jcommander.ui.filepanel.controls.*; + import org.eclipse.swt.widgets.Button; + import org.eclipse.swt.SWT; + import org.eclipse.swt.widgets.Label; + import org.eclipse.swt.graphics.Point; /** * TODO Insert class comment here. *************** *** 23,27 **** private BookmarkComposite bookmarkComposite = null; // private Button rightScrollButton = null; ! private Button goUpButton = null; // private Button startScrollButton = null; // private Button endScrollButton = null; --- 27,31 ---- private BookmarkComposite bookmarkComposite = null; // private Button rightScrollButton = null; ! private Button goToParentGroupButton = null; // private Button startScrollButton = null; // private Button endScrollButton = null; *************** *** 31,36 **** private Bookmark currentBookmark; private Composite composite = null; ! private Label curBookmarkParentLabel = null; private FilePanel filePanel; public BookmarkPanel(Composite parent, int style) { --- 35,41 ---- private Bookmark currentBookmark; private Composite composite = null; ! private Label crtBookmarkParentLabel = null; private FilePanel filePanel; + private Label crtGroupLabel = null; public BookmarkPanel(Composite parent, int style) { *************** *** 60,63 **** --- 65,69 ---- createComposite2(); // startScrollButton = new Button(this, SWT.ARROW | SWT.LEFT | SWT.BORDER); + // startScrollButton.setEnabled(false); // *************** *** 72,76 **** // endScrollButton.setEnabled(false); - goUpButton = new Button(this, SWT.ARROW | SWT.UP); this.setLayout(gridLayout1); gridLayout1.numColumns = 6; --- 78,81 ---- *************** *** 84,90 **** // rightScrollButton.setText(">"); // rightScrollButton.setToolTipText("Scroll right"); - goUpButton.setText("^"); - goUpButton.setEnabled(true); - goUpButton.setToolTipText("Go to parent bookmark group"); // startScrollButton.setText("|<"); // startScrollButton.setToolTipText("Scroll to start"); --- 89,92 ---- *************** *** 95,101 **** gridData5.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER; gridData5.grabExcessVerticalSpace = false; ! setSize(new org.eclipse.swt.graphics.Point(482,40)); ! goUpButton.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() { public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { gotoParentBookmark(); --- 97,103 ---- gridData5.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER; gridData5.grabExcessVerticalSpace = false; ! this.setSize(new Point(482, 90)); ! goToParentGroupButton.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() { public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { gotoParentBookmark(); *************** *** 134,138 **** gridData2.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL; gridData2.verticalAlignment = org.eclipse.swt.layout.GridData.FILL; - gridData2.verticalSpan = 2; bookmarkComposite.setLayoutData(gridData2); bookmarkComposite.setLayout(null); --- 136,139 ---- *************** *** 160,165 **** bookmarkComposite.setBookmarks(bookmark.getChildren()); ! curBookmarkParentLabel.setText(currentBookmark.computePath()); ! goUpButton.setEnabled(currentBookmark.getParent() != null); } --- 161,166 ---- bookmarkComposite.setBookmarks(bookmark.getChildren()); ! crtBookmarkParentLabel.setText(currentBookmark.computePath()); ! goToParentGroupButton.setEnabled(currentBookmark.getParent() != null); } *************** *** 214,218 **** GridData gridData1 = new GridData(); composite = new Composite(this, SWT.NONE); ! curBookmarkParentLabel = new Label(composite, SWT.NONE); gridData1.horizontalSpan = 6; gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL; --- 215,226 ---- GridData gridData1 = new GridData(); composite = new Composite(this, SWT.NONE); ! crtGroupLabel = new Label(composite, SWT.NONE); ! crtGroupLabel.setText("Current:"); ! crtBookmarkParentLabel = new Label(composite, SWT.NONE); ! goToParentGroupButton = new Button(composite, SWT.PUSH); ! goToParentGroupButton.setText("Go up"); ! goToParentGroupButton.setToolTipText("Go to parent bookmark group"); ! goToParentGroupButton.setEnabled(true); ! goToParentGroupButton.setSize(goToParentGroupButton.getSize().x, crtBookmarkParentLabel.getSize().y); gridData1.horizontalSpan = 6; gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL; *************** *** 220,226 **** composite.setLayoutData(gridData1); composite.setLayout(gridLayout2); ! curBookmarkParentLabel.setText("Label"); ! curBookmarkParentLabel.setLayoutData(gridData11); gridLayout2.marginHeight = 1; gridLayout2.marginWidth = 1; gridLayout2.horizontalSpacing = 1; --- 228,235 ---- composite.setLayoutData(gridData1); composite.setLayout(gridLayout2); ! crtBookmarkParentLabel.setText(""); ! crtBookmarkParentLabel.setLayoutData(gridData11); gridLayout2.marginHeight = 1; + gridLayout2.numColumns = 3; gridLayout2.marginWidth = 1; gridLayout2.horizontalSpacing = 1; *************** *** 228,231 **** --- 237,241 ---- gridData11.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL; gridData11.grabExcessHorizontalSpace = true; + } *************** *** 241,243 **** --- 251,257 ---- this.filePanel = filePanel; } + + public Point computeSize(int wHint, int hHint, boolean changed) { + return new Point(wHint, composite.computeSize(wHint, hHint, changed).y + bookmarkComposite.computeSize(wHint, hHint, changed).y); + } } // @jve:decl-index=0:visual-constraint="10,10" Index: BookmarkComposite.java =================================================================== RCS file: /cvsroot/jcommander/plugins/org.jcommander.ui.filepanel/src/org/jcommander/ui/filepanel/bookmarks/BookmarkComposite.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** BookmarkComposite.java 25 Apr 2006 09:27:58 -0000 1.21 --- BookmarkComposite.java 15 May 2006 13:34:52 -0000 1.22 *************** *** 340,344 **** public Point computeSize(int wHint, int hHint, boolean changed) { ! return new Point(10,10); } --- 340,344 ---- public Point computeSize(int wHint, int hHint, boolean changed) { ! return new Point(wHint, toolbar.computeSize(wHint, hHint, changed).y * 12/10); } |