JBoss Tools SVN: r26687 - in trunk/modeshape/plugins/org.jboss.tools.modeshape.rest: docs/images and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2010-11-17 13:56:32 -0500 (Wed, 17 Nov 2010)
New Revision: 26687
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishDialog.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerDialog.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerView.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/Toc.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ModeShapeMessageConsole.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/PublishDialog.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ServerView.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PublishedResourceHelper.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java
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/actions/ShowPublishedLocationsHandler.java
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/jobs/PublishJob.java
Log:
JBDS-1402 Cannot enter the ModeShape workspace path. The ModeShape workspace area is a path segment that is prepended to the resource project path. Mostly changes related to the property that persists the workspace locations files are published to. Also related documentation changes.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishDialog.html
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishDialog.html 2010-11-17 18:55:33 UTC (rev 26686)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishDialog.html 2010-11-17 18:56:32 UTC (rev 26687)
@@ -37,6 +37,10 @@
<td>allows selection of a workspace of the selected repository</td>
</tr>
<tr>
+ <td align="right"><strong>Workspace Area Text Field</strong> </td>
+ <td>the root path in the workspace where files will be published</td>
+</tr>
+<tr>
<td align="right"><strong>Resources List</strong> </td>
<td>a list of all the selected files that will be published or unpublished</td>
</tr>
@@ -46,7 +50,12 @@
</tr>
</table>
-<p>A server must be selected before a repository can be selected. Likewise, a repository must be selected before a workspace can be selected. The message area at the top of the dialog will indicate the type of operation (publish or unpublish) and if there is any missing information. Once the workspace has been selected the 'Finish' button will be enabled and the operation can be executed. These operations can be run in the background so that multiple operations can be run at the same time. The <a href="ModeShapeMessageConsole.html">ModeShape Message Console</a> displays output from the operations.</p>
+<p>A server must be selected before a repository can be selected. Likewise, a repository must be selected before a workspace
+can be selected. The message area at the top of the dialog will indicate the type of operation (publish or unpublish) and if
+there is any missing information. The workspace area is a path segment in the workspace that will be used as the root path
+for the publishing operation. Once the workspace has been selected the 'Finish' button will be enabled and the operation
+can be executed. These operations can be run in the background so that multiple operations can be run at the same time.
+The <a href="ModeShapeMessageConsole.html">ModeShape Message Console</a> displays output from the operations.</p>
<h3>Related Topics</h3>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerDialog.html
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerDialog.html 2010-11-17 18:55:33 UTC (rev 26686)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerDialog.html 2010-11-17 18:56:32 UTC (rev 26687)
@@ -42,11 +42,11 @@
</tr>
</table>
-<p>Once all server properties have been entered the 'Finish' button will be enabled and the new server can be created or the existing server's properties can be modified. You can display the Server Dialog from the Server View and from the Publish/Unpublish Dialog.</p>
+<p>Once all server properties have been entered the 'Finish' button will be enabled and the new server can be created or the existing server's properties can be modified. You can display the Server Dialog from the ModeShape View and from the Publish/Unpublish Dialog.</p>
<h3>Related Topics</h3>
<ul>
-<li><a href="ServerView.html">Server View</a></li>
+<li><a href="ServerView.html">ModeShape View</a></li>
<li><a href="PublishDialog.html">Publishing and Unpublishing Dialog</a></li>
</ul>
\ No newline at end of file
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerView.html
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerView.html 2010-11-17 18:55:33 UTC (rev 26686)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerView.html 2010-11-17 18:56:32 UTC (rev 26687)
@@ -9,15 +9,15 @@
- See the AUTHORS.txt file in the distribution for a full listing of
- individual contributors.
-->
-<h2>ModeShape Server View</h2>
+<h2>ModeShape View</h2>
-<p>The <i>Server View</i> displays the registered servers hosting ModeShape repositories. For each server, the repositories and repository workspaces are also displayed. There are view toolbar buttons to create a new server (<img src="images/new_server.gif" border="0" alt="">), edit a selected server's properties (<img src="images/edit_server.gif" border="0" alt="">), discard one or more selected servers (<img src="images/delete_server.gif" border="0" alt="">), reconnect to a selected server (<img src="images/refresh.gif" border="0" alt="">), and collapse all servers so that their repositories and workspaces can't be seen (<img src="images/collapse_all.gif" border="0" alt="">). If a connection to a server cannot be established that server icon will be decorated with an error overlay image.</p>
+<p>The <i>ModeShape View</i> displays the registered servers hosting ModeShape repositories. For each server, the repositories and repository workspaces are also displayed. There are view toolbar buttons to create a new server (<img src="images/new_server.gif" border="0" alt="">), edit a selected server's properties (<img src="images/edit_server.gif" border="0" alt="">), discard one or more selected servers (<img src="images/delete_server.gif" border="0" alt="">), reconnect to a selected server (<img src="images/refresh.gif" border="0" alt="">), and collapse all servers so that their repositories and workspaces can't be seen (<img src="images/collapse_all.gif" border="0" alt="">). If a connection to a server cannot be established that server icon will be decorated with an error overlay image.</p>
-<p>Here is what the <i>Server View</i> looks like:</p>
+<p>Here is what the <i>ModeShape View</i> looks like:</p>
<img src="images/ServerView.png" border="0" alt="">
-<p>The view's context menu includes the new server, edit server properties, discard server, and reconnect to server actions. Here is what the Server View context menu looks like:</p>
+<p>The view's context menu includes the new server, edit server properties, discard server, and reconnect to server actions. Here is what the ModeShape View context menu looks like:</p>
<img src="images/ServerViewContextMenu.png" border="0" alt="">
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/Toc.html
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/Toc.html 2010-11-17 18:55:33 UTC (rev 26686)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/Toc.html 2010-11-17 18:56:32 UTC (rev 26687)
@@ -14,7 +14,7 @@
<ul>
<li><a href="PublishDialog.html">Publish/Unpublish Dialog</a></li>
<li><a href="ServerDialog.html">Server Dialog</a></li>
-<li><a href="ServerView.html">Server View</a></li>
+<li><a href="ServerView.html">ModeShape View</a></li>
<li><a href="ModeShapeMessageConsole.html">ModeShape Message Console</a></li>
<li><a href="PublishedLocationsDialog.html">Published Locations Dialog</a></li>
<li><a href="ResourceContextMenu.html">Resource Context Menu</a></li>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ModeShapeMessageConsole.png
===================================================================
(Binary files differ)
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/PublishDialog.png
===================================================================
(Binary files differ)
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ServerView.png
===================================================================
(Binary files differ)
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PublishedResourceHelper.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PublishedResourceHelper.java 2010-11-17 18:55:33 UTC (rev 26686)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PublishedResourceHelper.java 2010-11-17 18:56:32 UTC (rev 26687)
@@ -19,6 +19,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.QualifiedName;
import org.modeshape.common.util.CheckArg;
+import org.modeshape.common.util.HashCode;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.Status.Severity;
import org.modeshape.web.jcr.rest.client.domain.Repository;
@@ -80,64 +81,70 @@
/**
* @param file the file that was just published (never <code>null</code>)
* @param workspace the workspace where the file was published (never <code>null</code>)
+ * @param url the URL where the resource was published (never <code>null</code>)
* @throws Exception if there is a problem setting the property
*/
public void addPublishedProperty( IFile file,
- Workspace workspace ) throws Exception {
+ Workspace workspace,
+ String url ) throws Exception {
CheckArg.isNotNull(file, "file");
CheckArg.isNotNull(workspace, "workspace");
+ CheckArg.isNotNull(url, "url");
- Set<Workspace> workspaces = getPublishedOnWorkspaces(file);
- workspaces.add(workspace);
+ Set<WorkspaceLocation> workspaceLocations = getPublishedWorkspaceLocations(file);
+ workspaceLocations.add(new WorkspaceLocation(workspace, url));
// set new value
- setPublishedOnPropertyValue(file, workspaces);
+ setPublishedOnPropertyValue(file, workspaceLocations);
}
/**
- * @param workspaces the workspaces used to create the property value
+ * @param workspaceLocations the workspace locations used to create the property value
* @return the property value
*/
- private String createPublishedPropertyValue( Set<Workspace> workspaces ) {
+ private String createPublishedPropertyValue( Set<WorkspaceLocation> workspaceLocations ) {
StringBuilder value = new StringBuilder();
- for (Workspace workspace : workspaces) {
- value.append(createWorkspaceId(workspace)).append(DELIM);
+ for (WorkspaceLocation workspaceLocation : workspaceLocations) {
+ value.append(createWorkspaceLocationId(workspaceLocation)).append(DELIM);
}
return value.toString();
}
/**
- * @param workspace the workspace whose identifier is being created
+ * @param workspaceLocation the workspace location whose identifier is being created
* @return the ID
*/
- private String createWorkspaceId( Workspace workspace ) {
+ private String createWorkspaceLocationId( WorkspaceLocation workspaceLocation ) {
+ Workspace workspace = workspaceLocation.getWorkspace();
+
StringBuilder result = new StringBuilder();
result.append(workspace.getServer().getUrl()).append(ID_DELIM).append(workspace.getServer().getUser()).append(ID_DELIM);
result.append(workspace.getRepository().getName()).append(ID_DELIM);
- result.append(workspace.getName());
+ result.append(workspace.getName()).append(ID_DELIM);
+ result.append(workspaceLocation.getUrl());
return result.toString();
}
/**
- * @param file the file whose <code>Workspace</code>s it has been published on is being requested (never <code>null</code>)
- * @return the workspaces (never <code>null</code>)
+ * @param file the file whose published <code>WorkspaceLocation</code>s is being requested (never <code>null</code>)
+ * @return the workspace locations (never <code>null</code>)
* @throws Exception if there is a problem reading one of the file's persistent properties or a problem with the server
* manager
*/
- public Set<Workspace> getPublishedOnWorkspaces( IFile file ) throws Exception {
+ public Set<WorkspaceLocation> getPublishedWorkspaceLocations( IFile file ) throws Exception {
CheckArg.isNotNull(file, "file");
- Set<Workspace> publishedOnWorkspaces = null;
+ Set<WorkspaceLocation> publishedWorkspaceLocations = null;
String value = file.getPersistentProperty(PUBLISHED_RESOURCE_PROPERTY);
if (value == null) {
- publishedOnWorkspaces = new HashSet<Workspace>(1);
+ publishedWorkspaceLocations = new HashSet<WorkspaceLocation>(1);
} else {
StringTokenizer wsTokenizer = new StringTokenizer(value, DELIM);
- publishedOnWorkspaces = new HashSet<Workspace>(wsTokenizer.countTokens());
+ publishedWorkspaceLocations = new HashSet<WorkspaceLocation>(wsTokenizer.countTokens());
while (wsTokenizer.hasMoreTokens()) {
StringTokenizer propsTokenizer = new StringTokenizer(wsTokenizer.nextToken(), ID_DELIM);
@@ -145,11 +152,14 @@
PARSE_WORKSPACE: while (propsTokenizer.hasMoreTokens()) {
String url = propsTokenizer.nextToken();
String user = propsTokenizer.nextToken();
+
+ // find server
Server server = this.serverManager.findServer(url, user);
if ((server != null) && this.serverManager.ping(server).isOk()) {
Collection<Repository> repositories = this.serverManager.getRepositories(server);
+ // find repository
if (!repositories.isEmpty()) {
String repositoryName = propsTokenizer.nextToken();
@@ -157,12 +167,15 @@
if (repository.getName().equals(repositoryName)) {
Collection<Workspace> workspaces = this.serverManager.getWorkspaces(repository);
+ // find workspace
if (!workspaces.isEmpty()) {
String workspaceName = propsTokenizer.nextToken();
for (Workspace workspace : workspaces) {
if (workspace.getName().equals(workspaceName)) {
- publishedOnWorkspaces.add(workspace);
+ // get URL
+ String publishedUrl = propsTokenizer.nextToken();
+ publishedWorkspaceLocations.add(new WorkspaceLocation(workspace, publishedUrl));
break PARSE_WORKSPACE;
}
}
@@ -179,7 +192,7 @@
}
}
- return publishedOnWorkspaces;
+ return publishedWorkspaceLocations;
}
/**
@@ -190,7 +203,7 @@
CheckArg.isNotNull(file, "file");
try {
- return !getPublishedOnWorkspaces(file).isEmpty();
+ return !getPublishedWorkspaceLocations(file).isEmpty();
} catch (Exception e) {
Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.publishedResourcePropertyErrorMsg.text(file), e));
}
@@ -201,18 +214,21 @@
/**
* @param file the file that was just unpublished (never <code>null</code>)
* @param workspace the workspace where the file was unpublished (never <code>null</code>)
+ * @param url the URL where the resource was unpublished (never <code>null</code>)
* @throws Exception if there is a problem changing the property value
*/
public void removePublishedProperty( IFile file,
- Workspace workspace ) throws Exception {
+ Workspace workspace,
+ String url ) throws Exception {
CheckArg.isNotNull(file, "file");
CheckArg.isNotNull(workspace, "workspace");
+ CheckArg.isNotNull(url, "url");
- Set<Workspace> workspaces = getPublishedOnWorkspaces(file);
- workspaces.remove(workspace);
+ Set<WorkspaceLocation> workspaceLocations = getPublishedWorkspaceLocations(file);
+ workspaceLocations.remove(new WorkspaceLocation(workspace, url));
// set new value
- setPublishedOnPropertyValue(file, workspaces);
+ setPublishedOnPropertyValue(file, workspaceLocations);
}
/**
@@ -225,17 +241,96 @@
/**
* @param file the file whose property is being set
- * @param workspaces the workspaces the file has been published to or <code>null</code> if the file has not been published
+ * @param workspaceLocations the workspace locations the file has been published to or <code>null</code> if the file has not
+ * been published
* @throws CoreException if there was a problem changing the property value
*/
private void setPublishedOnPropertyValue( IFile file,
- Set<Workspace> workspaces ) throws CoreException {
- if ((workspaces == null) || workspaces.isEmpty()) {
+ Set<WorkspaceLocation> workspaceLocations ) throws CoreException {
+ if ((workspaceLocations == null) || workspaceLocations.isEmpty()) {
clear(file);
} else {
- String value = createPublishedPropertyValue(workspaces);
+ String value = createPublishedPropertyValue(workspaceLocations);
file.setPersistentProperty(PUBLISHED_RESOURCE_PROPERTY, value);
}
}
+ /**
+ * Holds the workspace and the URL where the file was published to.
+ */
+ public class WorkspaceLocation {
+
+ private final Workspace workspace;
+
+ private final String url;
+
+ public WorkspaceLocation( Workspace workspace,
+ String url ) {
+ this.workspace = workspace;
+ this.url = url;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals( Object obj ) {
+ if (obj == null) return false;
+ if (!getClass().equals(obj.getClass())) return false;
+
+ WorkspaceLocation thatLocation = (WorkspaceLocation)obj;
+
+ if (this.workspace.equals(thatLocation.workspace)) {
+ if ((this.url == null) || this.url.equals("")) {
+ return ((thatLocation.url == null) || thatLocation.url.equals(""));
+ }
+
+ return this.url.equals(thatLocation.url);
+ }
+
+ return false;
+ }
+
+ /**
+ * @return the repository where the workspace is located (never <code>null</code>)
+ */
+ public Repository getRepository() {
+ return this.workspace.getRepository();
+ }
+
+ /**
+ * @return the server where the workspace is located (never <code>null</code>)
+ */
+ public Server getServer() {
+ return this.workspace.getServer();
+ }
+
+ /**
+ * @return the workspace where published (never <code>null</code>)
+ */
+ public Workspace getWorkspace() {
+ return this.workspace;
+ }
+
+ /**
+ * @return the URL where the file is published (never <code>null</code>)
+ */
+ public String getUrl() {
+ return this.url;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return HashCode.compute(this.workspace, this.url);
+ }
+
+ }
+
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java 2010-11-17 18:55:33 UTC (rev 26686)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java 2010-11-17 18:56:32 UTC (rev 26687)
@@ -54,7 +54,6 @@
public static I18n publishedLocationsDialogCopyUrlButton;
public static I18n publishedLocationsDialogCopyUrlButtonToolTip;
- public static I18n publishedLocationsDialogErrorObtainingUrlMsg;
public static I18n publishedLocationsDialogFileUrlColumnHeader;
public static I18n publishedLocationsDialogMsg;
public static I18n publishedLocationsDialogRepositoryColumnHeader;
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 2010-11-17 18:55:33 UTC (rev 26686)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2010-11-17 18:56:32 UTC (rev 26687)
@@ -46,7 +46,6 @@
publishedLocationsDialogCopyUrlButton = Copy URL
publishedLocationsDialogCopyUrlButtonToolTip = Copy to the clipboard the selected workspace URL where the file is published
-publishedLocationsDialogErrorObtainingUrlMsg = Error obtaining URL
publishedLocationsDialogFileUrlColumnHeader = Published URL
publishedLocationsDialogMsg = The file "{0}" has been published to the following ModeShape workspaces:
publishedLocationsDialogRepositoryColumnHeader = Repository
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ShowPublishedLocationsHandler.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ShowPublishedLocationsHandler.java 2010-11-17 18:55:33 UTC (rev 26686)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ShowPublishedLocationsHandler.java 2010-11-17 18:56:32 UTC (rev 26687)
@@ -21,10 +21,10 @@
import org.jboss.tools.modeshape.rest.PublishedResourceHelper;
import org.jboss.tools.modeshape.rest.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
+import org.jboss.tools.modeshape.rest.PublishedResourceHelper.WorkspaceLocation;
import org.jboss.tools.modeshape.rest.dialogs.PublishedLocationsDialog;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.Status.Severity;
-import org.modeshape.web.jcr.rest.client.domain.Workspace;
/**
* The <code>ShowPublishedLocationsHandler</code> displays a dialog that shows information on which ModeShape repositories a
@@ -54,9 +54,9 @@
Shell shell = HandlerUtil.getActiveShell(event);
try {
- Set<Workspace> workspaces = resourceHelper.getPublishedOnWorkspaces((IFile)selection.getFirstElement());
- PublishedLocationsDialog dialog = new PublishedLocationsDialog(shell, serverManager,
- (IFile)selection.getFirstElement(), workspaces);
+ Set<WorkspaceLocation> workspaceLocations = resourceHelper.getPublishedWorkspaceLocations((IFile)selection.getFirstElement());
+ PublishedLocationsDialog dialog = new PublishedLocationsDialog(shell, (IFile)selection.getFirstElement(),
+ workspaceLocations);
dialog.open();
} catch (Exception e) {
Activator.getDefault().log(new Status(Severity.ERROR, RestClientI18n.showPublishedLocationsErrorMsg.text(), e));
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 2010-11-17 18:55:33 UTC (rev 26686)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/PublishedLocationsDialog.java 2010-11-17 18:56:32 UTC (rev 26687)
@@ -16,7 +16,6 @@
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.io.File;
import java.util.Collection;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -48,12 +47,9 @@
import org.eclipse.swt.widgets.TableColumn;
import org.jboss.tools.modeshape.rest.Activator;
import org.jboss.tools.modeshape.rest.RestClientI18n;
-import org.jboss.tools.modeshape.rest.ServerManager;
+import org.jboss.tools.modeshape.rest.PublishedResourceHelper.WorkspaceLocation;
import org.modeshape.common.util.CheckArg;
-import org.modeshape.web.jcr.rest.client.Status;
-import org.modeshape.web.jcr.rest.client.Status.Severity;
import org.modeshape.web.jcr.rest.client.domain.Server;
-import org.modeshape.web.jcr.rest.client.domain.Workspace;
/**
* The <code>PublishedLocationsDialog</code> class provides a UI for viewing a list of {@link Server servers} a selected file has
@@ -114,24 +110,14 @@
private Button btnCopy;
/**
- * The file whose workspaces it was published to is being displayed by this dialog.
- */
- private final IFile file;
-
- /**
- * The server manager who can obtain the URL for the file at each of the workspaces.
- */
- private final ServerManager serverManager;
-
- /**
* The viewer of the table holding the published locations.
*/
private TableViewer viewer;
/**
- * Collection of workspaces the selected file has been published to.
+ * Collection of workspace locations the selected file has been published to.
*/
- private final Collection<Workspace> workspaces;
+ private final Collection<WorkspaceLocation> workspaceLocations;
// ===========================================================================================================================
// Constructors
@@ -139,27 +125,20 @@
/**
* @param parentShell the dialog parent
- * @param serverManager the server manager that this dialog will get URLs from (never <code>null</code>)
* @param file the file whose workspaces it has been published on is being requested (never <code>null</code>)
- * @param workspaces the workspaces (never <code>null</code>)
+ * @param workspaceLocations the workspace locations (never <code>null</code>)
*/
public PublishedLocationsDialog( Shell parentShell,
- ServerManager serverManager,
IFile file,
- Collection<Workspace> workspaces ) {
+ Collection<WorkspaceLocation> workspaceLocations ) {
super(parentShell, RestClientI18n.publishedLocationsDialogTitle.text(),
Activator.getDefault().getImage(ModeShape_IMAGE_16x),
RestClientI18n.publishedLocationsDialogMsg.text(file.getFullPath()), MessageDialog.INFORMATION,
new String[] {IDialogConstants.OK_LABEL}, 0);
- CheckArg.isNotNull(serverManager, "serverManager");
- CheckArg.isNotNull(file, "file");
- CheckArg.isNotNull(workspaces, "workspaces");
+ CheckArg.isNotNull(workspaceLocations, "workspaceLocations");
+ this.workspaceLocations = workspaceLocations;
- this.file = file;
- this.serverManager = serverManager;
- this.workspaces = workspaces;
-
// make sure dialog is resizable
setShellStyle(getShellStyle() | SWT.RESIZE);
}
@@ -261,49 +240,26 @@
}
/**
- * @return the file system file this dialog is showing the published locations of (never <code>null</code>)
- */
- private File getFile() {
- return this.file.getLocation().toFile();
- }
-
- /**
- * This path does not include the name of the file.
- *
- * @return the path the file was published (never <code>null</code>)
- */
- private String getPath() {
- return this.file.getParent().getFullPath().toString();
- }
-
- /**
- * @param workspace the workspace where the file was published
+ * @param workspaceLocation the workspace location where the file was published
* @return the URL where the file was published
*/
- String getPublishedAtUrl( Workspace workspace ) {
- try {
- return this.serverManager.getUrl(getFile(), getPath(), workspace).toString();
- } catch (Exception e) {
- String message = RestClientI18n.publishedLocationsDialogErrorObtainingUrlMsg.text();
- Activator.getDefault().log(new Status(Severity.ERROR, message, e));
- return message;
- }
-
+ String getPublishedAtUrl( WorkspaceLocation workspaceLocation ) {
+ return workspaceLocation.getUrl();
}
/**
* @return the workspaces the file has been published to (never <code>null</code>)
*/
- Object[] getWorkspaces() {
- return this.workspaces.toArray();
+ Object[] getWorkspaceLocations() {
+ return this.workspaceLocations.toArray();
}
/**
* Handler for when the copy URL button is clicked.
*/
void handleCopyUrl() {
- Workspace workspace = (Workspace)((IStructuredSelection)this.viewer.getSelection()).getFirstElement();
- String url = getPublishedAtUrl(workspace);
+ WorkspaceLocation workspaceLocation = (WorkspaceLocation)((IStructuredSelection)this.viewer.getSelection()).getFirstElement();
+ String url = getPublishedAtUrl(workspaceLocation);
Clipboard clipboard = new Clipboard(Display.getCurrent());
clipboard.setContents(new Object[] {url}, new Transfer[] {TextTransfer.getInstance()});
}
@@ -367,26 +323,26 @@
@Override
public String getColumnText( Object element,
int columnIndex ) {
- Workspace workspace = (Workspace)element;
+ WorkspaceLocation workspaceLocation = (WorkspaceLocation)element;
if (columnIndex == SERVER_URL_COL) {
- return workspace.getServer().getUrl();
+ return workspaceLocation.getServer().getUrl();
}
if (columnIndex == USER_COL) {
- return workspace.getServer().getUser();
+ return workspaceLocation.getServer().getUser();
}
if (columnIndex == REPOSITORY_COL) {
- return workspace.getRepository().getName();
+ return workspaceLocation.getRepository().getName();
}
if (columnIndex == WORKSPACE_COL) {
- return workspace.getName();
+ return workspaceLocation.getWorkspace().getName();
}
if (columnIndex == FILE_URL_COL) {
- return getPublishedAtUrl(workspace);
+ return getPublishedAtUrl(workspaceLocation);
}
// should never get here
@@ -401,7 +357,7 @@
*/
@Override
public Object[] getElements( Object inputElement ) {
- return getWorkspaces();
+ return getWorkspaceLocations();
}
/**
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java 2010-11-17 18:55:33 UTC (rev 26686)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java 2010-11-17 18:56:32 UTC (rev 26687)
@@ -133,7 +133,7 @@
this.files = files;
this.workspace = workspace;
this.jobId = JOB_ID.get();
-
+
// setup the workspace area and remove trailing separator if necessary
String temp = ((workspaceArea == null) ? "" : workspaceArea);
@@ -223,6 +223,7 @@
File file = eclipseFile.getLocation().toFile();
String path = this.workspaceArea + eclipseFile.getParent().getFullPath().toString();
+ URL url = getServerManager().getUrl(file, path, this.workspace);
Status status = null;
if (isPublishing()) {
@@ -230,14 +231,14 @@
// set persistent property on resource indicating it has been published
if (!status.isError()) {
- resourceHelper.addPublishedProperty(eclipseFile, workspace);
+ resourceHelper.addPublishedProperty(eclipseFile, this.workspace, url.toString());
}
} else {
status = getServerManager().unpublish(this.workspace, path, file);
// clear persistent property on resource indicating it has been unpublished
if (!status.isError()) {
- resourceHelper.removePublishedProperty(eclipseFile, workspace);
+ resourceHelper.removePublishedProperty(eclipseFile, this.workspace, url.toString());
}
}
@@ -253,7 +254,6 @@
// write outcome message to console
if (isPublishing() && status.isOk()) {
- URL url = getServerManager().getUrl(file, path, this.workspace);
writeToConsole(eclipseFile, url, status);
} else {
writeToConsole(eclipseFile, null, status);
15 years, 5 months
JBoss Tools SVN: r26686 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/commands and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-17 13:55:33 -0500 (Wed, 17 Nov 2010)
New Revision: 26686
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java
Log:
[JBIDE-7618] checked all instances initially
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-17 18:46:01 UTC (rev 26685)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-17 18:55:33 UTC (rev 26686)
@@ -1,5 +1,10 @@
2010-11-17 André Dietisheim <adietish(a)redhat.com>
+ * src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java:
+ * src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java (startWithDialog):
+ * src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java (rebootWithDialog):
+ * src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java (stopWithDialog):
+ [JBIDE-7618] checked all instances initially
* src/org/jboss/tools/deltacloud/ui/commands/AbstractCloudJob.java (AbstractCloudJob):
[JBIDE-7554] removed 'blocking' dialog since I now clear instances and images before reloading
* src/org/jboss/tools/deltacloud/ui/views/PerformDestroyInstanceActionThread.java (.run):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java 2010-11-17 18:46:01 UTC (rev 26685)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java 2010-11-17 18:55:33 UTC (rev 26686)
@@ -61,11 +61,13 @@
@SuppressWarnings("unchecked")
private void destroyWithDialog(IStructuredSelection selection) {
+ List<DeltaCloudInstance> deltaCloudInstances = UIUtils.adapt((List<DeltaCloudInstance>) selection.toList(), DeltaCloudInstance.class);
DeltaCloudInstanceDialog dialog = new DeltaCloudInstanceDialog(
UIUtils.getActiveShell()
- , UIUtils.adapt((List<DeltaCloudInstance>) selection.toList(), DeltaCloudInstance.class)
+ , deltaCloudInstances
, CVMessages.getString(DESTROY_INSTANCE_TITLE)
, CVMessages.getString(DESTROY_INSTANCE_MSG));
+ dialog.setInitialElementSelections(deltaCloudInstances);
if (Dialog.OK == dialog.open()) {
destroyInstances(dialog.getResult());
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java 2010-11-17 18:46:01 UTC (rev 26685)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java 2010-11-17 18:55:33 UTC (rev 26686)
@@ -59,11 +59,13 @@
@SuppressWarnings("unchecked")
private void rebootWithDialog(IStructuredSelection selection) {
+ List<DeltaCloudInstance> deltaCloudInstances = UIUtils.adapt((List<DeltaCloudInstance>) selection.toList(), DeltaCloudInstance.class);
DeltaCloudInstanceDialog dialog = new DeltaCloudInstanceDialog(
UIUtils.getActiveShell()
- , UIUtils.adapt((List<DeltaCloudInstance>) selection.toList(), DeltaCloudInstance.class)
+ , deltaCloudInstances
, CVMessages.getString(REBOOT_INSTANCE_TITLE)
, CVMessages.getString(REBOOT_INSTANCE_MSG));
+ dialog.setInitialElementSelections(deltaCloudInstances);
if (Dialog.OK == dialog.open()) {
rebootInstances(dialog.getResult());
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java 2010-11-17 18:46:01 UTC (rev 26685)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java 2010-11-17 18:55:33 UTC (rev 26686)
@@ -60,11 +60,13 @@
@SuppressWarnings("unchecked")
private void startWithDialog(IStructuredSelection selection) {
+ List<DeltaCloudInstance> deltaCloudInstances = UIUtils.adapt((List<DeltaCloudInstance>) selection.toList(), DeltaCloudInstance.class);
DeltaCloudInstanceDialog dialog = new DeltaCloudInstanceDialog(
UIUtils.getActiveShell()
- , UIUtils.adapt((List<DeltaCloudInstance>) selection.toList(), DeltaCloudInstance.class)
+ , deltaCloudInstances
, CVMessages.getString(START_INSTANCES_DIALOG_TITLE)
, CVMessages.getString(START_INSTANCES_DIALOG_MSG));
+ dialog.setInitialElementSelections(deltaCloudInstances);
if (Dialog.OK == dialog.open()) {
startInstances(dialog.getResult());
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java 2010-11-17 18:46:01 UTC (rev 26685)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java 2010-11-17 18:55:33 UTC (rev 26686)
@@ -58,11 +58,14 @@
@SuppressWarnings("unchecked")
private void stopWithDialog(IStructuredSelection selection) {
+ List<DeltaCloudInstance> deltaCloudInstances = UIUtils.adapt((List<DeltaCloudInstance>) selection.toList(),
+ DeltaCloudInstance.class);
DeltaCloudInstanceDialog dialog = new DeltaCloudInstanceDialog(
UIUtils.getActiveShell()
- , UIUtils.adapt((List<DeltaCloudInstance>) selection.toList(), DeltaCloudInstance.class)
+ , deltaCloudInstances
, CVMessages.getString(STOP_INSTANCES_DIALOG_TITLE)
, CVMessages.getString(STOP_INSTANCES_DIALOG_MSG));
+ dialog.setInitialElementSelections(deltaCloudInstances);
if (Dialog.OK == dialog.open()) {
stopInstances(dialog.getResult());
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java 2010-11-17 18:46:01 UTC (rev 26685)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java 2010-11-17 18:55:33 UTC (rev 26686)
@@ -12,6 +12,7 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IAdaptable;
@@ -123,8 +124,8 @@
&& getFirstAdaptedElement(selection, expectedClass) != null;
}
- public static <T> Collection<T> adapt(Collection<?> objects, Class<T> expectedClass) {
- ArrayList<T> adaptedObjects = new ArrayList<T>();
+ public static <T> List<T> adapt(Collection<?> objects, Class<T> expectedClass) {
+ List<T> adaptedObjects = new ArrayList<T>();
for (Object object : objects) {
T adaptedObject = adapt(object, expectedClass);
if (adaptedObject != null) {
15 years, 5 months
JBoss Tools SVN: r26685 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-17 13:46:01 -0500 (Wed, 17 Nov 2010)
New Revision: 26685
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DeltaCloudInstanceDialog.java
Log:
[JBIDE-7618] corrected variable name
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DeltaCloudInstanceDialog.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DeltaCloudInstanceDialog.java 2010-11-17 18:45:29 UTC (rev 26684)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DeltaCloudInstanceDialog.java 2010-11-17 18:46:01 UTC (rev 26685)
@@ -26,7 +26,7 @@
*/
public class DeltaCloudInstanceDialog extends ListSelectionDialog {
- private static class CloudElementNameProvider extends LabelProvider {
+ private static class DeltaCloudInstanceNameProvider extends LabelProvider {
public String getText(Object element) {
DeltaCloudInstance instance = UIUtils.adapt(element, DeltaCloudInstance.class);
if (instance != null) {
@@ -41,7 +41,7 @@
super(parentShell
, deltaCloudInstances
, ArrayContentProvider.getInstance()
- , new CloudElementNameProvider()
+ , new DeltaCloudInstanceNameProvider()
, message);
setTitle(title);
}
15 years, 5 months
JBoss Tools SVN: r26684 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-17 13:45:29 -0500 (Wed, 17 Nov 2010)
New Revision: 26684
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DeltaCloudInstanceDialog.java
Log:
[JBIDE-7618] corrected variable name
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DeltaCloudInstanceDialog.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DeltaCloudInstanceDialog.java 2010-11-17 18:02:16 UTC (rev 26683)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DeltaCloudInstanceDialog.java 2010-11-17 18:45:29 UTC (rev 26684)
@@ -37,9 +37,9 @@
}
};
- public DeltaCloudInstanceDialog(Shell parentShell, Collection<DeltaCloudInstance> cloudViewElements, String title, String message) {
+ public DeltaCloudInstanceDialog(Shell parentShell, Collection<DeltaCloudInstance> deltaCloudInstances, String title, String message) {
super(parentShell
- , cloudViewElements
+ , deltaCloudInstances
, ArrayContentProvider.getInstance()
, new CloudElementNameProvider()
, message);
15 years, 5 months
JBoss Tools SVN: r26683 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: messages and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-11-17 13:02:16 -0500 (Wed, 17 Nov 2010)
New Revision: 26683
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/VpePreferencesPage.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-7475 , messages on the VPE preferences page were corrected.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/VpePreferencesPage.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/VpePreferencesPage.java 2010-11-17 17:10:04 UTC (rev 26682)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/VpePreferencesPage.java 2010-11-17 18:02:16 UTC (rev 26683)
@@ -86,45 +86,22 @@
pageContainer.setLayout(layout);
pageContainer.setLayoutData(gd);
- visualEditorToolbarGroup = createLayoutGroup(pageContainer, SWT.SHADOW_ETCHED_IN, VpeUIMessages.VISUAL_EDITOR_TOOLBAR_BEHAVIOR);
+ visualEditorToolbarGroup = createLayoutGroup(pageContainer,
+ SWT.SHADOW_ETCHED_IN,
+ VpeUIMessages.VISUAL_EDITOR_TOOLBAR_BEHAVIOR);
+
+ visualAppearanceGroup = createLayoutGroup(pageContainer,
+ SWT.SHADOW_ETCHED_IN,
+ VpeUIMessages.VISUAL_APPEARANCE_GROUP_TITLE);
+
+ confirmationGroup = createLayoutGroup(pageContainer,
+ SWT.SHADOW_ETCHED_IN,
+ VpeUIMessages.CONFIRMATION_GROUP_TITLE);
+
+ tabsGroup = createLayoutGroup(pageContainer,
+ SWT.SHADOW_ETCHED_IN,
+ VpeUIMessages.TABS_GROUP_TITLE);
- visualAppearanceGroup = createLayoutGroup(pageContainer, SWT.SHADOW_ETCHED_IN, VpeUIMessages.VISUAL_APPEARANCE_GROUP_TITLE);
-// new Group(pageContainer, SWT.SHADOW_ETCHED_IN);
-// visualAppearanceGroup
-// .setText(VpeUIMessages.VISUAL_APPEARANCE_GROUP_TITLE);
-// layout = new GridLayout();
-// layout.marginHeight = 10;
-// layout.marginWidth = 10;
-// layout.horizontalSpacing = 10;
-// layout.verticalSpacing = 10;
-// visualAppearanceGroup.setLayout(layout);
-// gd = new GridData(SWT.FILL, SWT.NONE, true, false, 1, 1);
-// visualAppearanceGroup.setLayoutData(gd);
-
- confirmationGroup = createLayoutGroup(pageContainer, SWT.SHADOW_ETCHED_IN, VpeUIMessages.CONFIRMATION_GROUP_TITLE);
-
-// new Group(pageContainer, SWT.SHADOW_ETCHED_IN);
-// confirmationGroup.setText(VpeUIMessages.CONFIRMATION_GROUP_TITLE);
-// layout = new GridLayout();
-// layout.marginHeight = 10;
-// layout.marginWidth = 10;
-// layout.horizontalSpacing = 10;
-// layout.verticalSpacing = 10;
-// confirmationGroup.setLayout(layout);
-// gd = new GridData(SWT.FILL, SWT.NONE, true, false, 1, 1);
-// confirmationGroup.setLayoutData(gd);
-
- tabsGroup = createLayoutGroup(pageContainer, SWT.SHADOW_ETCHED_IN, VpeUIMessages.TABS_GROUP_TITLE);
-
-// new Group(pageContainer, SWT.SHADOW_ETCHED_IN);
-// tabsGroup.setText(VpeUIMessages.TABS_GROUP_TITLE);
-// layout = new GridLayout();
-// layout.marginHeight = 10;
-// layout.marginWidth = 10;
-// tabsGroup.setLayout(layout);
-// gd = new GridData(SWT.FILL, SWT.NONE, true, false, 1, 1);
-// tabsGroup.setLayoutData(gd);
-
createFieldEditors();
initialize();
checkState();
@@ -214,8 +191,7 @@
*/
private static Group createLayoutGroup(final Composite parent,final int style, final String groupTitle){
Group prefGroup = new Group(parent, style);
- prefGroup
- .setText(groupTitle);
+ prefGroup.setText(groupTitle);
GridLayout layout = new GridLayout();
layout.marginHeight = 10;
layout.marginWidth = 10;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-11-17 17:10:04 UTC (rev 26682)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-11-17 18:02:16 UTC (rev 26683)
@@ -110,7 +110,7 @@
GENERAL_TAB_TITLE=General
VPE_PREFERENCES_PAGE_DESCRIPTION=Visual Page Editor settings
SHOW_BORDER_FOR_UNKNOWN_TAGS=Show border for unknown tags
-SHOW_VPE_TOOLBAR = Show VPE editor Action on VPE toolbar, otherwise they will be shown on\n main eclipse toolbar
+SHOW_VPE_TOOLBAR = Show toolbar within the editor (otherwise in Eclipse's toolbar)
SHOW_SELECTION_TAG_BAR=Show selection tag bar
SHOW_TEXT_FORMATTING = Show text formatting bar
HIDE_TEXT_FORMATTING = Hide text formatting bar
@@ -118,12 +118,12 @@
SHOW_BUNDLES_AS_EL=Show bundle's messages as EL expressions
SHOW_BUNDLES_AS_MESSAGES=Show bundle's messages explicitly
ASK_TAG_ATTRIBUTES_ON_TAG_INSERT=Ask for tag attributes during tag insert
-INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE=Inform when a project might not be configured properly for Visual Page Editor
+INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE=Inform if the project is not configured properly to use Visual Page Editor
DEFAULT_VPE_TAB=Select the default active editor's tab
VISUAL_SOURCE_EDITORS_SPLITTING=Visual/Source editors splitting
VISUAL_SOURCE_EDITORS_WEIGHTS=Size of the Visual Editor pane (0-100%)
VISUAL_APPEARANCE_GROUP_TITLE=Visual appearance
-VISUAL_EDITOR_TOOLBAR_BEHAVIOR=Visual Editor Toolbar Behavior
+VISUAL_EDITOR_TOOLBAR_BEHAVIOR=Visual Page Editor toolbar behavior
CONFIRMATION_GROUP_TITLE=Confirmation and details
TABS_GROUP_TITLE=Default tab, splitting and editor's weights to start VPE with
15 years, 5 months
JBoss Tools SVN: r26682 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-17 12:10:04 -0500 (Wed, 17 Nov 2010)
New Revision: 26682
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java
Log:
[JBIDE-7597] enabled progress bar
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java 2010-11-17 16:59:37 UTC (rev 26681)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java 2010-11-17 17:10:04 UTC (rev 26682)
@@ -25,6 +25,7 @@
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.ui.commands.AbstractCloudJob;
import org.jboss.tools.deltacloud.ui.views.CVMessages;
public class RSEUtils {
@@ -80,12 +81,14 @@
public static void connect(final String instanceName, final IConnectorService service, String connectionName) {
// TODO: internationalize strings
Assert.isLegal(service != null, "Remote System Explorer could not connect: connector service not found.");
- Job connect = new Job(CVMessages.getFormattedString(RSE_CONNECTING_MSG, connectionName)) {
+ Job connect = new AbstractCloudJob(CVMessages.getFormattedString(RSE_CONNECTING_MSG, connectionName)) {
@Override
- protected IStatus run(IProgressMonitor monitor) {
+ protected IStatus doRun(IProgressMonitor monitor) {
try {
+ monitor.worked(1);
service.connect(monitor);
Display.getDefault().asyncExec(new ShowRSEViewRunnable(instanceName));
+ monitor.done();
return Status.OK_STATUS;
} catch (Exception e) {
return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
15 years, 5 months
JBoss Tools SVN: r26681 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-17 11:59:37 -0500 (Wed, 17 Nov 2010)
New Revision: 26681
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java
Log:
[JBIDE-7597] fixed NPE
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java 2010-11-17 16:45:31 UTC (rev 26680)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java 2010-11-17 16:59:37 UTC (rev 26681)
@@ -97,7 +97,6 @@
private Control realmCombo;
private ProfileComposite currPage;
private Map<String, ProfileComposite> profilePages;
- private ArrayList<String> realmIds;
private DeltaCloudHardwareProfile[] allProfiles;
private List<DeltaCloudRealm> realms;
@@ -168,7 +167,7 @@
public String getRealmId() {
if (realmCombo instanceof Combo) {
int index = ((Combo) realmCombo).getSelectionIndex();
- return realmIds.get(index);
+ return realms.get(index).getId();
} else {
return null;
}
15 years, 5 months
JBoss Tools SVN: r26680 - in trunk/deltacloud/plugins: org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-17 11:45:31 -0500 (Wed, 17 Nov 2010)
New Revision: 26680
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/AbstractCloudJob.java
Log:
[JBIDE-7544] clearing images and instances before refreshing them (to avoid conflicting user actions)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-17 16:28:42 UTC (rev 26679)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-17 16:45:31 UTC (rev 26680)
@@ -27,8 +27,14 @@
(testConnection):
[JBIDE-7597] made sure no DeltaCloudClientException gets outside of DeltaCloud
(destroyInstance):
- [JBIDE-7597] added exception to destroy instance
-
+ [JBIDE-7597] added exception to destroy instance
+ (clearInstances):
+ (clearImages):
+ (loadInstances):
+ (loadImages):
+ (loadChildren):
+ [JBIDE-7544] clearing images and instances before refreshing them (to avoid conflicting user actions)
+
2010-11-16 André Dietisheim <adietish(a)redhat.com>
* src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java (DeltaCloudManager):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-17 16:28:42 UTC (rev 26679)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-17 16:45:31 UTC (rev 26680)
@@ -244,6 +244,8 @@
public void loadChildren() throws DeltaCloudException {
DeltaCloudMultiException multiException = new DeltaCloudMultiException(MessageFormat.format(
"Could not load children from cloud {0}", getName()));
+ clearImages();
+ clearInstances();
try {
loadImages();
} catch (DeltaCloudException e) {
@@ -294,6 +296,12 @@
return images;
}
+ public DeltaCloudInstance[] notifyInstanceListeners() {
+ DeltaCloudInstance[] instances = cloneInstancesArray();
+ notifyInstanceListListeners(instances);
+ return instances;
+ }
+
private DeltaCloudImage[] cloneImagesArray() {
DeltaCloudImage[] imageArray = new DeltaCloudImage[images.size()];
return images.toArray(imageArray);
@@ -384,7 +392,7 @@
*/
public DeltaCloudInstance[] loadInstances() throws DeltaCloudException {
synchronized (instanceLock) {
- instances = new ArrayList<DeltaCloudInstance>();
+ clearInstances();
try {
List<Instance> list = getClient().listInstances();
for (Iterator<Instance> i = list.iterator(); i.hasNext();) {
@@ -393,9 +401,7 @@
}
// TODO: remove notification with all instances, replace by
// notifying the changed instance
- DeltaCloudInstance[] instancesArray = instances.toArray(new DeltaCloudInstance[instances.size()]);
- notifyInstanceListListeners(instancesArray);
- return instancesArray;
+ return notifyInstanceListeners();
} catch (DeltaCloudClientException e) {
throw new DeltaCloudException(MessageFormat.format("Could not load instances of cloud {0}: {1}",
getName(), e.getMessage()), e);
@@ -403,6 +409,13 @@
}
}
+ private void clearInstances() {
+ synchronized (instanceLock) {
+ instances = new ArrayList<DeltaCloudInstance>();
+ notifyInstanceListeners();
+ }
+ }
+
public DeltaCloudInstance[] getCurrInstances() throws DeltaCloudException {
synchronized (instanceLock) {
if (instances == null) {
@@ -556,7 +569,7 @@
public DeltaCloudImage[] loadImages() throws DeltaCloudException {
synchronized (imageLock) {
try {
- images = new ArrayList<DeltaCloudImage>();
+ clearImages();
List<Image> list = getClient().listImages();
for (Iterator<Image> i = list.iterator(); i.hasNext();) {
addImage(i.next());
@@ -569,6 +582,13 @@
}
}
+ private void clearImages() {
+ synchronized (imageLock) {
+ images = new ArrayList<DeltaCloudImage>();
+ notifyImageListListeners();
+ }
+ }
+
private DeltaCloudImage addImage(Image image) {
DeltaCloudImage deltaCloudImage = new DeltaCloudImage(image, this);
images.add(deltaCloudImage);
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-17 16:28:42 UTC (rev 26679)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-17 16:45:31 UTC (rev 26680)
@@ -1,5 +1,7 @@
2010-11-17 André Dietisheim <adietish(a)redhat.com>
+ * src/org/jboss/tools/deltacloud/ui/commands/AbstractCloudJob.java (AbstractCloudJob):
+ [JBIDE-7554] removed 'blocking' dialog since I now clear instances and images before reloading
* src/org/jboss/tools/deltacloud/ui/views/PerformDestroyInstanceActionThread.java (.run):
[JBIDE-7597] added exception reporting
* src/org/jboss/tools/deltacloud/ui/commands/RefreshImagesHandler.java (refresh):
@@ -110,7 +112,7 @@
* src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java (getStatusIcon):
* src/org/jboss/tools/deltacloud/ui/SWTImagesFactory.java:
[JBIDE-7566] renamed running.gif to run.gif, stopped to stop.gif, added running.gif and stopped.gif
-
+to destroy instance
2010-11-11 André Dietisheim <adietish(a)redhat.com>
* src/org/jboss/tools/deltacloud/ui/views/ImageView.java (ColumnListener.widgetSelected):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/AbstractCloudJob.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/AbstractCloudJob.java 2010-11-17 16:28:42 UTC (rev 26679)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/AbstractCloudJob.java 2010-11-17 16:45:31 UTC (rev 26680)
@@ -18,7 +18,7 @@
public AbstractCloudJob(String name) {
super(name);
- setUser(true);
+// setUser(true);
}
@Override
15 years, 5 months
JBoss Tools SVN: r26679 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-17 11:28:42 -0500 (Wed, 17 Nov 2010)
New Revision: 26679
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
Log:
[JBIDE-7597] added exception to destroy instance
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-17 16:28:22 UTC (rev 26678)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-17 16:28:42 UTC (rev 26679)
@@ -26,7 +26,9 @@
[JBIDE-7597] removed exception swalloing, made sure exceptions get thrown
(testConnection):
[JBIDE-7597] made sure no DeltaCloudClientException gets outside of DeltaCloud
-
+ (destroyInstance):
+ [JBIDE-7597] added exception to destroy instance
+
2010-11-16 André Dietisheim <adietish(a)redhat.com>
* src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java (DeltaCloudManager):
15 years, 5 months
JBoss Tools SVN: r26678 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-17 11:28:22 -0500 (Wed, 17 Nov 2010)
New Revision: 26678
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformDestroyInstanceActionThread.java
Log:
[JBIDE-7597] added exception reporting to destroy instance
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-17 16:27:16 UTC (rev 26677)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-17 16:28:22 UTC (rev 26678)
@@ -1,5 +1,7 @@
2010-11-17 André Dietisheim <adietish(a)redhat.com>
+ * src/org/jboss/tools/deltacloud/ui/views/PerformDestroyInstanceActionThread.java (.run):
+ [JBIDE-7597] added exception reporting
* src/org/jboss/tools/deltacloud/ui/commands/RefreshImagesHandler.java (refresh):
* src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java (refresh):
* src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java (refresh):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformDestroyInstanceActionThread.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformDestroyInstanceActionThread.java 2010-11-17 16:27:16 UTC (rev 26677)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformDestroyInstanceActionThread.java 2010-11-17 16:28:22 UTC (rev 26678)
@@ -1,33 +1,38 @@
package org.jboss.tools.deltacloud.ui.views;
+import java.text.MessageFormat;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.ui.ErrorUtils;
public class PerformDestroyInstanceActionThread extends Job {
private DeltaCloud cloud;
private DeltaCloudInstance instance;
private String taskName;
-
- public PerformDestroyInstanceActionThread(DeltaCloud cloud, DeltaCloudInstance instance,
- String title, String taskName) {
- super(title);
- this.cloud = cloud;
- this.instance = instance;
- this.taskName = taskName;
- }
-
- @Override
- public IStatus run(IProgressMonitor pm) {
- String id = instance.getId();
- try {
- pm.beginTask(taskName, IProgressMonitor.UNKNOWN);
- pm.worked(1);
- // To handle the user starting a new action when we haven't confirmed the last one yet,
+
+ public PerformDestroyInstanceActionThread(DeltaCloud cloud, DeltaCloudInstance instance,
+ String title, String taskName) {
+ super(title);
+ this.cloud = cloud;
+ this.instance = instance;
+ this.taskName = taskName;
+ }
+
+ @Override
+ public IStatus run(IProgressMonitor pm) {
+ String id = instance.getId();
+ try {
+ pm.beginTask(taskName, IProgressMonitor.UNKNOWN);
+ pm.worked(1);
+ // To handle the user starting a new action when we haven't
+ // confirmed the last one yet,
// cancel the previous job and then go on performing this action
Job job = cloud.getInstanceJob(id);
if (job != null) {
@@ -39,16 +44,22 @@
}
}
cloud.registerInstanceJob(id, this);
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- cloud.destroyInstance(instance.getId());
- }
- });
- } finally {
- cloud.removeInstanceJob(id, this);
- pm.done();
- }
- return Status.OK_STATUS;
- }
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ cloud.destroyInstance(instance.getId());
+ } catch (DeltaCloudException e) {
+ ErrorUtils.openErrorDialog("Error",
+ MessageFormat.format("Could not destroy instance {0}", instance.getName()), e,
+ Display.getDefault().getActiveShell());
+ }
+ }
+ });
+ } finally {
+ cloud.removeInstanceJob(id, this);
+ pm.done();
+ }
+ return Status.OK_STATUS;
+ }
}
15 years, 5 months