JBoss Tools SVN: r27197 - trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-12-06 17:27:51 -0500 (Mon, 06 Dec 2010)
New Revision: 27197
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers/JBossASHandler.java
Log:
JBIDE-7822 Deployment from workspace metadata does not work when workspace path contains space character
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers/JBossASHandler.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers/JBossASHandler.java 2010-12-06 17:22:32 UTC (rev 27196)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/handlers/JBossASHandler.java 2010-12-06 22:27:51 UTC (rev 27197)
@@ -55,6 +55,7 @@
import org.eclipse.wst.server.core.internal.ServerPlugin;
import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
import org.eclipse.wst.server.core.internal.XMLMemento;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.bean.JBossServerType;
import org.jboss.ide.eclipse.as.core.server.bean.ServerBeanLoader;
import org.jboss.tools.runtime.Activator;
@@ -259,8 +260,10 @@
server.setName(name);
// JBossServer.DEPLOY_DIRECTORY
- String deployVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("deploy").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
- ((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.deployDirectory", deployVal); //$NON-NLS-1$
+ // JBIDE-7822
+ //String deployVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("deploy").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
+ //((ServerWorkingCopy) server).setAttribute("org.jboss.ide.eclipse.as.core.server.deployDirectory", deployVal); //$NON-NLS-1$
+ ((ServerWorkingCopy) server).setAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE, IDeployableServer.DEPLOY_SERVER);
// IDeployableServer.TEMP_DEPLOY_DIRECTORY
String deployTmpFolderVal = runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("tmp").append("jbosstoolsTemp").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
14 years
JBoss Tools SVN: r27196 - trunk/cdi/plugins/org.jboss.tools.cdi.core.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-12-06 12:22:32 -0500 (Mon, 06 Dec 2010)
New Revision: 27196
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
Log:
https://jira.jboss.org/browse/JBIDE-7823
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2010-12-06 17:20:54 UTC (rev 27195)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2010-12-06 17:22:32 UTC (rev 27196)
@@ -4,7 +4,7 @@
<extension
id="cdibuilder"
- name="CDI Builder"
+ name="CDI (Context and Dependency Injection) Builder"
point="org.eclipse.core.resources.builders">
<builder
hasNature="false">
@@ -15,7 +15,7 @@
</extension>
<extension
id="cdinature"
- name="CDI Project Nature"
+ name="CDI (Context and Dependency Injection) Project Nature"
point="org.eclipse.core.resources.natures">
<runtime>
<run
@@ -32,10 +32,10 @@
<project-facet
id="jst.cdi">
<label>
- Contexts and Dependency Injection
+ CDI (Contexts and Dependency Injection)
</label>
<description>
- Enables the project to work with CDI
+ Enables the project to work with Context and Dependency Injection (CDI)
</description>
</project-facet>
<project-facet-version
@@ -71,6 +71,21 @@
</action>
</extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.presets">
+ <static-preset
+ id="jboss.jst.cdi.preset">
+ <label>Dynamic Web Project with CDI (Context and Dependency Injection)</label>
+ <facet id="jst.java" version="6.0"/>
+ <facet id="jst.web" version="3.0"/>
+ <facet id="jst.jsf" version="2.0"/>
+ <facet id="jst.cdi" version="1.0"/>
+ <description>
+ Configures a Dynamic Web application to use Context and Dependency Injection (CDI)
+ </description>
+ </static-preset>
+ </extension>
+
<extension
point="org.eclipse.wst.common.project.facet.core.runtimes">
<supported>
14 years
JBoss Tools SVN: r27195 - trunk/cdi/plugins/org.jboss.tools.cdi.ui.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-12-06 12:20:54 -0500 (Mon, 06 Dec 2010)
New Revision: 27195
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
Log:
https://jira.jboss.org/browse/JBIDE-7797
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2010-12-06 16:14:38 UTC (rev 27194)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2010-12-06 17:20:54 UTC (rev 27195)
@@ -1,14 +1,14 @@
# Menus
-PreferencePage_CDISettings=CDI Settings
-ConfigureMenu_AddCDISupport=Add CDI support...
-ConfigureMenu_RemoveCDISupport=Remove CDI support...
+PreferencePage_CDISettings=CDI (Context and Dependency Injection) Settings
+ConfigureMenu_AddCDISupport=Add CDI (Context and Dependency Injection) support...
+ConfigureMenu_RemoveCDISupport=Remove CDI (Context and Dependency Injection) support...
PreferencePage_Validator=Validator
-PreferencePage_CDI=CDI
+PreferencePage_CDI=CDI (Context and Dependency Injection)
Bundle-Vendor.0 = JBoss by Red Hat
Bundle-Name.0 = Context and Dependency Injection UI
-proposalCategory.cdiClass= JBoss CDI Class Proposals
+proposalCategory.cdiClass= JBoss CDI (Context and Dependency Injection) Class Proposals
-preferenceKeywords.newJava=CDI
+preferenceKeywords.newJava=CDI (Context and Dependency Injection)
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-12-06 16:14:38 UTC (rev 27194)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-12-06 17:20:54 UTC (rev 27195)
@@ -128,7 +128,7 @@
<extension point="org.eclipse.ui.newWizards">
<category
- name="CDI"
+ name="CDI (Context and Dependency Injection)"
id="org.jboss.tools.cdi.ui">
</category>
<wizard
14 years
JBoss Tools SVN: r27194 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-12-06 11:14:38 -0500 (Mon, 06 Dec 2010)
New Revision: 27194
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
Log:
https://jira.jboss.org/browse/JBIDE-7238 - fixed
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2010-12-06 16:01:31 UTC (rev 27193)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2010-12-06 16:14:38 UTC (rev 27194)
@@ -638,7 +638,7 @@
description="Query"
name="query_string"
type="string"
- value="from $fullClassName"/>
+ value="from <fullClassName>"/>
</exporter>
</extension>
<extension
14 years
JBoss Tools SVN: r27193 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-12-06 11:01:31 -0500 (Mon, 06 Dec 2010)
New Revision: 27193
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeFieldStaticMarkerResolution.java
Log:
https://jira.jboss.org/browse/JBIDE-7674
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeFieldStaticMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeFieldStaticMarkerResolution.java 2010-12-06 16:00:50 UTC (rev 27192)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeFieldStaticMarkerResolution.java 2010-12-06 16:01:31 UTC (rev 27193)
@@ -20,6 +20,7 @@
import org.eclipse.jdt.core.IBuffer;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.Signature;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IMarkerResolution2;
import org.jboss.tools.cdi.ui.CDIUIMessages;
@@ -33,7 +34,8 @@
private static final String PUBLIC = "public"; //$NON-NLS-1$
private static final String PRIVATE = "private"; //$NON-NLS-1$
private static final String PROTECTED = "protected"; //$NON-NLS-1$
- private static final String STATIC = " static"; //$NON-NLS-1$
+ private static final String STATIC = "static"; //$NON-NLS-1$
+ private static final String SPACE = " "; //$NON-NLS-1$
private String label;
private IField field;
@@ -63,13 +65,17 @@
int position = field.getSourceRange().getOffset();
if((flag & Flags.AccPublic) != 0){
position += text.indexOf(PUBLIC)+PUBLIC.length();
- buffer.replace(position, 0, STATIC);
+ buffer.replace(position, 0, SPACE+STATIC);
}else if((flag & Flags.AccPrivate) != 0){
position += text.indexOf(PRIVATE)+PRIVATE.length();
- buffer.replace(position, 0, STATIC);
+ buffer.replace(position, 0, SPACE+STATIC);
}else if((flag & Flags.AccProtected) != 0){
position += text.indexOf(PROTECTED)+PROTECTED.length();
- buffer.replace(position, 0, STATIC);
+ buffer.replace(position, 0, SPACE+STATIC);
+ }else{
+ String type = Signature.getSignatureSimpleName(field.getTypeSignature());
+ position += text.indexOf(type);
+ buffer.replace(position, 0, STATIC+SPACE);
}
compilationUnit.commitWorkingCopy(false, new NullProgressMonitor());
14 years
JBoss Tools SVN: r27192 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console: views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-12-06 11:00:50 -0500 (Mon, 06 Dec 2010)
New Revision: 27192
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
Log:
https://jira.jboss.org/browse/JBIDE-7804 - fixed
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2010-12-06 15:18:53 UTC (rev 27191)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2010-12-06 16:00:50 UTC (rev 27192)
@@ -142,7 +142,7 @@
SchemaExportAction_error_while_performing_schemaexport={0} error(s) while performing SchemaExport, see Error Log for details
SchemaExportAction_exception_running_schemaexport=Exception while running SchemaExport
SchemaExportAction_run_schemaexport=Run SchemaExport
-SchemaExportAction_sure_run_schemaexport=Are you sure you want to run SchemaExport on ''{0}''?
+SchemaExportAction_sure_run_schemaexport=Run SchemaExport will create/recreate all tables in DB.\nAll data in existing tables will be lost.\nAre you sure you want to run SchemaExport on ''{0}''?
ClearPlaceHolderJob_removing_place_holder=Removing place holder for pending node
PendingNode_error_getting_images=Error while getting images
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2010-12-06 15:18:53 UTC (rev 27191)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2010-12-06 16:00:50 UTC (rev 27192)
@@ -23,10 +23,13 @@
import java.util.Iterator;
+import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Shell;
import org.hibernate.HibernateException;
+import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.execution.ExecutionContext.Command;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
@@ -61,35 +64,57 @@
setId(SCHEMAEXPORT_ACTIONID);
}
+ /**
+ * Convenience method to open a standard warning Yes/No dialog.
+ *
+ * @param parent the parent shell of the dialog, or <code>null</code> if none
+ * @param title the dialog's title, or <code>null</code> if none
+ * @param msg the message
+ * @return <code>true</code> if the user presses the Yes button,
+ * <code>false</code> otherwise
+ */
+ public static boolean openWarningYesNoDlg(Shell parent, String title, String msg) {
+ String[] dialogButtonLabels = new String[] { IDialogConstants.YES_LABEL,
+ IDialogConstants.NO_LABEL };
+ MessageDialog dialog = new MessageDialog(parent, title, null, msg,
+ MessageDialog.WARNING, dialogButtonLabels, 0);
+ return dialog.open() == 0;
+ }
+
public void doRun() {
for (Iterator<?> i = getSelectedNonResources().iterator(); i.hasNext();) {
+ Object node = i.next();
+ if (!(node instanceof ConsoleConfiguration)) {
+ continue;
+ }
+ final ConsoleConfiguration config = (ConsoleConfiguration) node;
try {
- Object node = i.next();
- if ( node instanceof ConsoleConfiguration ) {
- final ConsoleConfiguration config = (ConsoleConfiguration) node;
config.execute( new Command() {
@SuppressWarnings("unchecked")
public Object execute() {
+ final Configuration cfg = config.getConfiguration();
+ if (cfg == null) {
+ return null;
+ }
String out = NLS.bind(HibernateConsoleMessages.SchemaExportAction_sure_run_schemaexport, config.getName());
- if ( config.getConfiguration() != null
- && MessageDialog.openConfirm( viewer.getControl().getShell(),
- HibernateConsoleMessages.SchemaExportAction_run_schemaexport,
- out ) ) {
- SchemaExport export = new SchemaExport( config
- .getConfiguration() );
- export.create( false, true );
- if ( !export.getExceptions().isEmpty() ) {
- Iterator<Throwable> iterator = export.getExceptions().iterator();
- int cnt = 1;
- while ( iterator.hasNext() ) {
- Throwable element = iterator.next();
- String outStr = NLS.bind(HibernateConsoleMessages.SchemaExportAction_errornum_while_performing_schemaexport, cnt++);
- HibernateConsolePlugin.getDefault().logErrorMessage(outStr, element );
- }
- HibernateConsolePlugin.getDefault().showError(viewer.getControl().getShell(),
- NLS.bind(HibernateConsoleMessages.SchemaExportAction_error_while_performing_schemaexport, cnt - 1),
- (Throwable)null );
+ boolean res = openWarningYesNoDlg(viewer.getControl().getShell(),
+ HibernateConsoleMessages.SchemaExportAction_run_schemaexport, out);
+ if (!res) {
+ return null;
+ }
+ SchemaExport export = new SchemaExport(cfg);
+ export.create(false, true);
+ if (!export.getExceptions().isEmpty()) {
+ Iterator<Throwable> iterator = export.getExceptions().iterator();
+ int cnt = 1;
+ while (iterator.hasNext()) {
+ Throwable element = iterator.next();
+ String outStr = NLS.bind(HibernateConsoleMessages.SchemaExportAction_errornum_while_performing_schemaexport, cnt++);
+ HibernateConsolePlugin.getDefault().logErrorMessage(outStr, element);
}
+ HibernateConsolePlugin.getDefault().showError(viewer.getControl().getShell(),
+ NLS.bind(HibernateConsoleMessages.SchemaExportAction_error_while_performing_schemaexport, cnt - 1),
+ (Throwable)null );
}
return null;
}
@@ -97,7 +122,6 @@
viewer.refresh( node ); // todo: should we do it here or should
// the view just react to config being
// build ?
- }
}
catch (HibernateException he) {
HibernateConsolePlugin.getDefault().showError(
14 years
JBoss Tools SVN: r27191 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-06 10:18:53 -0500 (Mon, 06 Dec 2010)
New Revision: 27191
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/LoadingCloudViewElement.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElementCategoryElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVRootElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CloudViewElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
Log:
[JBIDE-7819] fixing missing children in tree
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java 2010-12-06 13:38:34 UTC (rev 27190)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java 2010-12-06 15:18:53 UTC (rev 27191)
@@ -46,16 +46,22 @@
if (!initialized.get()) {
DeltaCloud cloud = (DeltaCloud) getElement();
CVCloudElementCategoryElement instances = new CVInstancesCategoryElement(cloud, viewer);
- addChild(instances);
+ addCategory(instances);
CVCloudElementCategoryElement images = new CVImagesCategoryElement(cloud, viewer);
- addChild(images);
+ addCategory(images);
}
initialized.set(true);
return super.getChildren();
}
+ private void addCategory(CVCloudElementCategoryElement categoryElement) {
+ children.add(categoryElement);
+ }
+
@Override
public IPropertySource getPropertySource() {
return new CloudPropertySource(getElement());
}
+
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElementCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElementCategoryElement.java 2010-12-06 13:38:34 UTC (rev 27190)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElementCategoryElement.java 2010-12-06 15:18:53 UTC (rev 27191)
@@ -22,6 +22,7 @@
public CVCloudElementCategoryElement(Object element, TreeViewer viewer) {
super(element, viewer);
+ addCloudElementListener(getCloud());
}
@Override
@@ -29,6 +30,22 @@
return true;
}
+ @Override
+ public Object[] getChildren() {
+ if (!initialized.get()) {
+ setLoadingIndicator();
+ asyncGetCloudElements();
+ initialized.set(true);
+ }
+ return super.getChildren();
+ }
+
+ private void setLoadingIndicator() {
+ children.add(new LoadingCloudViewElement(getViewer()));
+ }
+
+ protected abstract void asyncGetCloudElements();
+
protected void addChildren(Object[] modelElements) {
if (modelElements.length > CVNumericFoldingElement.FOLDING_SIZE) {
addFoldedChildren(modelElements);
@@ -67,4 +84,14 @@
protected DeltaCloud getCloud() {
return (DeltaCloud) getElement();
}
+
+ @Override
+ protected void dispose() {
+ removeCloudElementListener(getCloud());
+ }
+
+ protected abstract void addCloudElementListener(DeltaCloud cloud);
+
+ protected abstract void removeCloudElementListener(DeltaCloud cloud);
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-12-06 13:38:34 UTC (rev 27190)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-12-06 15:18:53 UTC (rev 27191)
@@ -31,21 +31,14 @@
public CVImagesCategoryElement(Object element, TreeViewer viewer) {
super(element, viewer);
- DeltaCloud cloud = getCloud();
- cloud.addImageListListener(this);
}
public String getName() {
return CVMessages.getString(IMAGE_CATEGORY_NAME);
}
- @Override
- public synchronized Object[] getChildren() {
- if (!initialized.get()) {
- new GetImagesCommand(getCloud()).execute();
- initialized.set(true);
- }
- return super.getChildren();
+ protected void asyncGetCloudElements() {
+ new GetImagesCommand(getCloud()).execute();
}
@Override
@@ -64,6 +57,7 @@
initialized.set(false);
DeltaCloudImage[] images = filter(newImages);
addChildren(images);
+// refresh();
} catch (DeltaCloudException e) {
// TODO: internationalize strings
ErrorUtils.handleError(
@@ -76,17 +70,32 @@
// refresh();
}
+ // private void refresh() {
+ // getViewer().getControl().getDisplay().asyncExec(new Runnable() {
+ //
+ // @Override
+ // public void run() {
+ // getViewer().refresh(this, true);
+ // }
+ // });
+ // }
+
public DeltaCloudImage[] filter(DeltaCloudImage[] images) throws DeltaCloudException {
DeltaCloud cloud = (DeltaCloud) getElement();
IImageFilter f = cloud.getImageFilter();
return f.filter(images).toArray(new DeltaCloudImage[images.length]);
}
- @Override
- protected void dispose() {
- DeltaCloud cloud = (DeltaCloud) getElement();
+ protected void addCloudElementListener(DeltaCloud cloud) {
if (cloud != null) {
+ cloud.addImageListListener(this);
+ }
+ }
+
+ protected void removeCloudElementListener(DeltaCloud cloud) {
+ if (cloud != null) {
cloud.removeImageListListener(this);
}
}
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-12-06 13:38:34 UTC (rev 27190)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-12-06 15:18:53 UTC (rev 27191)
@@ -31,21 +31,14 @@
public CVInstancesCategoryElement(Object element, TreeViewer viewer) {
super(element, viewer);
- DeltaCloud cloud = (DeltaCloud) getElement();
- cloud.addInstanceListListener(this);
}
public String getName() {
return CVMessages.getString(INSTANCE_CATEGORY_NAME);
}
- @Override
- public Object[] getChildren() {
- if (!initialized.get()) {
- new GetInstancesCommand(getCloud()).execute();
- initialized.set(true);
- }
- return super.getChildren();
+ protected void asyncGetCloudElements() {
+ new GetInstancesCommand(getCloud()).execute();
}
@Override
@@ -86,10 +79,14 @@
return f.filter(instances).toArray(new DeltaCloudInstance[instances.length]);
}
- @Override
- protected void dispose() {
- DeltaCloud cloud = (DeltaCloud) getElement();
+ protected void addCloudElementListener(DeltaCloud cloud) {
if (cloud != null) {
+ cloud.addInstanceListListener(this);
+ }
+ }
+
+ protected void removeCloudElementListener(DeltaCloud cloud) {
+ if (cloud != null) {
cloud.removeInstanceListListener(this);
}
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVRootElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVRootElement.java 2010-12-06 13:38:34 UTC (rev 27190)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVRootElement.java 2010-12-06 15:18:53 UTC (rev 27191)
@@ -25,8 +25,6 @@
*/
public class CVRootElement extends CloudViewElement implements ICloudManagerListener {
- private boolean initialized;
-
public CVRootElement(TreeViewer viewer) {
super(DeltaCloudManager.getDefault(), viewer); //$NON-NLS-1$
DeltaCloudManager.getDefault().addCloudManagerListener(this);
@@ -34,7 +32,7 @@
@Override
public String getName() {
- return "root";
+ return "root"; //$NON-NLS-1$
}
@Override
@@ -45,27 +43,24 @@
@Override
public Object[] getChildren() {
- if (!initialized) {
+ if (!initialized.get()) {
DeltaCloudManager m = DeltaCloudManager.getDefault();
- m.removeCloudManagerListener(this);
try {
- addChildren(m.getClouds());
+ addClouds(m.getClouds());
} catch (DeltaCloudException e) {
// TODO: internationalize strings
- ErrorUtils.handleError("Error", "Could not get all clouds", e, Display.getDefault().getActiveShell());
+ ErrorUtils.handleError("Error", "Could not get clouds", e, Display.getDefault().getActiveShell());
} finally {
- initialized = true;
- m.addCloudManagerListener(this);
+ initialized.set(true);
}
}
return super.getChildren();
}
- private void addChildren(DeltaCloud[] clouds) {
- for (int i = 0; i < clouds.length; ++i) {
- DeltaCloud cloud = clouds[i];
+ private void addClouds(DeltaCloud[] clouds) {
+ for (DeltaCloud cloud : clouds) {
CVCloudElement e = new CVCloudElement(cloud, cloud.getName(), getViewer());
- addChild(e);
+ children.add(e);
}
}
@@ -77,17 +72,9 @@
public void cloudsChanged(int type) {
DeltaCloudManager m = DeltaCloudManager.getDefault();
try {
- m.removeCloudManagerListener(this);
DeltaCloud[] clouds = m.getClouds();
- addChildren(clouds);
- initialized = true;
- m.addCloudManagerListener(this);
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- getViewer().refresh(this, false);
- }
- });
+ addClouds(clouds);
+ initialized.set(true);
} catch (DeltaCloudException e) {
// TODO: internationalize strings
ErrorUtils.handleError(
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CloudViewElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CloudViewElement.java 2010-12-06 13:38:34 UTC (rev 27190)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CloudViewElement.java 2010-12-06 15:18:53 UTC (rev 27191)
@@ -32,13 +32,13 @@
private TreeViewer viewer;
private Object element;
private CloudViewElement parent;
- private Collection<CloudViewElement> children;
+ protected Collection<CloudViewElement> children =
+ Collections.synchronizedCollection(new ArrayList<CloudViewElement>());
protected AtomicBoolean initialized = new AtomicBoolean();
public CloudViewElement(Object element, TreeViewer viewer) {
this.element = element;
this.viewer = viewer;
- children = Collections.synchronizedCollection(new ArrayList<CloudViewElement>());
initDisposeListener(viewer);
}
@@ -47,7 +47,7 @@
public Object[] getChildren() {
return children.toArray();
}
-
+
protected void clearChildren() {
children.clear();
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-12-06 13:38:34 UTC (rev 27190)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-12-06 15:18:53 UTC (rev 27191)
@@ -57,6 +57,7 @@
TreeViewer viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
viewer.setContentProvider(new CloudViewContentProvider());
viewer.setLabelProvider(new CloudViewLabelProvider());
+ viewer.setUseHashlookup(true);
viewer.setInput(new CVRootElement(viewer));
viewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
getSite().setSelectionProvider(viewer);
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/LoadingCloudViewElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/LoadingCloudViewElement.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/LoadingCloudViewElement.java 2010-12-06 15:18:53 UTC (rev 27191)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.ui.views;
+
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+/**
+ * A tree element that shows the user that the tree is currently loading
+ * elements
+ */
+public class LoadingCloudViewElement extends CloudViewElement {
+ protected LoadingCloudViewElement(TreeViewer viewer) {
+ super(null, viewer);
+ }
+
+ @Override
+ public IPropertySource getPropertySource() {
+ // no property source for this element
+ return null;
+ }
+
+ @Override
+ public String getName() {
+ // TODO: internationalize strings
+ return "Loading...";
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/LoadingCloudViewElement.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years
JBoss Tools SVN: r27190 - 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-12-06 08:38:34 -0500 (Mon, 06 Dec 2010)
New Revision: 27190
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElementCategoryElement.java
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCategoryElement.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllImageFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/AbstractCloudElementViewLabelAndContentProvider.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImageElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVNumericFoldingElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVRootElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CloudViewElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CloudViewLabelProvider.java
Log:
[JBIDE-7819]
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -35,9 +35,9 @@
private IFieldMatcher nameRule;
private IFieldMatcher idRule;
- public Collection<CLOUDELEMENT> filter() throws DeltaCloudException {
+ public Collection<CLOUDELEMENT> filter(CLOUDELEMENT[] cloudElements) throws DeltaCloudException {
List<CLOUDELEMENT> filteredElements = new ArrayList<CLOUDELEMENT>();
- for (CLOUDELEMENT cloudElement : getCloudElements()) {
+ for (CLOUDELEMENT cloudElement : cloudElements) {
if (matches(cloudElement)) {
filteredElements.add(cloudElement);
}
@@ -45,8 +45,6 @@
return filteredElements;
}
- protected abstract CLOUDELEMENT[] getCloudElements() throws DeltaCloudException;
-
protected boolean matches(CLOUDELEMENT cloudElement) {
return nameRule.matches(cloudElement.getName())
&& idRule.matches(cloudElement.getId());
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllImageFilter.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllImageFilter.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -23,7 +23,6 @@
private IFieldMatcher matcher = new AllFieldMatcher();
-
public AllImageFilter(DeltaCloud cloud) {
super(cloud);
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -18,11 +18,6 @@
private IFieldMatcher matcher = new AllFieldMatcher();
@Override
- protected DeltaCloudInstance[] getCloudElements() throws DeltaCloudException {
- return getCloud().getInstances();
- }
-
- @Override
public boolean matches(DeltaCloudInstance instance) {
return true;
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -35,7 +35,7 @@
+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // arch
+ ALL_MATCHER_EXPRESSION; // desc
- public Collection<CLOUDELEMENT> filter() throws DeltaCloudException;
+ public Collection<CLOUDELEMENT> filter(CLOUDELEMENT[] cloudElements) throws DeltaCloudException;
public void setRules(String ruleString);
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -60,9 +60,4 @@
public IFieldMatcher getDescRule() {
return descRule;
}
-
- @Override
- protected DeltaCloudImage[] getCloudElements() throws DeltaCloudException {
- return getCloud().getImages();
- }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -87,9 +87,4 @@
public IFieldMatcher getRealmRule() {
return realmRule;
}
-
- @Override
- protected DeltaCloudInstance[] getCloudElements() throws DeltaCloudException {
- return getCloud().getInstances();
- }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/AbstractCloudElementViewLabelAndContentProvider.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/AbstractCloudElementViewLabelAndContentProvider.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/AbstractCloudElementViewLabelAndContentProvider.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -106,7 +106,7 @@
if (filter == null) {
return cloudElements;
} else {
- return filter.filter().toArray();
+ return filter.filter(cloudElements).toArray();
}
}
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCategoryElement.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCategoryElement.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat 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:
- * Red Hat Incorporated - initial API and implementation
- *******************************************************************************/
-package org.jboss.tools.deltacloud.ui.views;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.jboss.tools.deltacloud.core.DeltaCloud;
-import org.jboss.tools.deltacloud.core.DeltaCloudImage;
-import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
-
-/**
- * @author Jeff Johnston
- * @author Andre Dietisheim
- */
-public abstract class CVCategoryElement extends CloudViewElement {
-
- protected boolean initialized;
- private TreeViewer viewer;
-
- public CVCategoryElement(Object element, TreeViewer viewer) {
- super(element);
- this.viewer = viewer;
- viewer.getControl().addDisposeListener(onDispose());
- }
-
- @Override
- public Object[] getChildren() {
- return super.getChildren();
- }
-
- @Override
- public boolean hasChildren() {
- return true;
- }
-
- protected void addChildren(Object[] modelElements) {
- if (modelElements.length > CVNumericFoldingElement.FOLDING_SIZE) {
- addFoldedChildren(modelElements);
- } else {
- addChildren(getElements(modelElements, 0, modelElements.length));
- }
- }
-
- protected void addFoldedChildren(Object[] modelElements) {
- int min = 0;
- int max = CVNumericFoldingElement.FOLDING_SIZE;
- int length = modelElements.length;
- while (length > CVNumericFoldingElement.FOLDING_SIZE) {
- CVNumericFoldingElement f = new CVNumericFoldingElement(min, max);
- addChild(f);
- f.addChildren(getElements(modelElements, min, max));
- min += CVNumericFoldingElement.FOLDING_SIZE;
- max += CVNumericFoldingElement.FOLDING_SIZE;
- length -= CVNumericFoldingElement.FOLDING_SIZE;
- }
- if (length > 0) {
- CVNumericFoldingElement f = new CVNumericFoldingElement(min, max);
- addChild(f);
- f.addChildren(getElements(modelElements, min, min + length));
- }
- }
-
- protected abstract CloudViewElement[] getElements(Object[] modelElements, int startIndex, int stopIndex);
-
- @Override
- public IPropertySource getPropertySource() {
- // no property source for cathegories
- return null;
- }
-
- protected Viewer getViewer() {
- return viewer;
- }
-
- protected void refresh() {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- IStructuredSelection oldSelection = (IStructuredSelection) viewer.getSelection();
- ((TreeViewer) viewer).refresh(CVCategoryElement.this, false);
- restoreSelection(oldSelection);
- }
- });
- }
-
- /**
- * This is a workaround:
- *
- * When a change in the list of instances happens, DeltaCloud notifies this
- * class with the list of all instances (@see
- * DeltaCloud#performInstanceAction). This class then removes all children
- * and readds new children with the same DeltaCloudInstance instances.
- *
- * <p>
- * I also tried an alternative approach where I implemented an equals method
- * in CVInstanceElement that returns <code>true</code> if both elements have
- * the same DeltaCloudInsta instance. The consequence is that the viewer
- * keeps the selection, but is not aware of a change in the underlying
- * items. The consequence is that the context-menu does not change its state
- * (the instance action, that was executed, should disappear) and the
- * properties view does not update either.
- *
- * @param selection
- *
- * @see DeltaCloud#performInstanceAction
- * @see #listChanged
- */
- private void restoreSelection(IStructuredSelection selection) {
- List<?> newSelectedElements = getChildrenWithSameElement(selection.toList());
- if (newSelectedElements != null && newSelectedElements.size() > 0) {
- ISelection newSelection = new StructuredSelection(newSelectedElements);
- viewer.setSelection(newSelection);
- }
- }
-
- /**
- * Returns the children of this category element that have the same elements
- * (#getElement) as the given items. This method is used to restore
- * selection after the {@link CVInstanceElement} or {@link CVImageElement}
- * have been recreated. They still have the same {@link DeltaCloudInstance}
- * or {@link DeltaCloudImage}.
- *
- * @param elementsToMatch
- * the elements to match
- * @return the children with same element
- *
- * @see #CloudViewElement#getElement
- * @see CVInstanceElement
- * @see CVImageElement
- */
- private List<?> getChildrenWithSameElement(List<?> itemsToMatch) {
- if (itemsToMatch == null || itemsToMatch.size() == 0) {
- return Collections.EMPTY_LIST;
- }
- List<Object> children = new ArrayList<Object>();
- for (Object itemToMatch : itemsToMatch) {
- Object elementToMatch = ((CloudViewElement) itemToMatch).getElement();
- if (elementToMatch != null) {
- for (Object child : getChildren()) {
- Object childElement = ((CloudViewElement) child).getElement();
- if (elementToMatch.equals(childElement)) {
- children.add(child);
- }
- }
- }
- }
- return children;
- }
-
- private DisposeListener onDispose() {
- return new DisposeListener() {
-
- @Override
- public void widgetDisposed(DisposeEvent e) {
- dispose();
- }
- };
- }
-
- protected DeltaCloud getCloud() {
- return (DeltaCloud) getElement();
- }
-
- protected abstract void dispose();
-}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -11,7 +11,6 @@
package org.jboss.tools.deltacloud.ui.views;
import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.views.properties.IPropertySource;
import org.jboss.tools.deltacloud.core.DeltaCloud;
@@ -22,10 +21,9 @@
public class CVCloudElement extends CloudViewElement {
private TreeViewer viewer;
- private boolean initialized;
public CVCloudElement(Object element, String name, TreeViewer viewer) {
- super(element);
+ super(element, viewer);
this.viewer = viewer;
}
@@ -37,10 +35,6 @@
return "";
}
}
-
- public Viewer getViewer() {
- return viewer;
- }
@Override
public boolean hasChildren() {
@@ -49,14 +43,14 @@
@Override
public synchronized Object[] getChildren() {
- if (!initialized) {
+ if (!initialized.get()) {
DeltaCloud cloud = (DeltaCloud) getElement();
- CVCategoryElement c1 = new CVInstancesCategoryElement(cloud, viewer);
- CVCategoryElement c2 = new CVImagesCategoryElement(cloud, viewer);
- addChild(c1);
- addChild(c2);
+ CVCloudElementCategoryElement instances = new CVInstancesCategoryElement(cloud, viewer);
+ addChild(instances);
+ CVCloudElementCategoryElement images = new CVImagesCategoryElement(cloud, viewer);
+ addChild(images);
}
- initialized = true;
+ initialized.set(true);
return super.getChildren();
}
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElementCategoryElement.java (from rev 27185, trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCategoryElement.java)
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElementCategoryElement.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElementCategoryElement.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat 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:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.ui.views;
+
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+
+/**
+ * @author Jeff Johnston
+ * @author Andre Dietisheim
+ */
+public abstract class CVCloudElementCategoryElement extends CloudViewElement {
+
+ public CVCloudElementCategoryElement(Object element, TreeViewer viewer) {
+ super(element, viewer);
+ }
+
+ @Override
+ public boolean hasChildren() {
+ return true;
+ }
+
+ protected void addChildren(Object[] modelElements) {
+ if (modelElements.length > CVNumericFoldingElement.FOLDING_SIZE) {
+ addFoldedChildren(modelElements);
+ } else {
+ addChildren(getElements(modelElements, 0, modelElements.length));
+ }
+ }
+
+ protected void addFoldedChildren(Object[] modelElements) {
+ int min = 0;
+ int max = CVNumericFoldingElement.FOLDING_SIZE;
+ int length = modelElements.length;
+ while (length > CVNumericFoldingElement.FOLDING_SIZE) {
+ CVNumericFoldingElement f = new CVNumericFoldingElement(min, max, getViewer());
+ addChild(f);
+ f.addChildren(getElements(modelElements, min, max));
+ min += CVNumericFoldingElement.FOLDING_SIZE;
+ max += CVNumericFoldingElement.FOLDING_SIZE;
+ length -= CVNumericFoldingElement.FOLDING_SIZE;
+ }
+ if (length > 0) {
+ CVNumericFoldingElement f = new CVNumericFoldingElement(min, max, getViewer());
+ addChild(f);
+ f.addChildren(getElements(modelElements, min, min + length));
+ }
+ }
+
+ protected abstract CloudViewElement[] getElements(Object[] modelElements, int startIndex, int stopIndex);
+
+ @Override
+ public IPropertySource getPropertySource() {
+ // no property source for cathegories
+ return null;
+ }
+
+ protected DeltaCloud getCloud() {
+ return (DeltaCloud) getElement();
+ }
+}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImageElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImageElement.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImageElement.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views;
+import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.ui.views.properties.IPropertySource;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
@@ -19,8 +20,8 @@
*/
public class CVImageElement extends CloudViewElement {
- public CVImageElement(Object element) {
- super(element);
+ public CVImageElement(Object element, TreeViewer viewer) {
+ super(element, viewer);
}
public String getName() {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -25,7 +25,7 @@
* @author Jeff Johnston
* @author Andre Dietisheim
*/
-public class CVImagesCategoryElement extends CVCategoryElement implements IImageListListener {
+public class CVImagesCategoryElement extends CVCloudElementCategoryElement implements IImageListListener {
private static final String IMAGE_CATEGORY_NAME = "ImageCategoryName"; //$NON-NLS-1$
@@ -41,8 +41,9 @@
@Override
public synchronized Object[] getChildren() {
- if (!initialized) {
+ if (!initialized.get()) {
new GetImagesCommand(getCloud()).execute();
+ initialized.set(true);
}
return super.getChildren();
}
@@ -51,7 +52,7 @@
protected CloudViewElement[] getElements(Object[] modelElements, int startIndex, int stopIndex) {
CloudViewElement[] elements = new CloudViewElement[stopIndex - startIndex];
for (int i = startIndex; i < stopIndex; ++i) {
- elements[i - startIndex] = new CVImageElement(modelElements[i]);
+ elements[i - startIndex] = new CVImageElement(modelElements[i], getViewer());
}
return elements;
}
@@ -60,8 +61,8 @@
public synchronized void listChanged(DeltaCloud cloud, DeltaCloudImage[] newImages) {
try {
clearChildren();
- initialized = false;
- DeltaCloudImage[] images = filter();
+ initialized.set(false);
+ DeltaCloudImage[] images = filter(newImages);
addChildren(images);
} catch (DeltaCloudException e) {
// TODO: internationalize strings
@@ -70,15 +71,15 @@
MessageFormat.format("Could not get images from cloud \"{0}\"", cloud.getName()), e,
getViewer().getControl().getShell());
} finally {
- initialized = true;
+ initialized.set(true);
}
// refresh();
}
- public DeltaCloudImage[] filter() throws DeltaCloudException {
+ public DeltaCloudImage[] filter(DeltaCloudImage[] images) throws DeltaCloudException {
DeltaCloud cloud = (DeltaCloud) getElement();
IImageFilter f = cloud.getImageFilter();
- return f.filter().toArray(new DeltaCloudImage[] {});
+ return f.filter(images).toArray(new DeltaCloudImage[images.length]);
}
@Override
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views;
+import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.ui.views.properties.IPropertySource;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
@@ -19,8 +20,8 @@
*/
public class CVInstanceElement extends CloudViewElement {
- public CVInstanceElement(Object element) {
- super(element);
+ public CVInstanceElement(Object element, TreeViewer viewer) {
+ super(element, viewer);
}
public String getName() {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -25,7 +25,7 @@
* @author Jeff Johnston
* @author Andre Dietisheim
*/
-public class CVInstancesCategoryElement extends CVCategoryElement implements IInstanceListListener {
+public class CVInstancesCategoryElement extends CVCloudElementCategoryElement implements IInstanceListListener {
private static final String INSTANCE_CATEGORY_NAME = "InstanceCategoryName"; //$NON-NLS-1$
@@ -41,8 +41,9 @@
@Override
public Object[] getChildren() {
- if (!initialized) {
+ if (!initialized.get()) {
new GetInstancesCommand(getCloud()).execute();
+ initialized.set(true);
}
return super.getChildren();
}
@@ -51,22 +52,23 @@
protected CloudViewElement[] getElements(Object[] modelElements, int startIndex, int stopIndex) {
CloudViewElement[] elements = new CloudViewElement[stopIndex - startIndex];
for (int i = startIndex; i < stopIndex; ++i) {
- elements[i - startIndex] = new CVInstanceElement(modelElements[i]);
+ elements[i - startIndex] = new CVInstanceElement(modelElements[i], getViewer());
}
return elements;
}
protected void addChildrenFor(Object[] modelElements, int startIndex, int stopIndex) {
for (int i = startIndex; i < stopIndex; ++i) {
- addChild(new CVInstanceElement(modelElements[i]));
+ addChild(new CVInstanceElement(modelElements[i], getViewer()));
}
}
@Override
public void listChanged(DeltaCloud cloud, DeltaCloudInstance[] newInstances) {
try {
+ initialized.set(false);
clearChildren();
- final DeltaCloudInstance[] instances = filter();
+ final DeltaCloudInstance[] instances = filter(newInstances);
addChildren(instances);
} catch (DeltaCloudException e) {
// TODO: internationalize strings
@@ -75,13 +77,13 @@
MessageFormat.format("Could not get instanceso from cloud \"{0}\"", cloud.getName()), e,
getViewer().getControl().getShell());
} finally {
- initialized = true;
+ initialized.set(true);
}
}
- public DeltaCloudInstance[] filter() throws DeltaCloudException {
+ public DeltaCloudInstance[] filter(DeltaCloudInstance[] instances) throws DeltaCloudException {
IInstanceFilter f = getCloud().getInstanceFilter();
- return f.filter().toArray(new DeltaCloudInstance[] {});
+ return f.filter(instances).toArray(new DeltaCloudInstance[instances.length]);
}
@Override
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVNumericFoldingElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVNumericFoldingElement.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVNumericFoldingElement.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views;
+import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.ui.views.properties.IPropertySource;
/**
@@ -22,8 +23,8 @@
private Object min;
private int max;
- public CVNumericFoldingElement(int min, int max) {
- super(null);
+ public CVNumericFoldingElement(int min, int max, TreeViewer viewer) {
+ super(null, viewer);
this.min = min;
this.max = max;
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVRootElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVRootElement.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVRootElement.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -26,18 +26,17 @@
public class CVRootElement extends CloudViewElement implements ICloudManagerListener {
private boolean initialized;
- private TreeViewer viewer;
public CVRootElement(TreeViewer viewer) {
- super(DeltaCloudManager.getDefault()); //$NON-NLS-1$
- this.viewer = viewer;
+ super(DeltaCloudManager.getDefault(), viewer); //$NON-NLS-1$
+ DeltaCloudManager.getDefault().addCloudManagerListener(this);
}
@Override
public String getName() {
return "root";
}
-
+
@Override
public IPropertySource getPropertySource() {
// no property source for the root element
@@ -49,31 +48,30 @@
if (!initialized) {
DeltaCloudManager m = DeltaCloudManager.getDefault();
m.removeCloudManagerListener(this);
- DeltaCloud[] clouds = new DeltaCloud[] {};
try {
- clouds = m.getClouds();
+ addChildren(m.getClouds());
} catch (DeltaCloudException e) {
// TODO: internationalize strings
- ErrorUtils.handleError(
- "Error",
- "Could not get all clouds",
- e, Display.getDefault().getActiveShell());
+ ErrorUtils.handleError("Error", "Could not get all clouds", e, Display.getDefault().getActiveShell());
+ } finally {
+ initialized = true;
+ m.addCloudManagerListener(this);
}
- for (int i = 0; i < clouds.length; ++i) {
- DeltaCloud cloud = clouds[i];
- CVCloudElement e = new CVCloudElement(cloud, cloud.getName(), viewer);
- addChild(e);
- }
- m.addCloudManagerListener(this);
- initialized = true;
}
return super.getChildren();
}
+ private void addChildren(DeltaCloud[] clouds) {
+ for (int i = 0; i < clouds.length; ++i) {
+ DeltaCloud cloud = clouds[i];
+ CVCloudElement e = new CVCloudElement(cloud, cloud.getName(), getViewer());
+ addChild(e);
+ }
+ }
+
@Override
- protected void finalize() throws Throwable {
+ public void dispose() {
DeltaCloudManager.getDefault().removeCloudManagerListener(this);
- super.finalize();
}
public void cloudsChanged(int type) {
@@ -81,17 +79,13 @@
try {
m.removeCloudManagerListener(this);
DeltaCloud[] clouds = m.getClouds();
- for (int i = 0; i < clouds.length; ++i) {
- DeltaCloud cloud = clouds[i];
- CVCloudElement e = new CVCloudElement(cloud, cloud.getName(), viewer);
- addChild(e);
- }
+ addChildren(clouds);
initialized = true;
m.addCloudManagerListener(this);
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
- ((TreeViewer) viewer).refresh(this, false);
+ getViewer().refresh(this, false);
}
});
} catch (DeltaCloudException e) {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CloudViewElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CloudViewElement.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CloudViewElement.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -11,9 +11,16 @@
package org.jboss.tools.deltacloud.ui.views;
import java.util.ArrayList;
-import java.util.List;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.atomic.AtomicBoolean;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.views.properties.IPropertySource;
/**
@@ -22,50 +29,69 @@
*/
public abstract class CloudViewElement implements IAdaptable {
+ private TreeViewer viewer;
private Object element;
private CloudViewElement parent;
- private List<CloudViewElement> children;
+ private Collection<CloudViewElement> children;
+ protected AtomicBoolean initialized = new AtomicBoolean();
- public abstract IPropertySource getPropertySource();
-
+ public CloudViewElement(Object element, TreeViewer viewer) {
+ this.element = element;
+ this.viewer = viewer;
+ children = Collections.synchronizedCollection(new ArrayList<CloudViewElement>());
+ initDisposeListener(viewer);
+ }
+
+ public abstract String getName();
+
public Object[] getChildren() {
return children.toArray();
}
-
+
protected void clearChildren() {
children.clear();
}
-
+
public boolean hasChildren() {
return children.size() > 0;
}
-
+
public Object getParent() {
return parent;
}
-
- public void addChild(CloudViewElement e) {
- children.add(e);
- e.setParent(this);
+
+ public void addChild(final CloudViewElement e) {
+ addChildToModel(e);
+ getViewer().getControl().getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ getViewer().add(this, e);
+ }
+ });
}
-
- public void addChildren(CloudViewElement[] elements) {
- for(CloudViewElement element : elements) {
- addChild(element);
+
+ public void addChildToModel(CloudViewElement element) {
+ children.add(element);
+ element.setParent(this);
+ }
+
+ public void addChildren(final CloudViewElement[] elements) {
+ for (CloudViewElement element : elements) {
+ addChildToModel(element);
}
+
+ getViewer().getControl().getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ getViewer().add(this, elements);
+ }
+ });
}
public void setParent(CloudViewElement e) {
parent = e;
}
-
- public CloudViewElement(Object element) {
- this.element = element;
- children = new ArrayList<CloudViewElement>();
- }
-
- public abstract String getName();
-
+
public Object getElement() {
return element;
}
@@ -79,4 +105,31 @@
}
return null;
}
+
+ public abstract IPropertySource getPropertySource();
+
+ protected TreeViewer getViewer() {
+ return viewer;
+ }
+
+ private void initDisposeListener(Viewer viewer) {
+ final Control control = viewer.getControl();
+ control.getDisplay().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ control.addDisposeListener(new DisposeListener() {
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ dispose();
+ }
+ });
+ }
+ });
+ }
+
+ protected void dispose() {
+ // nothing to do
+ }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CloudViewLabelProvider.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CloudViewLabelProvider.java 2010-12-06 11:48:52 UTC (rev 27189)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CloudViewLabelProvider.java 2010-12-06 13:38:34 UTC (rev 27190)
@@ -20,7 +20,7 @@
public Image getImage(Object element) {
if (element instanceof CVCloudElement) {
return SWTImagesFactory.get(SWTImagesFactory.IMG_CLOUD);
- } else if (element instanceof CVCategoryElement ||
+ } else if (element instanceof CVCloudElementCategoryElement ||
element instanceof CVNumericFoldingElement) {
return SWTImagesFactory.get(SWTImagesFactory.IMG_FOLDER);
} else if (element instanceof CVInstanceElement) {
14 years
JBoss Tools SVN: r27189 - trunk/cdi/plugins/org.jboss.tools.cdi.ui.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-06 06:48:52 -0500 (Mon, 06 Dec 2010)
New Revision: 27189
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
Log:
JBIDE-7802
https://jira.jboss.org/browse/JBIDE-7802
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2010-12-06 11:41:11 UTC (rev 27188)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2010-12-06 11:48:52 UTC (rev 27189)
@@ -9,4 +9,6 @@
Bundle-Vendor.0 = JBoss by Red Hat
Bundle-Name.0 = Context and Dependency Injection UI
-proposalCategory.cdiClass= JBoss CDI Class Proposals
\ No newline at end of file
+proposalCategory.cdiClass= JBoss CDI Class Proposals
+
+preferenceKeywords.newJava=CDI
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-12-06 11:41:11 UTC (rev 27188)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-12-06 11:48:52 UTC (rev 27189)
@@ -141,6 +141,9 @@
<description>
Create a Qualifier Java File
</description>
+ <keywordReference
+ id="org.jboss.tools.cdi.ui.newJava">
+ </keywordReference>
</wizard>
<wizard
@@ -153,6 +156,9 @@
<description>
Create a Stereotype Java File
</description>
+ <keywordReference
+ id="org.jboss.tools.cdi.ui.newJava">
+ </keywordReference>
</wizard>
<wizard
@@ -165,6 +171,9 @@
<description>
Create a Scope Java File
</description>
+ <keywordReference
+ id="org.jboss.tools.cdi.ui.newJava">
+ </keywordReference>
</wizard>
<wizard
@@ -177,6 +186,9 @@
<description>
Create a Interceptor Binding Java File
</description>
+ <keywordReference
+ id="org.jboss.tools.cdi.ui.newJava">
+ </keywordReference>
</wizard>
<wizard
@@ -189,6 +201,9 @@
<description>
Create an Interceptor Java File
</description>
+ <keywordReference
+ id="org.jboss.tools.cdi.ui.newJava">
+ </keywordReference>
</wizard>
<wizard
@@ -201,10 +216,21 @@
<description>
Create an Decorator Java File
</description>
+ <keywordReference
+ id="org.jboss.tools.cdi.ui.newJava">
+ </keywordReference>
</wizard>
</extension>
+ <extension
+ point="org.eclipse.ui.keywords">
+ <keyword
+ label="%preferenceKeywords.newJava"
+ id="org.jboss.tools.cdi.ui.newJava"/>
+
+ </extension>
+
<extension
point="org.eclipse.wst.sse.ui.completionProposal">
<proposalCategory
14 years
JBoss Tools SVN: r27188 - in trunk/documentation/whatsnew: bpel and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2010-12-06 06:41:11 -0500 (Mon, 06 Dec 2010)
New Revision: 27188
Modified:
trunk/documentation/whatsnew/bpel/bpel-news-1.1.0.beta2.html
trunk/documentation/whatsnew/index.html
Log:
fix broken bpel news and text link
Modified: trunk/documentation/whatsnew/bpel/bpel-news-1.1.0.beta2.html
===================================================================
--- trunk/documentation/whatsnew/bpel/bpel-news-1.1.0.beta2.html 2010-12-06 11:24:31 UTC (rev 27187)
+++ trunk/documentation/whatsnew/bpel/bpel-news-1.1.0.beta2.html 2010-12-06 11:41:11 UTC (rev 27188)
@@ -9,7 +9,7 @@
<title>BPEL Tools 1.1.0.beta1 What's New</title>
</head>
<body>
-<h1>JBoss Eclipse BPEL Editor 1.1.0.beta1 What's New</h1>
+<h1>JBoss Eclipse BPEL Editor 1.1.0.beta2 What's New</h1>
<p align="right"><a href="../index.html">< Main Index</a> <a href="../esb/esb-news-1.4.0.M2.html">ESB Tools ></a></p>
<table border="0" cellpadding="10" cellspacing="0" width="80%">
Modified: trunk/documentation/whatsnew/index.html
===================================================================
--- trunk/documentation/whatsnew/index.html 2010-12-06 11:24:31 UTC (rev 27187)
+++ trunk/documentation/whatsnew/index.html 2010-12-06 11:41:11 UTC (rev 27188)
@@ -37,7 +37,7 @@
<p><a href="drools/guvnor-tools-news-5.1.0.Beta2.html">Drools Guvnor Tools</a></p>
- <p><a href="bpel/bpel-news-1.1.0.beta1.html">BPEL Tools</a></p>
+ <p><a href="bpel/bpel-news-1.1.0.beta2.html">BPEL Tools</a></p>
<p><a href="esb/esb-news-1.4.0.Beta2.html">ESB Tools</a></p>
<p><a href="modeshape/modeshape-news-3.2.0.Beta2.html">Modeshape</a></p>
14 years