[jbosstools-commits] JBoss Tools SVN: r30376 - in trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest: dialogs and 2 other directories.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Wed Apr 6 11:38:35 EDT 2011
Author: elvisisking
Date: 2011-04-06 11:38:34 -0400 (Wed, 06 Apr 2011)
New Revision: 30376
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/PublishedLocationsDialog.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilter.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
Log:
JBIDE-8688 ModeShape Tools' Published Locations Dialog's Table Is Sized Too Small When It Contains Just A Couple Rows. Table is now being sized based on number of workspace locations found. And, if needed, a few extra rows are being added to make it look better.
JBIDE-8689 ModeShape Tools' Folder Filter Should Also Filter Projects. Modified the filter to also filter out projects whose names match a name contained in the folder name preference.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2011-04-06 15:30:55 UTC (rev 30375)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2011-04-06 15:38:34 UTC (rev 30376)
@@ -109,7 +109,7 @@
publishPageNoAvailableRepositoriesStatusMsg = There are no repositories available on that server, or a \nconnection to the server cannot be made.
publishPageNoAvailableServersStatusMsg = A server must be created first
publishPageNoAvailableWorkspacesStatusMsg = There are no JCR workspaces available on that server and repository, or a \nconnection to the server cannot be made.
-publishPageNoResourcesToPublishStatusMsg = There are no files that can be published (See preference filter settings).
+publishPageNoResourcesToPublishStatusMsg = There are no files that can be published (may be due to your file filter preferences).
publishPageNoResourcesToUnpublishStatusMsg = There are no files that can be unpublished
publishPageOpenPreferencePageLink = ( change default in your <a>preferences</a> )
publishPagePublishOkStatusMsg = Choose the location of the JCR repository where your local files \nand folders will be published, and then click "Finish."
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/PublishedLocationsDialog.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/PublishedLocationsDialog.java 2011-04-06 15:30:55 UTC (rev 30375)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/PublishedLocationsDialog.java 2011-04-06 15:38:34 UTC (rev 30376)
@@ -16,7 +16,9 @@
import static org.jboss.tools.modeshape.rest.IUiConstants.REPOSITORY_IMAGE;
import static org.jboss.tools.modeshape.rest.IUiConstants.SERVER_IMAGE;
import static org.jboss.tools.modeshape.rest.IUiConstants.WORKSPACE_IMAGE;
+
import java.util.Collection;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -46,8 +48,8 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.jboss.tools.modeshape.rest.Activator;
+import org.jboss.tools.modeshape.rest.PublishedResourceHelper.WorkspaceLocation;
import org.jboss.tools.modeshape.rest.RestClientI18n;
-import org.jboss.tools.modeshape.rest.PublishedResourceHelper.WorkspaceLocation;
import org.modeshape.common.util.CheckArg;
import org.modeshape.web.jcr.rest.client.domain.Server;
@@ -136,7 +138,7 @@
RestClientI18n.publishedLocationsDialogMsg.text(file.getFullPath()), MessageDialog.INFORMATION,
new String[] {IDialogConstants.OK_LABEL}, 0);
- CheckArg.isNotNull(workspaceLocations, "workspaceLocations");
+ CheckArg.isNotNull(workspaceLocations, "workspaceLocations"); //$NON-NLS-1$
this.workspaceLocations = workspaceLocations;
// make sure dialog is resizable
@@ -185,6 +187,12 @@
table.setLayoutData(new GridData(GridData.FILL_BOTH));
table.setHeaderVisible(true);
table.setLinesVisible(true);
+
+ // set height of table
+ ((GridData)table.getLayoutData()).minimumHeight = (table.getItemHeight() * 3);
+ int locations = this.workspaceLocations.size() + 2;
+ int numRows = (locations < 6) ? locations : Math.min(locations, 12);
+ ((GridData)table.getLayoutData()).heightHint = (table.getItemHeight() * numRows);
// create columns
for (int numCols = COLUMNS.length, i = 0; i < numCols; ++i) {
@@ -347,7 +355,7 @@
// should never get here
assert false;
- return "";
+ return ""; //$NON-NLS-1$
}
/**
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilter.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilter.java 2011-04-06 15:30:55 UTC (rev 30375)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilter.java 2011-04-06 15:38:34 UTC (rev 30376)
@@ -17,6 +17,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.jboss.tools.modeshape.rest.Activator;
import org.modeshape.common.util.CheckArg;
@@ -55,7 +56,7 @@
public boolean accept( IResource resource ) {
CheckArg.isNotNull(resource, "resource"); //$NON-NLS-1$
- if (resource instanceof IFolder) {
+ if ((resource instanceof IFolder) || (resource instanceof IProject)) {
String name = resource.getName();
// see if folder name has been filtered
@@ -83,7 +84,6 @@
}
}
- // must be project
return true;
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2011-04-06 15:30:55 UTC (rev 30375)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2011-04-06 15:38:34 UTC (rev 30376)
@@ -101,6 +101,12 @@
PublishingFileFilter filter ) throws CoreException {
List<IFile> result = new ArrayList<IFile>();
+ if (((container instanceof IProject) && !((IProject) container).isOpen())
+ || ((filter != null) && !filter.accept(container))) {
+ return result;
+ }
+
+ // process container members
for (IResource member : container.members()) {
if (recurse && (member instanceof IContainer)) {
// don't select closed projects
More information about the jbosstools-commits
mailing list