JBoss Tools SVN: r38850 - in trunk: central/plugins/org.jboss.tools.central/src/org/jboss/tools/central and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-16 19:16:47 -0500 (Thu, 16 Feb 2012)
New Revision: 38850
Added:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/AbstractJBossCentralProjectWizard.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewGwtProjectWizard.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewHtml5ProjectWizard.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewJavaeeEarProjectWizard.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewJavaeeWarProjectWizard.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewRichfacesProjectWizard.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewSpringMvcProjectWizard.java
Modified:
trunk/central/plugins/org.jboss.tools.central/plugin.xml
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshTutorialsJob.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard2.java
Log:
JBIDE-10212 : create wizards for the projects examples in JBoss Central - WIP
Modified: trunk/central/plugins/org.jboss.tools.central/plugin.xml
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/plugin.xml 2012-02-16 22:43:35 UTC (rev 38849)
+++ trunk/central/plugins/org.jboss.tools.central/plugin.xml 2012-02-17 00:16:47 UTC (rev 38850)
@@ -194,4 +194,78 @@
icon="icons/examples_wiz.gif">
</image>
</extension>
+
+ <!-- new wizards -->
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
+ id="org.jboss.tools.central.ui.wizard.category"
+ name="JBoss Central">
+ </category>
+ <wizard
+ category="org.jboss.tools.central.ui.wizard.category"
+ id="org.jboss.tools.central.wizards.NewJavaeeWarProjectWizard"
+ class="org.jboss.tools.central.wizards.NewJavaeeWarProjectWizard"
+ icon="icons/newwebprj_wiz.gif"
+ name="Java EE Web Project"
+ project="true">
+ </wizard>
+ <wizard
+ category="org.jboss.tools.central.ui.wizard.category"
+ id="org.jboss.tools.central.wizards.NewJavaeeEarProjectWizard"
+ class="org.jboss.tools.central.wizards.NewJavaeeEarProjectWizard"
+ icon="icons/ear-wiz-icon.gif"
+ name="Java EE Project"
+ project="true">
+ </wizard>
+ <wizard
+ category="org.jboss.tools.central.ui.wizard.category"
+ id="org.jboss.tools.central.wizards.NewHtml5ProjectWizard"
+ class="org.jboss.tools.central.wizards.NewHtml5ProjectWizard"
+ icon="icons/html5.png"
+ name="HTML5 Project"
+ project="true">
+ </wizard>
+ <wizard
+ category="org.jboss.tools.central.ui.wizard.category"
+ id="org.jboss.tools.central.wizards.NewRichfacesProjectWizard"
+ class="org.jboss.tools.central.wizards.NewRichfacesProjectWizard"
+ icon="icons/rf_logo.png"
+ name="RichFaces Project"
+ project="true">
+ </wizard>
+ <wizard
+ category="org.jboss.tools.central.ui.wizard.category"
+ id="org.jboss.tools.central.wizards.NewSpringMvcProjectWizard"
+ class="org.jboss.tools.central.wizards.NewSpringMvcProjectWizard"
+ icon="icons/spring_wiz.gif"
+ name="Spring MVC Project"
+ project="true">
+ </wizard>
+ <wizard
+ category="org.jboss.tools.central.ui.wizard.category"
+ id="org.jboss.tools.central.wizards.NewGwtProjectWizard"
+ class="org.jboss.tools.central.wizards.NewGwtProjectWizard"
+ icon="icons/new-gdt-project.png"
+ name="GWT Web Project"
+ project="true">
+ </wizard>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.jboss.tools.common.ui.JBossPerspective">
+ <newWizardShortcut id="org.jboss.tools.central.wizards.NewJavaeeWarProjectWizard" />
+ <newWizardShortcut id="org.jboss.tools.central.wizards.NewJavaeeEarProjectWizard"/>
+ <newWizardShortcut id="org.jboss.tools.central.wizards.NewHtml5ProjectWizard"/>
+ <newWizardShortcut id="org.jboss.tools.central.wizards.NewRichfacesProjectWizard"/>
+ <newWizardShortcut id="org.jboss.tools.central.wizards.NewSpringMvcProjectWizard"/>
+ <newWizardShortcut id="org.jboss.tools.central.wizards.NewGwtProjectWizard"/>
+ </perspectiveExtension>
+ </extension>
+
+
+
+
</plugin>
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshTutorialsJob.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshTutorialsJob.java 2012-02-16 22:43:35 UTC (rev 38849)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshTutorialsJob.java 2012-02-17 00:16:47 UTC (rev 38850)
@@ -99,9 +99,9 @@
return tutorialCategories;
}
- public List<ProjectExample> getWizardProjects() {
- return wizardProjects;
- }
+ public List<ProjectExample> getWizardProjects() {
+ return wizardProjects;
+ }
@Override
public boolean belongsTo(Object family) {
Added: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/AbstractJBossCentralProjectWizard.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/AbstractJBossCentralProjectWizard.java (rev 0)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/AbstractJBossCentralProjectWizard.java 2012-02-17 00:16:47 UTC (rev 38850)
@@ -0,0 +1,93 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.central.wizards;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.jboss.tools.central.jobs.RefreshTutorialsJob;
+import org.jboss.tools.project.examples.model.ProjectExample;
+import org.jboss.tools.project.examples.wizard.NewProjectExamplesWizard2;
+
+public abstract class AbstractJBossCentralProjectWizard extends NewProjectExamplesWizard2 {
+
+ private String exampleName = null;
+
+ public AbstractJBossCentralProjectWizard(String exampleName) {
+ super();
+ Assert.isNotNull(exampleName);
+ this.exampleName = exampleName;
+ ProjectExample example = lookupProjectExample();
+ initializeProjectExample(example);
+ }
+
+ protected ProjectExample lookupProjectExample() {
+
+ ProjectExample example = null;
+ RefreshTutorialsJob refreshTutorialsJob = RefreshTutorialsJob.INSTANCE;
+ List<ProjectExample> wizardProjects = refreshTutorialsJob.getWizardProjects();
+ if (wizardProjects == null || wizardProjects.isEmpty()) {
+ //FIXME needs to execute refreshTutorialsJob and wait, gracefully
+ //wizardProjects = refreshTutorialsJob.getWizardProjects();
+ }
+ if (wizardProjects != null) {
+ for (ProjectExample expl : wizardProjects) {
+ if (matches(expl)) {
+ example = expl;
+ break;
+ }
+ }
+ }
+ return example;
+ }
+
+ private boolean matches(ProjectExample expl) {
+ if (expl != null && exampleName.equals(expl.getName())) {
+ if (expl.getSite() != null && "Shared examples".equals(expl.getSite().getName())){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void addPages() {
+ if (getProjectExample() == null) {
+ //TODO add error page
+ } else {
+ super.addPages();
+ }
+ }
+
+ /*
+ RunnableLookup lookup = new RunnableLookup(exampleName);
+ try {
+ new ProgressMonitorDialog(getShell()).run(true, true, lookup);
+ } catch (Exception e) {
+ JBossCentralActivator.log(e);
+ }
+
+ class RunnableLookup implements IRunnableWithProgress {
+
+ ProjectExample example;
+
+ public void run(IProgressMonitor monitor) {
+ List<ProjectExampleCategory> categories = ProjectExampleUtil.getProjects(monitor);
+ for (ProjectExample expl : ProjectExampleUtil.getProjectsByTags(categories, "wizard")) {
+ if (matches(expl)) {
+ example = expl;
+ break;
+ }
+ }
+ }
+ }
+ */
+}
Added: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewGwtProjectWizard.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewGwtProjectWizard.java (rev 0)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewGwtProjectWizard.java 2012-02-17 00:16:47 UTC (rev 38850)
@@ -0,0 +1,18 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.central.wizards;
+
+public class NewGwtProjectWizard extends AbstractJBossCentralProjectWizard {
+
+ public NewGwtProjectWizard() {
+ super("gwt-webapp");
+ }
+}
Added: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewHtml5ProjectWizard.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewHtml5ProjectWizard.java (rev 0)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewHtml5ProjectWizard.java 2012-02-17 00:16:47 UTC (rev 38850)
@@ -0,0 +1,18 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.central.wizards;
+
+public class NewHtml5ProjectWizard extends AbstractJBossCentralProjectWizard {
+
+ public NewHtml5ProjectWizard() {
+ super("jboss-javaee6-poh5-archetype");
+ }
+}
Added: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewJavaeeEarProjectWizard.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewJavaeeEarProjectWizard.java (rev 0)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewJavaeeEarProjectWizard.java 2012-02-17 00:16:47 UTC (rev 38850)
@@ -0,0 +1,18 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.central.wizards;
+
+public class NewJavaeeEarProjectWizard extends AbstractJBossCentralProjectWizard {
+
+ public NewJavaeeEarProjectWizard() {
+ super("multi-javaee6-archetype");
+ }
+}
Added: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewJavaeeWarProjectWizard.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewJavaeeWarProjectWizard.java (rev 0)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewJavaeeWarProjectWizard.java 2012-02-17 00:16:47 UTC (rev 38850)
@@ -0,0 +1,18 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.central.wizards;
+
+public class NewJavaeeWarProjectWizard extends AbstractJBossCentralProjectWizard {
+
+ public NewJavaeeWarProjectWizard() {
+ super("jboss-javaee6-webapp");
+ }
+}
Added: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewRichfacesProjectWizard.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewRichfacesProjectWizard.java (rev 0)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewRichfacesProjectWizard.java 2012-02-17 00:16:47 UTC (rev 38850)
@@ -0,0 +1,18 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.central.wizards;
+
+public class NewRichfacesProjectWizard extends AbstractJBossCentralProjectWizard {
+
+ public NewRichfacesProjectWizard() {
+ super("richfaces-archetype-simpleapp");
+ }
+}
Added: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewSpringMvcProjectWizard.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewSpringMvcProjectWizard.java (rev 0)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/wizards/NewSpringMvcProjectWizard.java 2012-02-17 00:16:47 UTC (rev 38850)
@@ -0,0 +1,18 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.central.wizards;
+
+public class NewSpringMvcProjectWizard extends AbstractJBossCentralProjectWizard {
+
+ public NewSpringMvcProjectWizard() {
+ super("spring-mvc-webapp");
+ }
+}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard2.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard2.java 2012-02-16 22:43:35 UTC (rev 38849)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard2.java 2012-02-17 00:16:47 UTC (rev 38850)
@@ -48,6 +48,7 @@
//private NewProjectExamplesReadyPage readyPage;
List<IProjectExamplesWizardPage> contributedPages = new LinkedList<IProjectExamplesWizardPage>();
private ProjectExample projectExample;
+
private boolean isCentral = false;
//private QuickFixPage quickFixPage;
@@ -59,16 +60,19 @@
public NewProjectExamplesWizard2(ProjectExample projectExample) {
super();
+ initializeProjectExample(projectExample);
+ }
+
+ protected void initializeProjectExample(ProjectExample projectExample) {
this.projectExample = projectExample;
this.isCentral = true;
setWindowTitle(Messages.NewProjectExamplesWizard_New_Project_Example);
setNeedsProgressMonitor(true);
}
-
+
/**
* Creates an empty wizard for creating a new resource in the workspace.
*/
-
@Override
public boolean performFinish() {
final List<ProjectExample> selectedProjects = new ArrayList<ProjectExample>();
@@ -251,4 +255,9 @@
}
return true;
}
+
+ public ProjectExample getProjectExample() {
+ return projectExample;
+ }
+
}
14 years, 1 month
JBoss Tools SVN: r38849 - trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-02-16 17:43:35 -0500 (Thu, 16 Feb 2012)
New Revision: 38849
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/ToolTip.java
Log:
JBIDE-10938 tooltips fail in wizard examples
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/ToolTip.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/ToolTip.java 2012-02-16 21:45:39 UTC (rev 38848)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/ToolTip.java 2012-02-16 22:43:35 UTC (rev 38849)
@@ -462,12 +462,14 @@
CURRENT_TOOLTIP = shell;
control.getShell().addListener(SWT.Deactivate, shellListener);
- shell.addDisposeListener(new DisposeListener() {
+ control.getShell().addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
- control.getShell().removeListener(SWT.Deactivate, shellListener);
- control.getShell().removeDisposeListener(this);
+ if (control != null && !control.isDisposed() && control.getShell() != null && !control.getShell().isDisposed()) {
+ control.getShell().removeListener(SWT.Deactivate, shellListener);
+ control.getShell().removeDisposeListener(this);
+ }
}
});
if (popupDelay > 0) {
14 years, 1 month
JBoss Tools SVN: r38847 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui: utils and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-16 16:37:37 -0500 (Thu, 16 Feb 2012)
New Revision: 38847
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/DisposeUtils.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteApplicationAction.java
Log:
[JBIDE-10941] made sure viewer.refresh() is called within the UI-thread
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteApplicationAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteApplicationAction.java 2012-02-16 21:00:32 UTC (rev 38846)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteApplicationAction.java 2012-02-16 21:37:37 UTC (rev 38847)
@@ -14,6 +14,7 @@
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
+import org.jboss.tools.openshift.express.internal.ui.utils.DisposeUtils;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import com.openshift.express.client.IApplication;
@@ -31,8 +32,9 @@
}
/**
- * Operation called when the user clicks on 'Show In>Remote Console'. If no Console/Worker existed, a new one is
- * created, otherwise, it is displayed. {@inheritDoc}
+ * Operation called when the user clicks on 'Show In>Remote Console'. If no
+ * Console/Worker existed, a new one is created, otherwise, it is displayed.
+ * {@inheritDoc}
*/
@Override
public void run() {
@@ -69,7 +71,7 @@
} finally {
monitor.done();
if (viewer != null) {
- viewer.refresh();
+ refresh();
}
}
return Status.OK_STATUS;
@@ -80,7 +82,7 @@
}
}
if (viewer != null) {
- viewer.refresh();
+ refresh();
}
}
@@ -88,4 +90,15 @@
return selection instanceof IApplication;
}
+ private void refresh() {
+ if (!DisposeUtils.isDisposed(viewer))
+ viewer.getControl().getDisplay().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ viewer.refresh();
+ }
+ });
+ }
+
}
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/DisposeUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/DisposeUtils.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/DisposeUtils.java 2012-02-16 21:37:37 UTC (rev 38847)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.openshift.express.internal.ui.utils;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Control;
+
+public class DisposeUtils {
+
+ public static boolean isDisposed(Control control) {
+ return control == null
+ || control.isDisposed();
+ }
+
+ public static boolean isDisposed(Viewer viewer) {
+ return viewer == null
+ || isDisposed(viewer.getControl());
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/DisposeUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 1 month
JBoss Tools SVN: r38846 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-16 16:00:32 -0500 (Thu, 16 Feb 2012)
New Revision: 38846
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
Log:
corrected warning, removed unneeded import
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-02-16 20:55:13 UTC (rev 38845)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-02-16 21:00:32 UTC (rev 38846)
@@ -41,7 +41,6 @@
import org.jboss.tools.openshift.express.internal.ui.ImportFailedException;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.WontOverwriteException;
-import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import com.openshift.express.client.IApplication;
import com.openshift.express.client.IEmbeddableCartridge;
14 years, 1 month
JBoss Tools SVN: r38845 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-16 15:55:13 -0500 (Thu, 16 Feb 2012)
New Revision: 38845
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
Log:
[JBIDE-10844] corrected wizard title
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2012-02-16 20:53:27 UTC (rev 38844)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2012-02-16 20:55:13 UTC (rev 38845)
@@ -61,7 +61,7 @@
private Text passwordText = null;
public CredentialsWizardPage(IWizard wizard, IUserAwareModel wizardModel) {
- super("Server connection", "Please provide your OpenShift Express credentials.", "Server Connection",
+ super("Sign in to OpenShift", "Please provide your OpenShift Express credentials.", "Server Connection",
wizard);
this.pageModel = new CredentialsWizardPageModel(wizardModel);
}
14 years, 1 month
JBoss Tools SVN: r38844 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-16 15:53:27 -0500 (Thu, 16 Feb 2012)
New Revision: 38844
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
Log:
[JBIDE-10735] added descriptions to new-wizard and import wizard declaration (plugin.xml)
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-02-16 20:03:16 UTC (rev 38843)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-02-16 20:53:27 UTC (rev 38844)
@@ -18,6 +18,7 @@
icon="icons/openshift-logo-white-icon.png"
id="org.jboss.ide.eclipse.as.openshift.express.ui.wizard.createNewApplicationWizard"
name="OpenShift Express Application">
+ <description>Create a new OpenShift Express Application</description>
</wizard>
</extension>
<extension
@@ -32,6 +33,7 @@
icon="icons/openshift-logo-white-icon.png"
id="org.jboss.tools.openshift.express.ui.importExistingApplicationWizard"
name="Existing OpenShift Express Application">
+ <description>Import an existing OpenShift Express Application</description>
</wizard>
</extension>
<extension
@@ -39,7 +41,7 @@
<perspectiveExtension
targetID="org.jboss.tools.common.ui.JBossPerspective">
<newWizardShortcut
- id="org.jboss.ide.eclipse.as.openshift.express.ui.wizard.ImportProjectNewWizard">
+ id="org.jboss.ide.eclipse.as.openshift.express.ui.wizard.createNewApplicationWizard">
</newWizardShortcut>
</perspectiveExtension>
</extension>
14 years, 1 month
JBoss Tools SVN: r38843 - trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-02-16 15:03:16 -0500 (Thu, 16 Feb 2012)
New Revision: 38843
Added:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/ToolTip.java
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/DescriptionToolTip.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
Log:
JBIDE-10938 tooltips fail in wizard examples
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/DescriptionToolTip.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/DescriptionToolTip.java 2012-02-16 19:56:21 UTC (rev 38842)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/DescriptionToolTip.java 2012-02-16 20:03:16 UTC (rev 38843)
@@ -11,7 +11,6 @@
package org.jboss.tools.central.editors;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.window.ToolTip;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.layout.GridData;
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2012-02-16 19:56:21 UTC (rev 38842)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2012-02-16 20:03:16 UTC (rev 38843)
@@ -929,7 +929,7 @@
categoryComposite.setClient(composite);
String description = category.getDescription();
if (description != null && !description.isEmpty() && categoryComposite.getControl() != null) {
- final ToolTip toolTip = new DescriptionToolTip(categoryComposite.getControl(), description);
+ final DescriptionToolTip toolTip = new DescriptionToolTip(categoryComposite.getControl(), description);
toolTip.activate();
}
}
@@ -957,7 +957,7 @@
private void hookTooltip(FormText tutorialText, ProjectExample tutorial) {
final String description = JBossCentralActivator.getDefault().getDescription(tutorial);
if (description != null && !description.isEmpty()) {
- ToolTip toolTip = new DescriptionToolTip(tutorialText, description);
+ DescriptionToolTip toolTip = new DescriptionToolTip(tutorialText, description);
toolTip.activate();
}
}
Added: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/ToolTip.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/ToolTip.java (rev 0)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/ToolTip.java 2012-02-16 20:03:16 UTC (rev 38843)
@@ -0,0 +1,681 @@
+package org.jboss.tools.central.editors;
+
+import java.util.HashMap;
+
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.ViewerCell;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Monitor;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * This class gives implementors to provide customized tooltips for any control.
+ *
+ * @since 3.3
+ */
+public abstract class ToolTip {
+ private Control control;
+
+ private int xShift = 3;
+
+ private int yShift = 0;
+
+ private int popupDelay = 0;
+
+ private int hideDelay = 0;
+
+ private ToolTipOwnerControlListener listener;
+
+ private HashMap data;
+
+ // Ensure that only one tooltip is active in time
+ private static Shell CURRENT_TOOLTIP;
+
+ /**
+ * Recreate the tooltip on every mouse move
+ */
+ public static final int RECREATE = 1;
+
+ /**
+ * Don't recreate the tooltip as long the mouse doesn't leave the area
+ * triggering the tooltip creation
+ */
+ public static final int NO_RECREATE = 1 << 1;
+
+ private TooltipHideListener hideListener = new TooltipHideListener();
+
+ private Listener shellListener;
+
+ private boolean hideOnMouseDown = true;
+
+ private boolean respectDisplayBounds = true;
+
+ private boolean respectMonitorBounds = true;
+
+ private int style;
+
+ private Object currentArea;
+
+ /**
+ * Create new instance which add TooltipSupport to the widget
+ *
+ * @param control
+ * the control on whose action the tooltip is shown
+ */
+ public ToolTip(Control control) {
+ this(control, RECREATE, false);
+ }
+
+ /**
+ * @param control
+ * the control to which the tooltip is bound
+ * @param style
+ * style passed to control tooltip behavior
+ *
+ * @param manualActivation
+ * <code>true</code> if the activation is done manually using
+ * {@link #show(Point)}
+ * @see #RECREATE
+ * @see #NO_RECREATE
+ */
+ public ToolTip(Control control, int style, boolean manualActivation) {
+ this.control = control;
+ this.style = style;
+ this.control.addDisposeListener(new DisposeListener() {
+
+ public void widgetDisposed(DisposeEvent e) {
+ data = null;
+ deactivate();
+ }
+
+ });
+
+ this.listener = new ToolTipOwnerControlListener();
+ this.shellListener = new Listener() {
+ public void handleEvent(final Event event) {
+ if (ToolTip.this.control != null
+ && !ToolTip.this.control.isDisposed()) {
+ ToolTip.this.control.getDisplay().asyncExec(new Runnable() {
+
+ public void run() {
+ // Check if the new active shell is the tooltip
+ // itself
+ if (ToolTip.this.control.getDisplay()
+ .getActiveShell() != CURRENT_TOOLTIP) {
+ toolTipHide(CURRENT_TOOLTIP, event);
+ }
+ }
+
+ });
+ }
+ }
+ };
+
+ if (!manualActivation) {
+ activate();
+ }
+ }
+
+ /**
+ * Restore arbitrary data under the given key
+ *
+ * @param key
+ * the key
+ * @param value
+ * the value
+ */
+ public void setData(String key, Object value) {
+ if (data == null) {
+ data = new HashMap();
+ }
+ data.put(key, value);
+ }
+
+ /**
+ * Get the data restored under the key
+ *
+ * @param key
+ * the key
+ * @return data or <code>null</code> if no entry is restored under the key
+ */
+ public Object getData(String key) {
+ if (data != null) {
+ return data.get(key);
+ }
+ return null;
+ }
+
+ /**
+ * Set the shift (from the mouse position triggered the event) used to
+ * display the tooltip.
+ * <p>
+ * By default the tooltip is shifted 3 pixels to the right.
+ * </p>
+ *
+ * @param p
+ * the new shift
+ */
+ public void setShift(Point p) {
+ xShift = p.x;
+ yShift = p.y;
+ }
+
+ /**
+ * Activate tooltip support for this control
+ */
+ public void activate() {
+ deactivate();
+ control.addListener(SWT.Dispose, listener);
+ control.addListener(SWT.MouseHover, listener);
+ control.addListener(SWT.MouseMove, listener);
+ control.addListener(SWT.MouseExit, listener);
+ control.addListener(SWT.MouseDown, listener);
+ control.addListener(SWT.MouseWheel, listener);
+ }
+
+ /**
+ * Deactivate tooltip support for the underlying control
+ */
+ public void deactivate() {
+ control.removeListener(SWT.Dispose, listener);
+ control.removeListener(SWT.MouseHover, listener);
+ control.removeListener(SWT.MouseMove, listener);
+ control.removeListener(SWT.MouseExit, listener);
+ control.removeListener(SWT.MouseDown, listener);
+ control.removeListener(SWT.MouseWheel, listener);
+ }
+
+ /**
+ * Return whether the tooltip respects bounds of the display.
+ *
+ * @return <code>true</code> if the tooltip respects bounds of the display
+ */
+ public boolean isRespectDisplayBounds() {
+ return respectDisplayBounds;
+ }
+
+ /**
+ * Set to <code>false</code> if display bounds should not be respected or
+ * to <code>true</code> if the tooltip is should repositioned to not
+ * overlap the display bounds.
+ * <p>
+ * Default is <code>true</code>
+ * </p>
+ *
+ * @param respectDisplayBounds
+ */
+ public void setRespectDisplayBounds(boolean respectDisplayBounds) {
+ this.respectDisplayBounds = respectDisplayBounds;
+ }
+
+ /**
+ * Return whether the tooltip respects bounds of the monitor.
+ *
+ * @return <code>true</code> if tooltip respects the bounds of the monitor
+ */
+ public boolean isRespectMonitorBounds() {
+ return respectMonitorBounds;
+ }
+
+ /**
+ * Set to <code>false</code> if monitor bounds should not be respected or
+ * to <code>true</code> if the tooltip is should repositioned to not
+ * overlap the monitors bounds. The monitor the tooltip belongs to is the
+ * same is control's monitor the tooltip is shown for.
+ * <p>
+ * Default is <code>true</code>
+ * </p>
+ *
+ * @param respectMonitorBounds
+ */
+ public void setRespectMonitorBounds(boolean respectMonitorBounds) {
+ this.respectMonitorBounds = respectMonitorBounds;
+ }
+
+ /**
+ * Should the tooltip displayed because of the given event.
+ * <p>
+ * <b>Subclasses may overwrite this to get custom behavior</b>
+ * </p>
+ *
+ * @param event
+ * the event
+ * @return <code>true</code> if tooltip should be displayed
+ */
+ protected boolean shouldCreateToolTip(Event event) {
+ if ((style & NO_RECREATE) != 0) {
+ Object tmp = getToolTipArea(event);
+
+ // No new area close the current tooltip
+ if (tmp == null) {
+ hide();
+ return false;
+ }
+
+ boolean rv = !tmp.equals(currentArea);
+ return rv;
+ }
+
+ return true;
+ }
+
+ /**
+ * This method is called before the tooltip is hidden
+ *
+ * @param event
+ * the event trying to hide the tooltip
+ * @return <code>true</code> if the tooltip should be hidden
+ */
+ private boolean shouldHideToolTip(Event event) {
+ if (event != null && event.type == SWT.MouseMove
+ && (style & NO_RECREATE) != 0) {
+ Object tmp = getToolTipArea(event);
+
+ // No new area close the current tooltip
+ if (tmp == null) {
+ hide();
+ return false;
+ }
+
+ boolean rv = !tmp.equals(currentArea);
+ return rv;
+ }
+
+ return true;
+ }
+
+ /**
+ * This method is called to check for which area the tooltip is
+ * created/hidden for. In case of {@link #NO_RECREATE} this is used to
+ * decide if the tooltip is hidden recreated.
+ *
+ * <code>By the default it is the widget the tooltip is created for but could be any object. To decide if
+ * the area changed the {@link Object#equals(Object)} method is used.</code>
+ *
+ * @param event
+ * the event
+ * @return the area responsible for the tooltip creation or
+ * <code>null</code> this could be any object describing the area
+ * (e.g. the {@link Control} onto which the tooltip is bound to, a
+ * part of this area e.g. for {@link ColumnViewer} this could be a
+ * {@link ViewerCell})
+ */
+ protected Object getToolTipArea(Event event) {
+ return control;
+ }
+
+ /**
+ * Start up the tooltip programmatically
+ *
+ * @param location
+ * the location relative to the control the tooltip is shown
+ */
+ public void show(Point location) {
+ Event event = new Event();
+ event.x = location.x;
+ event.y = location.y;
+ event.widget = control;
+ toolTipCreate(event);
+ }
+
+ private Shell toolTipCreate(final Event event) {
+ if (shouldCreateToolTip(event)) {
+ Shell shell = new Shell(control.getShell(), SWT.ON_TOP | SWT.TOOL
+ | SWT.NO_FOCUS);
+ shell.setLayout(new FillLayout());
+
+ toolTipOpen(shell, event);
+
+ return shell;
+ }
+
+ return null;
+ }
+
+ private void toolTipShow(Shell tip, Event event) {
+ if (!tip.isDisposed()) {
+ currentArea = getToolTipArea(event);
+ createToolTipContentArea(event, tip);
+ if (isHideOnMouseDown()) {
+ toolTipHookBothRecursively(tip);
+ } else {
+ toolTipHookByTypeRecursively(tip, true, SWT.MouseExit);
+ }
+
+ tip.pack();
+ Point size = tip.getSize();
+ Point location = fixupDisplayBounds(size, getLocation(size, event));
+
+ // Need to adjust a bit more if the mouse cursor.y == tip.y and
+ // the cursor.x is inside the tip
+ Point cursorLocation = tip.getDisplay().getCursorLocation();
+
+ if (cursorLocation.y == location.y && location.x < cursorLocation.x
+ && location.x + size.x > cursorLocation.x) {
+ location.y -= 2;
+ }
+
+ tip.setLocation(location);
+ tip.setVisible(true);
+ }
+ }
+
+ private Point fixupDisplayBounds(Point tipSize, Point location) {
+ if (respectDisplayBounds || respectMonitorBounds) {
+ Rectangle bounds;
+ Point rightBounds = new Point(tipSize.x + location.x, tipSize.y
+ + location.y);
+
+ Monitor[] ms = control.getDisplay().getMonitors();
+
+ if (respectMonitorBounds && ms.length > 1) {
+ // By default present in the monitor of the control
+ bounds = control.getMonitor().getBounds();
+ Point p = new Point(location.x, location.y);
+
+ // Search on which monitor the event occurred
+ Rectangle tmp;
+ for (int i = 0; i < ms.length; i++) {
+ tmp = ms[i].getBounds();
+ if (tmp.contains(p)) {
+ bounds = tmp;
+ break;
+ }
+ }
+
+ } else {
+ bounds = control.getDisplay().getBounds();
+ }
+
+ if (!(bounds.contains(location) && bounds.contains(rightBounds))) {
+ if (rightBounds.x > bounds.x + bounds.width) {
+ location.x -= rightBounds.x - (bounds.x + bounds.width);
+ }
+
+ if (rightBounds.y > bounds.y + bounds.height) {
+ location.y -= rightBounds.y - (bounds.y + bounds.height);
+ }
+
+ if (location.x < bounds.x) {
+ location.x = bounds.x;
+ }
+
+ if (location.y < bounds.y) {
+ location.y = bounds.y;
+ }
+ }
+ }
+
+ return location;
+ }
+
+ /**
+ * Get the display relative location where the tooltip is displayed.
+ * Subclasses may overwrite to implement custom positioning.
+ *
+ * @param tipSize
+ * the size of the tooltip to be shown
+ * @param event
+ * the event triggered showing the tooltip
+ * @return the absolute position on the display
+ */
+ public Point getLocation(Point tipSize, Event event) {
+ return control.toDisplay(event.x + xShift, event.y + yShift);
+ }
+
+ private void toolTipHide(Shell tip, Event event) {
+ if (tip != null && !tip.isDisposed() && shouldHideToolTip(event)) {
+ if (!control.getShell().isDisposed()) {
+ control.getShell().removeListener(SWT.Deactivate, shellListener);
+ }
+ currentArea = null;
+ passOnEvent(tip, event);
+ tip.dispose();
+ CURRENT_TOOLTIP = null;
+ afterHideToolTip(event);
+ }
+ }
+
+ private void passOnEvent(Shell tip, Event event) {
+ if (control != null && !control.isDisposed() && event != null
+ && event.widget != control && event.type == SWT.MouseDown) {
+ // the following was left in order to fix bug 298770 with minimal change. In 3.7, the complete method should be removed.
+ tip.close();
+ }
+ }
+
+ private void toolTipOpen(final Shell shell, final Event event) {
+ // Ensure that only one Tooltip is shown in time
+ if (CURRENT_TOOLTIP != null) {
+ toolTipHide(CURRENT_TOOLTIP, null);
+ }
+
+ CURRENT_TOOLTIP = shell;
+
+ control.getShell().addListener(SWT.Deactivate, shellListener);
+ shell.addDisposeListener(new DisposeListener() {
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ control.getShell().removeListener(SWT.Deactivate, shellListener);
+ control.getShell().removeDisposeListener(this);
+ }
+ });
+ if (popupDelay > 0) {
+ control.getDisplay().timerExec(popupDelay, new Runnable() {
+ public void run() {
+ toolTipShow(shell, event);
+ }
+ });
+ } else {
+ toolTipShow(CURRENT_TOOLTIP, event);
+ }
+
+ if (hideDelay > 0) {
+ control.getDisplay().timerExec(popupDelay + hideDelay,
+ new Runnable() {
+
+ public void run() {
+ toolTipHide(shell, null);
+ }
+ });
+ }
+ }
+
+ private void toolTipHookByTypeRecursively(Control c, boolean add, int type) {
+ if (add) {
+ c.addListener(type, hideListener);
+ } else {
+ c.removeListener(type, hideListener);
+ }
+
+ if (c instanceof Composite) {
+ Control[] children = ((Composite) c).getChildren();
+ for (int i = 0; i < children.length; i++) {
+ toolTipHookByTypeRecursively(children[i], add, type);
+ }
+ }
+ }
+
+ private void toolTipHookBothRecursively(Control c) {
+ c.addListener(SWT.MouseDown, hideListener);
+ c.addListener(SWT.MouseExit, hideListener);
+
+ if (c instanceof Composite) {
+ Control[] children = ((Composite) c).getChildren();
+ for (int i = 0; i < children.length; i++) {
+ toolTipHookBothRecursively(children[i]);
+ }
+ }
+ }
+
+ /**
+ * Creates the content area of the the tooltip.
+ *
+ * @param event
+ * the event that triggered the activation of the tooltip
+ * @param parent
+ * the parent of the content area
+ * @return the content area created
+ */
+ protected abstract Composite createToolTipContentArea(Event event,
+ Composite parent);
+
+ /**
+ * This method is called after a tooltip is hidden.
+ * <p>
+ * <b>Subclasses may override to clean up requested system resources</b>
+ * </p>
+ *
+ * @param event
+ * event triggered the hiding action (may be <code>null</code>
+ * if event wasn't triggered by user actions directly)
+ */
+ protected void afterHideToolTip(Event event) {
+
+ }
+
+ /**
+ * Set the hide delay.
+ *
+ * @param hideDelay
+ * the delay before the tooltip is hidden. If <code>0</code>
+ * the tooltip is shown until user moves to other item
+ */
+ public void setHideDelay(int hideDelay) {
+ this.hideDelay = hideDelay;
+ }
+
+ /**
+ * Set the popup delay.
+ *
+ * @param popupDelay
+ * the delay before the tooltip is shown to the user. If
+ * <code>0</code> the tooltip is shown immediately
+ */
+ public void setPopupDelay(int popupDelay) {
+ this.popupDelay = popupDelay;
+ }
+
+ /**
+ * Return if hiding on mouse down is set.
+ *
+ * @return <code>true</code> if hiding on mouse down in the tool tip is on
+ */
+ public boolean isHideOnMouseDown() {
+ return hideOnMouseDown;
+ }
+
+ /**
+ * If you don't want the tool tip to be hidden when the user clicks inside
+ * the tool tip set this to <code>false</code>. You maybe also need to
+ * hide the tool tip yourself depending on what you do after clicking in the
+ * tooltip (e.g. if you open a new {@link Shell})
+ *
+ * @param hideOnMouseDown
+ * flag to indicate of tooltip is hidden automatically on mouse
+ * down inside the tool tip
+ */
+ public void setHideOnMouseDown(final boolean hideOnMouseDown) {
+ // Only needed if there's currently a tooltip active
+ if (CURRENT_TOOLTIP != null && !CURRENT_TOOLTIP.isDisposed()) {
+ // Only change if value really changed
+ if (hideOnMouseDown != this.hideOnMouseDown) {
+ control.getDisplay().syncExec(new Runnable() {
+
+ public void run() {
+ if (CURRENT_TOOLTIP != null
+ && CURRENT_TOOLTIP.isDisposed()) {
+ toolTipHookByTypeRecursively(CURRENT_TOOLTIP,
+ hideOnMouseDown, SWT.MouseDown);
+ }
+ }
+
+ });
+ }
+ }
+
+ this.hideOnMouseDown = hideOnMouseDown;
+ }
+
+ /**
+ * Hide the currently active tool tip
+ */
+ public void hide() {
+ toolTipHide(CURRENT_TOOLTIP, null);
+ }
+
+ private class ToolTipOwnerControlListener implements Listener {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.Dispose:
+ case SWT.KeyDown:
+ case SWT.MouseDown:
+ case SWT.MouseMove:
+ case SWT.MouseWheel:
+ toolTipHide(CURRENT_TOOLTIP, event);
+ break;
+ case SWT.MouseHover:
+ toolTipCreate(event);
+ break;
+ case SWT.MouseExit:
+ /*
+ * Check if the mouse exit happened because we move over the
+ * tooltip
+ */
+ if (CURRENT_TOOLTIP != null && !CURRENT_TOOLTIP.isDisposed()) {
+ if (CURRENT_TOOLTIP.getBounds().contains(
+ control.toDisplay(event.x, event.y))) {
+ break;
+ }
+ }
+
+ toolTipHide(CURRENT_TOOLTIP, event);
+ break;
+ }
+ }
+ }
+
+ private class TooltipHideListener implements Listener {
+ public void handleEvent(Event event) {
+ if (event.widget instanceof Control) {
+
+ Control c = (Control) event.widget;
+ Shell shell = c.getShell();
+
+ switch (event.type) {
+ case SWT.MouseDown:
+ if (isHideOnMouseDown()) {
+ toolTipHide(shell, event);
+ }
+ break;
+ case SWT.MouseExit:
+ /*
+ * Give some insets to ensure we get exit informations from
+ * a wider area ;-)
+ */
+ Rectangle rect = shell.getBounds();
+ rect.x += 5;
+ rect.y += 5;
+ rect.width -= 10;
+ rect.height -= 10;
+
+ if (!rect.contains(c.getDisplay().getCursorLocation())) {
+ toolTipHide(shell, event);
+ }
+
+ break;
+ }
+ }
+ }
+ }
+}
14 years, 1 month
JBoss Tools SVN: r38842 - in trunk/forge/plugins/org.jboss.tools.forge.runtime.ext: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2012-02-16 14:56:21 -0500 (Thu, 16 Feb 2012)
New Revision: 38842
Modified:
trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/META-INF/MANIFEST.MF
trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/build.properties
Log:
fix compilation problem - take 5
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/META-INF/MANIFEST.MF
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/META-INF/MANIFEST.MF 2012-02-16 18:37:50 UTC (rev 38841)
+++ trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/META-INF/MANIFEST.MF 2012-02-16 19:56:21 UTC (rev 38842)
@@ -7,3 +7,4 @@
Eclipse-BundleShape: dir
Bundle-Vendor: JBoss by Red Hat
Bundle-ClassPath: bin/
+Require-Bundle: org.jboss.tools.forge.runtime;bundle-version="1.0.0"
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/build.properties
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/build.properties 2012-02-16 18:37:50 UTC (rev 38841)
+++ trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/build.properties 2012-02-16 19:56:21 UTC (rev 38842)
@@ -4,4 +4,3 @@
jars.compile.order = bin/
source.bin/ = src/
output.bin/ = bin/
-additional.bundles = org.jboss.tools.forge.runtime
14 years, 1 month
JBoss Tools SVN: r38841 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-16 13:37:50 -0500 (Thu, 16 Feb 2012)
New Revision: 38841
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
Log:
fixing widget disposed error that was put to log before
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-16 18:19:57 UTC (rev 38840)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-16 18:37:50 UTC (rev 38841)
@@ -666,7 +666,7 @@
if(result != Dialog.OK) {
final IWizardContainer container = getWizard().getContainer();
if(container instanceof WizardDialog) {
- dbc.dispose();
+ event.doit = false;
((WizardDialog)container).close();
}
}
14 years, 1 month