Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2012-10-04 11:05:25 -0400
committerChristopher Frost2012-10-04 11:05:25 -0400
commit95a71f880cf4ffe7421307b70fc471ee4744eb69 (patch)
tree83f1d6176302b1652ed986d03b485b7ffcbd069c
parentc17a7d8a2b7b0bae1a90acb7dee25321871bdca7 (diff)
downloadorg.eclipse.virgo.kernel-95a71f880cf4ffe7421307b70fc471ee4744eb69.tar.gz
org.eclipse.virgo.kernel-95a71f880cf4ffe7421307b70fc471ee4744eb69.tar.xz
org.eclipse.virgo.kernel-95a71f880cf4ffe7421307b70fc471ee4744eb69.zip
388207 Failure to centre selected bundle in OSGi Explorer
-rw-r--r--org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/ArtifactController.java237
-rw-r--r--org.eclipse.virgo.management.console/src/main/webapp/WEB-INF/layouts/header.html4
-rw-r--r--org.eclipse.virgo.management.console/src/main/webapp/js/bundlesGui.js97
-rw-r--r--org.eclipse.virgo.management.console/src/main/webapp/js/common.js43
-rw-r--r--org.eclipse.virgo.management.console/src/main/webapp/styles/common.css6
5 files changed, 87 insertions, 300 deletions
diff --git a/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/ArtifactController.java b/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/ArtifactController.java
deleted file mode 100644
index d4a637f7..00000000
--- a/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/ArtifactController.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VMware Inc. - initial contribution
- *******************************************************************************/
-
-package org.eclipse.virgo.management.console;
-
-//import java.io.IOException;
-//import java.io.PrintWriter;
-//
-//import javax.servlet.http.HttpServletRequest;
-//import javax.servlet.http.HttpServletResponse;
-//
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.web.bind.ServletRequestBindingException;
-//import org.springframework.web.bind.annotation.RequestMapping;
-//import org.springframework.web.multipart.MultipartFile;
-//import org.springframework.web.multipart.MultipartHttpServletRequest;
-//import org.springframework.web.servlet.ModelAndView;
-
-/**
- * <p>
- * ArtifactController handles all requests that need the RAM to be rendered for the artifact page/view.
- * </p>
- *
- * <strong>Concurrent Semantics</strong><br />
- *
- * ArtifactController is threadsafe, under the assumption that {@link ArtifactService} is also thread safe.
- *
- */
-public final class ArtifactController {
-
- //private static final Logger LOGGER = LoggerFactory.getLogger(ArtifactController.class);
-
- //private static final String AJAX_JSON_CONTENT_TYPE = "application/json";
-
- //private static final String TYPE = "type";
-
- //private static final String NAME = "name";
-
- //private static final String VERSION = "version";
-
- //private static final String PARENT = "parent";
-
- //private final ArtifactService artifactService;
-
- //private final DojoTreeFormatter dojoTreeJsonFormatter;
-
- //private final RamAccessorHelper ramAccessorHelper;
-
- //private final ModuleContextAccessor moduleContextAccessor;
-
- //private final StateHolder stateInspectorService;
-
- //private static final String SPRING = "spring-powered";
-
- //private static final String BUNDLE = "bundle";
-
- /**
- * Simple constructor taking an {@link ArtifactService} instance to provide any data required to render requests
- *
- * @param artifactService data to render requests
- * @param dojoTreeJsonFormatter formatter
- * @param moduleContextAccessor context
- * @param stateInspectorService state
- * @param ramAccessorHelper assistance
- */
- //@Autowired
- //public ArtifactController(ArtifactService artifactService, DojoTreeFormatter dojoTreeJsonFormatter, ModuleContextAccessor moduleContextAccessor, StateHolder stateInspectorService, RamAccessorHelper ramAccessorHelper) {
- //this.artifactService = artifactService;
- //this.dojoTreeJsonFormatter = dojoTreeJsonFormatter;
- //this.stateInspectorService = stateInspectorService;
- //this.ramAccessorHelper = ramAccessorHelper;
- //this.moduleContextAccessor = moduleContextAccessor;
-
- //}
-
- /**
- * Custom handler for displaying a list of all installed applications.
- * @param request controlling response
- * @return ModelAndView to render
- */
-// @RequestMapping("/artifact/overview.htm")
-// public ModelAndView overview(HttpServletRequest request) {
-// String msg = request.getParameter("message");
-// if (msg == null || "".equals(msg)) {
-// return new ModelAndView("artifact-overview");
-// }
-// return new ModelAndView("artifact-overview").addObject("result", msg);
-// }
-
- /**
- * Custom handler for deploying an application.
- * @param request controlling response
- * @return ModelAndView to render
- */
-// @RequestMapping("/artifact/deploy.htm")
-// public ModelAndView deploy(HttpServletRequest request) {
-// MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
-// MultipartFile multipartFile = multipartRequest.getFile("application");
-// String msg;
-// if (multipartFile == null || multipartFile.isEmpty()) {
-// msg = "Error: Please select the artifact you would like to upload.";
-// } else {
-// msg = this.deployFile(multipartFile);
-// }
-// return new ModelAndView("artifact-overview").addObject("result", msg);
-// }
-
-// private String deployFile(MultipartFile multipartFile) {
-// File dest = new File(this.artifactService.getStagingDirectory().getAbsolutePath(), multipartFile.getOriginalFilename());
-// try {
-// multipartFile.transferTo(dest);
-// return this.artifactService.deploy(dest);
-// } catch (IOException e) {
-// String msg = "An error occurred while transferring an uploaded file to [" + dest.getAbsolutePath()
-// + "]. Consult the serviceability output for further details.";
-// LOGGER.warn(msg, e);
-// return msg;
-// }
-// return "";
-// }
-
- /**
- * Custom handler for performing an action upon an artifact.
- * @param request controlling response
- * @return ModelAndView to render
- * @throws ServletRequestBindingException for missing or unparsable parameters
- */
-// @RequestMapping("/artifact/do/start")
-// public ModelAndView actionStart(HttpServletRequest request) throws ServletRequestBindingException {
-// String type = ServletRequestUtils.getRequiredStringParameter(request, TYPE);
-// String name = ServletRequestUtils.getRequiredStringParameter(request, NAME);
-// String version = ServletRequestUtils.getRequiredStringParameter(request, VERSION);
-//
-// String msg = this.ramAccessorHelper.start(type, name, version);
-// return new ModelAndView("artifact-overview").addObject("result", msg);
-// }
-
- /**
- * Custom handler for performing an action upon an artifact.
- * @param request controlling response
- * @return ModelAndView to render
- * @throws ServletRequestBindingException for missing or unparsable parameters
- */
-// @RequestMapping("/artifact/do/stop")
-// public ModelAndView actionStop(HttpServletRequest request) throws ServletRequestBindingException {
-// String type = ServletRequestUtils.getRequiredStringParameter(request, TYPE);
-// String name = ServletRequestUtils.getRequiredStringParameter(request, NAME);
-// String version = ServletRequestUtils.getRequiredStringParameter(request, VERSION);
-//
-// String msg = this.ramAccessorHelper.stop(type, name, version);
-// return new ModelAndView("artifact-overview").addObject("result", msg);
-// }
-
- /**
- * Custom handler for performing an action upon an artifact.
- * @param request controlling response
- * @return ModelAndView to render
- * @throws ServletRequestBindingException for missing or unparsable parameters
- */
-// @RequestMapping("/artifact/do/uninstall")
-// public ModelAndView actionUninstall(HttpServletRequest request) throws ServletRequestBindingException {
-// String type = ServletRequestUtils.getRequiredStringParameter(request, TYPE);
-// String name = ServletRequestUtils.getRequiredStringParameter(request, NAME);
-// String version = ServletRequestUtils.getRequiredStringParameter(request, VERSION);
-//
-// String msg = this.ramAccessorHelper.uninstall(type, name, version);
-// return new ModelAndView("artifact-overview").addObject("result", msg);
-// }
-
- /**
- * Custom handler for performing an action upon an artifact.
- * @param request controlling response
- * @return ModelAndView to render
- * @throws ServletRequestBindingException for missing or unparsable parameters
- */
-// @RequestMapping("/artifact/do/refresh")
-// public ModelAndView actionRefresh(HttpServletRequest request) throws ServletRequestBindingException {
-// String type = ServletRequestUtils.getRequiredStringParameter(request, TYPE);
-// String name = ServletRequestUtils.getRequiredStringParameter(request, NAME);
-// String version = ServletRequestUtils.getRequiredStringParameter(request, VERSION);
-//
-// String msg = this.ramAccessorHelper.refresh(type, name, version);
-// return new ModelAndView("artifact-overview").addObject("result", msg);
-// }
-
- /**
- * Write a representation of the RAM.
- * @param request controlling response
- * @param response formatted descriptions
- * @throws IOException writing response
- * @throws ServletRequestBindingException for missing or unparsable parameters
- */
-// @RequestMapping("/artifact/data")
-// public void data(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletRequestBindingException {
-// String type = ServletRequestUtils.getStringParameter(request, TYPE);
-// String name = ServletRequestUtils.getStringParameter(request, NAME);
-// String version = ServletRequestUtils.getStringParameter(request, VERSION);
-// String parent = ServletRequestUtils.getStringParameter(request, PARENT);
-//
-// String responseString;
-//
-// if (type == null) {
-// responseString = this.dojoTreeJsonFormatter.formatTypes(this.ramAccessorHelper.getTypes());//Top level request
-// } else if (type != null && name == null) {
-// responseString = this.dojoTreeJsonFormatter.formatArtifactsOfType(parent, this.ramAccessorHelper.getArtifactsOfType(type));//Second level request
-// } else if (type != null && name != null && version != null) {
-// ArtifactAccessor artifact = this.ramAccessorHelper.getArtifact(type, name, version);
-// responseString = this.dojoTreeJsonFormatter.formatArtifactDetails(parent, artifact);//All other requests
-// } else {
-// throw new IllegalArgumentException(String.format("Cannot service request with parameters: %s", request.getQueryString()));
-// }
-//
-// StringBuilder sb = new StringBuilder();
-// sb.append("{");
-// sb.append("identifier: 'id',");
-// sb.append("label: 'label',");
-// sb.append("items: [ ");
-// if(responseString != null) {
-// sb.append(responseString);
-// }
-// sb.append("]}");
-//
-// response.setContentType(AJAX_JSON_CONTENT_TYPE);
-// PrintWriter writer = response.getWriter();
-// writer.write(sb.toString());
-// writer.flush();
-// }
-
-}
diff --git a/org.eclipse.virgo.management.console/src/main/webapp/WEB-INF/layouts/header.html b/org.eclipse.virgo.management.console/src/main/webapp/WEB-INF/layouts/header.html
index 81a2c04f..0cc60f26 100644
--- a/org.eclipse.virgo.management.console/src/main/webapp/WEB-INF/layouts/header.html
+++ b/org.eclipse.virgo.management.console/src/main/webapp/WEB-INF/layouts/header.html
@@ -37,13 +37,13 @@
<li class="<!--@?<viewName=artifacts:selected-navigation:unselected-navigation@-->">
<a href="<!--@<contextPath@-->/content/artifacts"><div class="button-cap-left-white"></div><div class="navigation-text">Artifacts</div><div class="button-cap-right-white"></div></a>
</li>
- <li class="<!--@?<viewName=explorer:selected-navigation:unselected-navigation@-->">
+ <li class="<!--@?<viewName=wirings:selected-navigation:unselected-navigation@-->">
<a href="<!--@<contextPath@-->/content/wirings"><div class="button-cap-left-white"></div><div class="navigation-text">Wirings</div><div class="button-cap-right-white"></div></a>
</li>
<li class="<!--@?<viewName=repositories:selected-navigation:unselected-navigation@-->">
<a href="<!--@<contextPath@-->/content/repositories"><div class="button-cap-left-white"></div><div class="navigation-text">Repositories</div><div class="button-cap-right-white"></div></a>
</li>
- <li class="<!--@?<viewName=configuration:selected-navigation:unselected-navigation@-->">
+ <li class="<!--@?<viewName=configurations:selected-navigation:unselected-navigation@-->">
<a href="<!--@<contextPath@-->/content/configurations"><div class="button-cap-left-white"></div><div class="navigation-text">Configurations</div><div class="button-cap-right-white"></div></a>
</li>
<!-- <li class="<!--@?<viewName=logs:selected-navigation:unselected-navigation@->">
diff --git a/org.eclipse.virgo.management.console/src/main/webapp/js/bundlesGui.js b/org.eclipse.virgo.management.console/src/main/webapp/js/bundlesGui.js
index 9fa7f271..4c0dc4fc 100644
--- a/org.eclipse.virgo.management.console/src/main/webapp/js/bundlesGui.js
+++ b/org.eclipse.virgo.management.console/src/main/webapp/js/bundlesGui.js
@@ -57,36 +57,31 @@ var LayoutManager = function(bundleCanvas, width, height, dataSource){
self.focused = NaN;
self.dataSource.updateBundle(bundleId, function(){
var bundle;
- var rawBundle = self.dataSource.bundles[bundleId];
+ if(self.bundles[bundleId]){
+ bundle = self.bundles[bundleId];
+ }else{
+ bundle = new Bundle(self.paper, self.dataSource.bundles[bundleId], 5, 5, self.displayBundle);
+ self.bundles[bundleId] = bundle;
+ }
+
+ self.focused = bundleId;
if(self.relationshipType == 'wires'){
- self.renderWires(rawBundle);
+ self.renderWires(bundle);
}else{
- self.renderServices(rawBundle);
+ self.renderServices(bundle);
}
var middleX = Math.round(self.paper.width/2);
var middleY = Math.round(self.paper.height/2);
- if(self.bundles[bundleId]){
- bundle = self.bundles[bundleId];
- }else{
- bundle = new Bundle(self.paper, rawBundle, middleX, middleY, self.displayBundle);
- self.bundles[bundleId] = bundle;
- }
bundle.move(middleX - (bundle.boxWidth/2), middleY);
+ bundle.show();
+ self.bundleCanvas.scrollLeft(middleX - (self.minimumWidth/2));
- $.each(self.relationships, function(relationshipKey, relationship){
- if(relationship.fromBundle == undefined){
- relationship.fromBundle = bundle;
- }else if(relationship.toBundle == undefined){
- relationship.toBundle = bundle;
- }
+ $.each(self.relationships, function(key, relationship){
relationship.display();
});
- self.focused = bundleId;
- bundle.show();
- self.bundleCanvas.scrollLeft(middleX - (self.minimumWidth/2));
self.bundleCanvas.removeClass('spinner-large');
});
if(self.focusListener){
@@ -95,64 +90,69 @@ var LayoutManager = function(bundleCanvas, width, height, dataSource){
}
};
- self.renderWires = function(rawBundle){
+ self.renderWires = function(bundle){
var topRowBundleIds = {};
- $.each(rawBundle.RequiredWires, function(index, wire){
+ $.each(bundle.rawBundle.RequiredWires, function(index, wire){
topRowBundleIds[wire.ProviderBundleId] = self.getInfoBoxWithWire(wire);
});
- var topWidth = self.renderBundleRow(topRowBundleIds, -239, rawBundle, true);
+ var topWidth = self.renderBundleRow(topRowBundleIds, -239, bundle, true);
var bottomRowBundleIds = {};
- $.each(rawBundle.ProvidedWires, function(index, wire){
+ $.each(bundle.rawBundle.ProvidedWires, function(index, wire){
bottomRowBundleIds[wire.RequirerBundleId] = self.getInfoBoxWithWire(wire);
});
- var bottomWidth = self.renderBundleRow(bottomRowBundleIds, 239, rawBundle, false);
+ var bottomWidth = self.renderBundleRow(bottomRowBundleIds, 239, bundle, false);
var newWidth = topWidth < bottomWidth ? bottomWidth : topWidth;
newWidth < self.minimumWidth ? self.paper.setSize(self.minimumWidth, self.paper.height) : self.paper.setSize(newWidth, self.paper.height);
};
- self.renderServices = function(rawBundle){
+ self.renderServices = function(bundle){
var topRowBundleIds = {};
- $.each(rawBundle.ServicesInUse, function(index, service){
- topRowBundleIds[service.BundleIdentifier] = self.getInfoBoxWithService(service, service.BundleIdentifier, rawBundle.Identifier);
+ $.each(bundle.rawBundle.ServicesInUse, function(index, service){
+ topRowBundleIds[service.BundleIdentifier] = self.getInfoBoxWithService(service, service.BundleIdentifier, bundle.rawBundle.Identifier);
});
- var topWidth = self.renderBundleRow(topRowBundleIds, -239, rawBundle, true);
+ var topWidth = self.renderBundleRow(topRowBundleIds, -239, bundle, true);
var bottomRowBundleIds = {};
- $.each(rawBundle.RegisteredServices, function(index, service){
+ $.each(bundle.rawBundle.RegisteredServices, function(index, service){
$.each(service.UsingBundles, function(index, bundleId){
- bottomRowBundleIds[bundleId] = self.getInfoBoxWithService(service, bundleId, rawBundle.Identifier);
+ bottomRowBundleIds[bundleId] = self.getInfoBoxWithService(service, bundleId, bundle.rawBundle.Identifier);
});
});
- var bottomWidth = self.renderBundleRow(bottomRowBundleIds, 239, rawBundle, false);
+ var bottomWidth = self.renderBundleRow(bottomRowBundleIds, 239, bundle, false);
var newWidth = topWidth < bottomWidth ? bottomWidth : topWidth;
newWidth < self.minimumWidth ? self.paper.setSize(self.minimumWidth, self.paper.height) : self.paper.setSize(newWidth, self.paper.height);
};
- self.renderBundleRow = function(bundleIds, offset, focusedRawBundle, topRow){
+ self.renderBundleRow = function(bundleIds, offset, focusedBundle, topRow){
var yPos = (self.paper.height/2) + offset;
var xPos = this.bundleSpacing;
- var bundle;
+ var focusedBundleId = focusedBundle.rawBundle.Identifier;
$.each(bundleIds, function(bundleId, relationshipInfoBox){
+ var bundle;
+ var existingBundle = false;
+ var releationshipKey = self.getRelationshipKey(bundleId, focusedBundleId);
if(self.bundles[bundleId]){
bundle = self.bundles[bundleId];
- bundle.move(xPos, yPos);
- }else{
+ existingBundle = true;
+ }else{ //New Bundle so we will definitely be adding it on this loop.
bundle = new Bundle(self.paper, self.dataSource.bundles[bundleId], xPos, yPos, self.displayBundle);
self.bundles[bundleId] = bundle;
}
- var releationshipKey = self.getRelationshipKey(bundleId, focusedRawBundle.Identifier);
- if(!bundle.isVisible || focusedRawBundle.Identifier != bundleId){
+ if(!bundle.isVisible && focusedBundleId != bundleId){// If the bundle is not visible and is not the focused bundle
var relationship;
if(topRow){
- relationship = new Relationship(self.paper, bundle, undefined, relationshipInfoBox);
+ relationship = new Relationship(self.paper, bundle, focusedBundle, relationshipInfoBox);
}else{
- relationship = new Relationship(self.paper, undefined, bundle, relationshipInfoBox);
+ relationship = new Relationship(self.paper, focusedBundle, bundle, relationshipInfoBox);
}
self.relationships[releationshipKey] = relationship;
+ if(existingBundle){
+ bundle.move(xPos, yPos);
+ }
bundle.show();
xPos = xPos + bundle.boxWidth + self.bundleSpacing;
} else {
var existingRelationship = self.relationships[releationshipKey];
- if(bundle.rawBundle.Identifier == focusedRawBundle.Identifier){
+ if(bundle.rawBundle.Identifier == focusedBundleId){
if(existingRelationship){
existingRelationship.increaseCount(relationshipInfoBox);
}else{//Handle the first self relationship
@@ -161,12 +161,12 @@ var LayoutManager = function(bundleCanvas, width, height, dataSource){
}
} else {
var existingFromBundle = existingRelationship.fromBundle.rawBundle.Identifier;
- if(topRow && focusedRawBundle.Identifier == existingFromBundle){// On the bottom row
+ if(!topRow && existingFromBundle == focusedBundleId){// On the bottom row
existingRelationship.increaseCount(relationshipInfoBox);
- } else if(!topRow && bundle.rawBundle.Identifier == existingFromBundle){// On the top row
+ } else if(topRow && bundle.rawBundle.Identifier == existingFromBundle){// On the top row
existingRelationship.increaseCount(relationshipInfoBox);
} else {
- existingRelationship.increaseBackCount(relationshipInfoBox); //On the top row
+ existingRelationship.increaseBackCount(relationshipInfoBox); //On either row and its a back relationship
}
}
}
@@ -390,7 +390,7 @@ var Relationship = function(paper, fromBundle, toBundle, infoBox) {
self.fromBundle = fromBundle;
self.toBundle = toBundle;
self.infoBox = infoBox;
- self.doubleEnded = false;
+ self.doubleEnded = 'none';
self.count = 1;
self.controlPointOffset = 90;
@@ -436,6 +436,7 @@ var Relationship = function(paper, fromBundle, toBundle, infoBox) {
',' + self.endPointControl.x + ',' + self.endPointControl.y +
',' + self.endPoint.x + ',' + self.endPoint.y).attr({
'arrow-end' : 'block-wide-long',
+ 'arrow-start': self.doubleEnded,
'stroke-width' : 3,
'stroke' : '#002F5E'
}).toBack();
@@ -468,14 +469,16 @@ var Relationship = function(paper, fromBundle, toBundle, infoBox) {
if(self.infoPointText){
self.infoPointText.attr({'text': self.count});
}
- self.infoBox.addInfoBox(relationshipInfoBox);
+ self.infoBox.addContent(relationshipInfoBox.content);
};
self.increaseBackCount = function(relationshipInfoBox) {
self.increaseCount(relationshipInfoBox);
- if(!self.doubleEnded){
- self.doubleEnded = true;
- self.visual.attr({'arrow-start' : 'block-wide-long'});
+ if('none' == self.doubleEnded){
+ self.doubleEnded = 'block-wide-long';
+ if(self.visual){
+ self.visual.attr({'arrow-start': 'block-wide-long'});
+ }
}
};
diff --git a/org.eclipse.virgo.management.console/src/main/webapp/js/common.js b/org.eclipse.virgo.management.console/src/main/webapp/js/common.js
index 72ad0f67..bdc2dd93 100644
--- a/org.eclipse.virgo.management.console/src/main/webapp/js/common.js
+++ b/org.eclipse.virgo.management.console/src/main/webapp/js/common.js
@@ -349,21 +349,13 @@ var InfoBox = function(properties){
var self = this;
self.isVisible = false;
-
self.dialogBox = $('<div />').addClass(properties.name).addClass('info-box');
-
self.title = $('<div />', {'class': 'box-title'}).text(properties.title);
- self.dialogBox.append(self.title);
-
self.content = $('<div />', {'class': 'box-content'}).append(properties.content);
+
+ self.dialogBox.append(self.title);
self.dialogBox.append(self.content);
- var position = $('#content').position();
- self.dialogBox.css({top: position.top + 80, left: position.left + 80});
-
- if(properties.modal){
-
- }
if(properties.closeable){
self.title.append($('<div />', {'class': 'box-title-close'}).append('x').click(function(){
self.hide();
@@ -372,8 +364,8 @@ var InfoBox = function(properties){
self.dialogBox.draggable({ scroll: false, stack: '.info-box'});
- self.addInfoBox = function(newInfoBox){
- $.each(newInfoBox.content.children(), function(index, item){
+ self.addContent = function(newContent){
+ $.each(newContent.children(), function(index, item){
self.content.append(item);
});
};
@@ -382,9 +374,34 @@ var InfoBox = function(properties){
if(!self.isVisible){
$("li", self.dialogBox).removeClass('li-odd');
$("li:odd", self.dialogBox).addClass('li-odd');
+
+ var position = $('#content').position();
+ var infoBoxCount = $('.info-box').length;
+ var floorCount = Math.floor(infoBoxCount/10);
+ var xOffSet = floorCount * 250;
+ infoBoxCount = infoBoxCount - (floorCount * 10);
+ var zIndex = 0;
+ $.each($('.info-box'), function(index, otherInfoBox){
+ if($(otherInfoBox).css('z-index') >= zIndex){
+ zIndex = $(otherInfoBox).css('z-index') + 1;
+ }
+ });
+ self.dialogBox.css({left: position.left + 40 + xOffSet + (infoBoxCount*25), top: position.top + 40 + (infoBoxCount*25), 'z-index': zIndex});
+ self.dialogBox.show();
$('body').append(self.dialogBox);
- self.dialogBox.show();
self.isVisible = true;
+ }else{
+ var zIndex = self.dialogBox.css('z-index');
+ var needToMove = false;
+ $.each($('.info-box'), function(index, otherInfoBox){
+ if($(otherInfoBox).css('z-index') >= zIndex){
+ zIndex = $(otherInfoBox).css('z-index') + 1;
+ needToMove = true;
+ }
+ });
+ if(needToMove){
+ self.dialogBox.css({'z-index': zIndex});
+ }
}
};
diff --git a/org.eclipse.virgo.management.console/src/main/webapp/styles/common.css b/org.eclipse.virgo.management.console/src/main/webapp/styles/common.css
index 5e00795c..61406382 100644
--- a/org.eclipse.virgo.management.console/src/main/webapp/styles/common.css
+++ b/org.eclipse.virgo.management.console/src/main/webapp/styles/common.css
@@ -487,6 +487,7 @@ td {
color: #002F5E;
padding: 5px;
border-bottom: 1px solid #B6D9ED;
+ cursor: move;
}
.info-box .box-content {
@@ -494,7 +495,10 @@ td {
max-height: 300px;
overflow: auto;
padding: 0 5px;
- min-width: 500px;
+ min-width: 400px;
+ max-width: 800px;
+ word-wrap: break-word;
+ word-break: break-all;
}
.info-box .section-title {

Back to the top