JBoss Tools SVN: r26306 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: templates and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-11-05 12:51:16 -0400 (Fri, 05 Nov 2010)
New Revision: 26306
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTogglePanelItemTemplate.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
Log:
https://jira.jboss.org/browse/JBIDE-7451 , RF4 OUTPUT templates were added.
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTogglePanelItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTogglePanelItemTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTogglePanelItemTemplate.java 2010-11-05 16:51:16 UTC (rev 26306)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class RichFacesTogglePanelItemTemplate extends VpeAbstractTemplate {
+
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
+ VpeCreationData creationData = new VpeCreationData(div);
+ return creationData;
+ }
+
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2010-11-05 16:51:06 UTC (rev 26305)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2010-11-05 16:51:16 UTC (rev 26306)
@@ -305,6 +305,11 @@
</vpe:template>
</vpe:tag>
+ <vpe:tag name="rich:toolBarSeparator" case-sensitive="yes" >
+ <vpe:template children="no" modify="no" >
+ </vpe:template>
+ </vpe:tag>
+
<vpe:tag name="rich:dataList" case-sensitive="yes" >
<vpe:template class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesDataListTemplate"
children="yes" modify="no">
@@ -417,6 +422,19 @@
</vpe:template>
</vpe:tag>
+ <vpe:tag name="rich:collapsiblePanel" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes" class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesPanelTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="style.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes"/>
+ <vpe:drop container="yes"/>
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
+
<vpe:tag name="rich:panel" case-sensitive="yes">
<vpe:template children="yes" modify="yes" class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesPanelTemplate">
<vpe:resize>
@@ -430,6 +448,28 @@
</vpe:template>
</vpe:tag>
+ <vpe:tag name="rich:accordion" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes" class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesPanelBarTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="style.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes"/>
+ <vpe:drop container="no"/>
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
+
+ <vpe:tag name="rich:accordionItem" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes" class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesPanelItemTemplate">
+ <vpe:dnd>
+ <vpe:drag start-enable="yes"/>
+ <vpe:drop container="yes"/>
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
+
<vpe:tag name="rich:panelBar" case-sensitive="yes">
<vpe:template children="yes" modify="yes" class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesPanelBarTemplate">
<vpe:resize>
@@ -486,7 +526,17 @@
</vpe:dnd>
</vpe:template>
</vpe:tag>
+
+ <vpe:tag name="rich:togglePanelItem" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes" class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesTogglePanelItemTemplate">
+ <vpe:dnd>
+ <vpe:drag start-enable="yes"/>
+ <vpe:drop container="yes"/>
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
+
<vpe:tag name="rich:tabPanel" case-sensitive="yes">
<vpe:template children="yes" modify="yes" class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesTabPanelTemplate">
<vpe:resize>
@@ -655,6 +705,11 @@
</vpe:template>
</vpe:tag>
+ <vpe:tag name="rich:itemChangeListener" case-sensitive="yes">
+ <vpe:template children="no" modify="yes" >
+ </vpe:template>
+ </vpe:tag>
+
<vpe:tag name="rich:changeExpandListener" case-sensitive="yes">
<vpe:template children="no" modify="yes" >
</vpe:template>
@@ -849,5 +904,10 @@
<vpe:template children="no" modify="no">
</vpe:template>
</vpe:tag>
-
-</vpe:templates>
+
+ <vpe:tag name="rich:popupPanel" case-sensitive="yes" >
+ <vpe:template children="no" modify="no" >
+ </vpe:template>
+ </vpe:tag>
+
+</vpe:templates>
\ No newline at end of file
15 years, 5 months
JBoss Tools SVN: r26305 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-05 12:51:06 -0400 (Fri, 05 Nov 2010)
New Revision: 26305
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
Log:
[JBIDE-7507] returns now icons to represent states (instead of texts)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-05 16:50:35 UTC (rev 26304)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-05 16:51:06 UTC (rev 26305)
@@ -1,5 +1,8 @@
2010-11-05 André Dietisheim <adietish(a)redhat.com>
+ * src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java (getStatusIcon):
+ (getColumnImage):
+ [JBIDE-7507] returns now icons to represent states (instead of texts)
* src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java (.run):
[JBIDE-7503] added restore selection after refresh (viewer lost the selection before this change)
15 years, 5 months
JBoss Tools SVN: r26304 - 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-11-05 12:50:35 -0400 (Fri, 05 Nov 2010)
New Revision: 26304
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java
Log:
[JBIDE-7507] returns now icons to represent states (instead of texts)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java 2010-11-05 16:32:48 UTC (rev 26303)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java 2010-11-05 16:50:35 UTC (rev 26304)
@@ -20,28 +20,31 @@
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.core.IInstanceFilter;
+import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
-public class InstanceViewLabelAndContentProvider extends BaseLabelProvider implements IStructuredContentProvider, ITableLabelProvider {
+public class InstanceViewLabelAndContentProvider extends BaseLabelProvider implements IStructuredContentProvider,
+ ITableLabelProvider {
private DeltaCloud cloud;
private DeltaCloudInstance[] instances;
public enum Column {
- NAME(0, 20),
- ID(1, 20),
- STATUS(2, 20),
+ NAME(0, 20),
+ ID(1, 20),
+ STATUS(2, 20),
HOSTNAME(3, 40);
-
+
private int column;
private int weight;
- private static final Map<Integer,Column> lookup
- = new HashMap<Integer,Column>();
+ private static final Map<Integer, Column> lookup = new HashMap<Integer, Column>();
static {
- for(Column c : EnumSet.allOf(Column.class))
+ for (Column c : EnumSet.allOf(Column.class))
lookup.put(c.getColumnNumber(), c);
}
@@ -53,7 +56,7 @@
public int getColumnNumber() {
return column;
}
-
+
public int getWeight() {
return weight;
}
@@ -61,13 +64,13 @@
public static Column getColumn(int number) {
return lookup.get(number);
}
-
+
public static int getSize() {
return lookup.size();
}
-
+
};
-
+
@Override
public Object[] getElements(Object inputElement) {
return instances;
@@ -83,9 +86,9 @@
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (newInput != null) {
if (newInput instanceof DeltaCloudInstance[]) {
- instances = filter((DeltaCloudInstance[])newInput);
+ instances = filter((DeltaCloudInstance[]) newInput);
} else {
- cloud = (DeltaCloud)newInput;
+ cloud = (DeltaCloud) newInput;
instances = filter(cloud.getCurrInstances());
}
}
@@ -101,16 +104,36 @@
}
return array.toArray(new DeltaCloudInstance[array.size()]);
}
-
+
@Override
public Image getColumnImage(Object element, int columnIndex) {
- return null;
+ Column c = Column.getColumn(columnIndex);
+ DeltaCloudInstance i = (DeltaCloudInstance) element;
+ switch (c) {
+ case STATUS:
+ return getStatusIcon(i.getState());
+ default:
+ return null;
+ }
}
+ private Image getStatusIcon(String status) {
+ if (DeltaCloudInstance.STOPPED.equals(status)) {
+ return SWTImagesFactory.get(SWTImagesFactory.IMG_STOP);
+ } else if (DeltaCloudInstance.RUNNING.equals(status)) {
+ return SWTImagesFactory.get(SWTImagesFactory.IMG_START);
+ } else if (DeltaCloudInstance.BOGUS.equals(status)) {
+ return PlatformUI.getWorkbench().getSharedImages().
+ getImage(ISharedImages.IMG_DEC_FIELD_WARNING);
+ } else {
+ return null;
+ }
+ }
+
@Override
public String getColumnText(Object element, int columnIndex) {
Column c = Column.getColumn(columnIndex);
- DeltaCloudInstance i = (DeltaCloudInstance)element;
+ DeltaCloudInstance i = (DeltaCloudInstance) element;
if (i != null) {
switch (c) {
case NAME:
@@ -118,7 +141,8 @@
case ID:
return i.getId();
case STATUS:
- return i.getState();
+// return i.getState();
+ return "";
case HOSTNAME:
return i.getHostName();
}
15 years, 5 months
JBoss Tools SVN: r26303 - 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-11-05 12:32:48 -0400 (Fri, 05 Nov 2010)
New Revision: 26303
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstancePropertySource.java
Log:
[JBIDE-7503] removed duplicate code
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstancePropertySource.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstancePropertySource.java 2010-11-05 16:24:16 UTC (rev 26302)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstancePropertySource.java 2010-11-05 16:32:48 UTC (rev 26303)
@@ -43,11 +43,12 @@
private DeltaCloudInstance instance;
private DeltaCloud cloud;
public InstancePropertySource(CVInstanceElement element, Object o) {
- CloudViewElement parent = (CloudViewElement)element.getParent();
- while (parent != null && !(parent instanceof CVCloudElement)) {
- parent = (CloudViewElement)parent.getParent();
- }
- cloud = (DeltaCloud)parent.getElement();
+// CloudViewElement parent = (CloudViewElement)element.getParent();
+// while (parent != null && !(parent instanceof CVCloudElement)) {
+// parent = (CloudViewElement)parent.getParent();
+// }
+// cloud = (DeltaCloud)parent.getElement();
+ cloud = CloudViewElementUtils.getCloud(element);
instance = (DeltaCloudInstance)o;
}
15 years, 5 months
JBoss Tools SVN: r26302 - in trunk/deltacloud/plugins: org.jboss.tools.deltacloud.ui and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-05 12:24:16 -0400 (Fri, 05 Nov 2010)
New Revision: 26302
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
Log:
[JBIDE-7503] added restoreSelection after a refresh (viewer lost the selection before this change)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-05 16:23:21 UTC (rev 26301)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-05 16:24:16 UTC (rev 26302)
@@ -164,6 +164,7 @@
}
if (!rules.equals(ruleString)) {
save();
+ // TODO: remove notification with all instances, replace by notifying the changed instance
notifyInstanceListListeners(instances.toArray(instances.toArray(new DeltaCloudInstance[instances.size()])));
}
}
@@ -270,6 +271,7 @@
} catch (DeltaCloudClientException e) {
Activator.log(e);
}
+ // TODO: remove notification with all instances, replace by notifying the changed instance
DeltaCloudInstance[] instancesArray = instances.toArray(new DeltaCloudInstance[instances.size()]);
notifyInstanceListListeners(instancesArray);
return instancesArray;
@@ -295,6 +297,7 @@
} catch (DeltaCloudException e) {
return null;
}
+ // TODO: remove notification with all instances, replace by notifying the changed instance
DeltaCloudInstance[] instancesArray = instances.toArray(instances.toArray(new DeltaCloudInstance[instances.size()]));
notifyInstanceListListeners(instancesArray);
return instancesArray;
@@ -330,7 +333,7 @@
if (!found) {
instances.add(instance);
}
-
+ // TODO: remove notification with all instances, replace by notifying the changed instance
notifyInstanceListListeners(
instances.toArray(instances.toArray(new DeltaCloudInstance[instances.size()])));
}
@@ -372,6 +375,7 @@
boolean result = instance.performInstanceAction(actionId, client);
if (result) {
+ // TODO: remove notification with all instances, replace by notifying the changed instance
notifyInstanceListListeners(instances.toArray(instances.toArray(new DeltaCloudInstance[instances.size()])));
}
return result;
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-05 16:23:21 UTC (rev 26301)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-05 16:24:16 UTC (rev 26302)
@@ -1,3 +1,8 @@
+2010-11-05 André Dietisheim <adietish(a)redhat.com>
+
+ * src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java (.run):
+ [JBIDE-7503] added restore selection after refresh (viewer lost the selection before this change)
+
2010-11-04 André Dietisheim <adietish(a)redhat.com>
* src/org/jboss/tools/deltacloud/ui/views/CloudViewElementUtils.java:
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-11-05 16:23:21 UTC (rev 26301)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstanceElement.java 2010-11-05 16:24:16 UTC (rev 26302)
@@ -22,5 +22,4 @@
public IPropertySource getPropertySource() {
return new InstancePropertySource(this, getElement());
}
-
}
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-11-05 16:23:21 UTC (rev 26301)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-11-05 16:24:16 UTC (rev 26302)
@@ -11,7 +11,11 @@
package org.jboss.tools.deltacloud.ui.views;
import java.util.ArrayList;
+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.widgets.Display;
@@ -24,31 +28,31 @@
private Viewer viewer;
private CVInstancesCategoryElement category;
-
+
public CVInstancesCategoryElement(Object element, String name, Viewer viewer) {
super(element, name, CVCategoryElement.INSTANCES);
this.viewer = viewer;
- DeltaCloud cloud = (DeltaCloud)getElement();
+ DeltaCloud cloud = (DeltaCloud) getElement();
cloud.addInstanceListListener(this);
this.category = this;
}
protected void finalize() throws Throwable {
- DeltaCloud cloud = (DeltaCloud)getElement();
+ DeltaCloud cloud = (DeltaCloud) getElement();
cloud.removeInstanceListListener(this);
super.finalize();
}
-
+
private void addInstances(DeltaCloudInstance[] instances) {
if (instances.length > CVNumericFoldingElement.FOLDING_SIZE) {
int min = 0;
int max = CVNumericFoldingElement.FOLDING_SIZE;
int length = instances.length;
while (length > CVNumericFoldingElement.FOLDING_SIZE) {
- CVNumericFoldingElement f = new CVNumericFoldingElement(null,
+ CVNumericFoldingElement f = new CVNumericFoldingElement(null,
"[" + min + ".." + (max - 1) + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
addChild(f);
- for (int i = min; i < max; ++i) {
+ for (int i = min; i < max; ++i) {
DeltaCloudInstance d = instances[i];
CVInstanceElement element = new CVInstanceElement(d, d.getName());
f.addChild(element);
@@ -58,8 +62,8 @@
length -= CVNumericFoldingElement.FOLDING_SIZE;
}
if (length > 0) {
- CVNumericFoldingElement f = new CVNumericFoldingElement(null,
- "[" + min + ".." + (max - 1) + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ CVNumericFoldingElement f = new CVNumericFoldingElement(null,
+ "[" + min + ".." + (max - 1) + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
addChild(f);
for (int i = min; i < min + length; ++i) {
DeltaCloudInstance d = instances[i];
@@ -75,11 +79,11 @@
}
}
}
-
+
@Override
public Object[] getChildren() {
if (!initialized) {
- DeltaCloud cloud = (DeltaCloud)getElement();
+ DeltaCloud cloud = (DeltaCloud) getElement();
cloud.removeInstanceListListener(this);
DeltaCloudInstance[] instances = filter(cloud.getCurrInstances());
addInstances(instances);
@@ -92,20 +96,70 @@
@Override
public void listChanged(DeltaCloud cloud, DeltaCloudInstance[] newInstances) {
clearChildren();
- DeltaCloudInstance[] instances = filter(newInstances);
+ final DeltaCloudInstance[] instances = filter(newInstances);
addInstances(instances);
initialized = true;
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
- ((TreeViewer)viewer).refresh(category, false);
+ IStructuredSelection oldSelection = (IStructuredSelection) viewer.getSelection();
+ ((TreeViewer) viewer).refresh(category, 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) {
+ ISelection newSelection = new StructuredSelection(getChildrenWithSameDeltaCloudInstance(selection
+ .toList()));
+ viewer.setSelection(newSelection);
+ }
+
+ private List<CVInstanceElement> getChildrenWithSameDeltaCloudInstance(List<?> cvInstanceElements) {
+ List<CVInstanceElement> cvInstances = new ArrayList<CVInstanceElement>();
+ Object[] children = getChildren();
+ for (Object member : cvInstanceElements) {
+ CVInstanceElement cvInstance = (CVInstanceElement) member;
+ DeltaCloudInstance instance = (DeltaCloudInstance) cvInstance.getElement();
+ for (Object child : children) {
+ CVInstanceElement childCvInstanceElement = (CVInstanceElement) child;
+ DeltaCloudInstance childInstance = (DeltaCloudInstance) childCvInstanceElement.getElement();
+ if (instance != null && instance.equals(childInstance)) {
+ cvInstances.add(childCvInstanceElement);
+ }
+ }
+ }
+ return cvInstances;
+ }
+
});
}
private DeltaCloudInstance[] filter(DeltaCloudInstance[] input) {
ArrayList<DeltaCloudInstance> array = new ArrayList<DeltaCloudInstance>();
- DeltaCloud cloud = (DeltaCloud)getElement();
+ DeltaCloud cloud = (DeltaCloud) getElement();
IInstanceFilter f = cloud.getInstanceFilter();
for (int i = 0; i < input.length; ++i) {
DeltaCloudInstance instance = input[i];
15 years, 5 months
JBoss Tools SVN: r26301 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-05 12:23:21 -0400 (Fri, 05 Nov 2010)
New Revision: 26301
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java
Log:
[JBIDE-7503] cleanup
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java 2010-11-05 16:16:32 UTC (rev 26300)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java 2010-11-05 16:23:21 UTC (rev 26301)
@@ -16,6 +16,7 @@
import javax.xml.bind.annotation.XmlElement;
public class Instance extends DeltaCloudObject {
+
private static final long serialVersionUID = 1L;
public static enum State {
@@ -249,5 +250,4 @@
return s;
}
-
}
15 years, 5 months
JBoss Tools SVN: r26300 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-11-05 12:16:32 -0400 (Fri, 05 Nov 2010)
New Revision: 26300
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/VisualPartAbstractHandler.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java
Log:
https://jira.jboss.org/browse/JBIDE-7475
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java 2010-11-05 16:06:24 UTC (rev 26299)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java 2010-11-05 16:16:32 UTC (rev 26300)
@@ -82,6 +82,9 @@
JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) editor;
MozillaEditor mozillaEditor = ((VpeEditorPart) jspEditor
.getVisualEditor()).getVisualEditor();
+ if(mozillaEditor==null){
+ return;
+ }
IVpeToolBarManager vpeToolBarManager = mozillaEditor
.getVpeToolBarManager();
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/VisualPartAbstractHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/VisualPartAbstractHandler.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/VisualPartAbstractHandler.java 2010-11-05 16:16:32 UTC (rev 26300)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.handlers;
+
+import java.util.Map;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.HandlerEvent;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.commands.IElementUpdater;
+import org.eclipse.ui.menus.UIElement;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+
+/**
+ * Handler which disable icons when vpe part not visible
+ *
+ * @author mareshkau
+ *
+ */
+public abstract class VisualPartAbstractHandler extends AbstractHandler
+ implements IElementUpdater {
+ @Override
+ public void setEnabled(Object evaluationContext) {
+ boolean enabled = false;
+
+ if (evaluationContext instanceof IEvaluationContext) {
+ IEvaluationContext context = (IEvaluationContext) evaluationContext;
+ Object activeEditor = context.getVariable(ISources.ACTIVE_EDITOR_NAME);
+ if(activeEditor instanceof JSPMultiPageEditor){
+ JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) activeEditor;
+ if(jspEditor.getVisualEditor().getController()!=null)
+ enabled=((VpeController)(jspEditor.getVisualEditor().getController())).isVisualEditorVisible();
+ }
+ }
+
+ if (enabled != isEnabled()) {
+ setBaseEnabled(enabled);
+ }
+ }
+
+ public void updateElement(UIElement element, Map parameters) {
+ fireHandlerChanged(new HandlerEvent(this, true, false));
+ }
+}
15 years, 5 months
JBoss Tools SVN: r26299 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: handlers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-11-05 12:06:24 -0400 (Fri, 05 Nov 2010)
New Revision: 26299
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PageDesignOptionsHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PreferencesHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RefreshHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowBorderHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowBundleAsELHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowNonVisualTagsHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java
Log:
https://jira.jboss.org/browse/JBIDE-7475
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-11-05 15:59:58 UTC (rev 26298)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-11-05 16:06:24 UTC (rev 26299)
@@ -128,6 +128,13 @@
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.jboss.tools.vpe.editor.util.VpeDebugUtil;
import org.jboss.tools.vpe.editor.util.VpeNodesManagingUtil;
+import org.jboss.tools.vpe.handlers.PageDesignOptionsHandler;
+import org.jboss.tools.vpe.handlers.PreferencesHandler;
+import org.jboss.tools.vpe.handlers.RefreshHandler;
+import org.jboss.tools.vpe.handlers.RotateEditorsHandler;
+import org.jboss.tools.vpe.handlers.ShowBorderHandler;
+import org.jboss.tools.vpe.handlers.ShowBundleAsELHandler;
+import org.jboss.tools.vpe.handlers.ShowNonVisualTagsHandler;
import org.jboss.tools.vpe.handlers.ShowTextFormattingHandler;
import org.jboss.tools.vpe.messages.VpeUIMessages;
import org.jboss.tools.vpe.resref.core.AbsoluteFolderReferenceList;
@@ -2370,7 +2377,6 @@
}
public void setVisualEditorVisible(boolean visualEditorVisible) {
- VpeDebugUtil.debugInfo(visualEditorVisible+"");
this.visualEditorVisible = visualEditorVisible;
}
@@ -2467,7 +2473,13 @@
ICommandService commandService = (ICommandService) PlatformUI
.getWorkbench().getService(ICommandService.class);
commandService.refreshElements(ShowTextFormattingHandler.COMMAND_ID, null);
-
+ commandService.refreshElements(RotateEditorsHandler.COMMAND_ID, null);
+ commandService.refreshElements(ShowNonVisualTagsHandler.COMMAND_ID, null);
+ commandService.refreshElements(ShowBundleAsELHandler.COMMAND_ID, null);
+ commandService.refreshElements(ShowBorderHandler.COMMAND_ID, null);
+ commandService.refreshElements(RefreshHandler.COMMAND_ID, null);
+ commandService.refreshElements(PreferencesHandler.COMMAND_ID, null);
+ commandService.refreshElements(PageDesignOptionsHandler.COMMAND_ID, null);
}
/**
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PageDesignOptionsHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PageDesignOptionsHandler.java 2010-11-05 15:59:58 UTC (rev 26298)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PageDesignOptionsHandler.java 2010-11-05 16:06:24 UTC (rev 26299)
@@ -11,7 +11,6 @@
package org.jboss.tools.vpe.handlers;
-import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFile;
@@ -22,7 +21,9 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.ILocationProvider;
import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.VpePlugin;
+import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.util.FileUtil;
import org.jboss.tools.vpe.messages.VpeUIMessages;
import org.jboss.tools.vpe.resref.core.VpeResourcesDialog;
@@ -30,12 +31,9 @@
/**
* Handler for PageDesignOptions
*/
-public class PageDesignOptionsHandler extends AbstractHandler {
- /**
- * The constructor.
- */
- public PageDesignOptionsHandler() {
- }
+public class PageDesignOptionsHandler extends VisualPartAbstractHandler {
+
+ public static final String COMMAND_ID="org.jboss.tools.vpe.commands.pageDesignOptionsCommand"; //$NON-NLS-1$
/**
* the command has been executed, so extract extract the needed information
@@ -84,8 +82,16 @@
file = FileUtil.getFile(input, path.lastSegment());
}
}
+ boolean isVisualPartVisible=false;
+ if(activeEditor instanceof JSPMultiPageEditor){
+ JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) activeEditor;
+ if(jspEditor.getVisualEditor().getController()!=null)
+ isVisualPartVisible=((VpeController)(jspEditor.getVisualEditor().getController())).isVisualEditorVisible();
+ }
- boolean enabled = file != null && file.exists();
+
+ boolean isFileExists = file != null && file.exists();
+ boolean enabled=isFileExists&&isVisualPartVisible;
if (isEnabled() != enabled) {
setBaseEnabled(enabled);
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PreferencesHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PreferencesHandler.java 2010-11-05 15:59:58 UTC (rev 26298)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PreferencesHandler.java 2010-11-05 16:06:24 UTC (rev 26299)
@@ -11,7 +11,6 @@
package org.jboss.tools.vpe.handlers;
-import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPage;
@@ -19,14 +18,9 @@
/**
* Handler for Preferences
*/
-public class PreferencesHandler extends AbstractHandler {
+public class PreferencesHandler extends VisualPartAbstractHandler {
+ public static final String COMMAND_ID = "org.jboss.tools.vpe.commands.preferencesCommand"; //$NON-NLS-1$
/**
- * The constructor.
- */
- public PreferencesHandler() {
- }
-
- /**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RefreshHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RefreshHandler.java 2010-11-05 15:59:58 UTC (rev 26298)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RefreshHandler.java 2010-11-05 16:06:24 UTC (rev 26299)
@@ -11,7 +11,6 @@
package org.jboss.tools.vpe.handlers;
-import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IEditorPart;
@@ -21,14 +20,10 @@
/**
* Handler for Refresh
*/
-public class RefreshHandler extends AbstractHandler {
+public class RefreshHandler extends VisualPartAbstractHandler {
+
+ public static final String COMMAND_ID = "org.jboss.tools.vpe.commands.refreshCommand"; //$NON-NLS-1$
/**
- * The constructor.
- */
- public RefreshHandler() {
- }
-
- /**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java 2010-11-05 15:59:58 UTC (rev 26298)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java 2010-11-05 16:06:24 UTC (rev 26299)
@@ -16,7 +16,6 @@
import java.util.List;
import java.util.Map;
-import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
@@ -24,11 +23,8 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.commands.IElementUpdater;
import org.eclipse.ui.menus.UIElement;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
@@ -39,9 +35,10 @@
/**
* Handler for RotateEditors
*/
-public class RotateEditorsHandler extends AbstractHandler implements
- IElementUpdater {
-
+public class RotateEditorsHandler extends VisualPartAbstractHandler{
+
+ public static final String COMMAND_ID="org.jboss.tools.vpe.commands.rotateEditorsCommand"; //$NON-NLS-1$
+
private static List<String> layoutValues;
private static Map<String, String> layoutIcons;
private static Map<String, String> layoutNames;
@@ -123,7 +120,7 @@
}
public void updateElement(UIElement element, Map parameters) {
-
+ super.updateElement(element, parameters);
IPreferenceStore preferences = JspEditorPlugin.getDefault()
.getPreferenceStore();
String orientation = preferences
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowBorderHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowBorderHandler.java 2010-11-05 15:59:58 UTC (rev 26298)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowBorderHandler.java 2010-11-05 16:06:24 UTC (rev 26299)
@@ -13,7 +13,6 @@
import java.util.Map;
-import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
@@ -21,7 +20,6 @@
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.commands.IElementUpdater;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.menus.UIElement;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
@@ -32,16 +30,10 @@
/**
* Handler for ShowBorder
*/
-public class ShowBorderHandler extends AbstractHandler implements
- IElementUpdater {
+public class ShowBorderHandler extends VisualPartAbstractHandler {
+ public static final String COMMAND_ID = "org.jboss.tools.vpe.commands.showBorderCommand"; //$NON-NLS-1$
/**
- * The constructor.
- */
- public ShowBorderHandler() {
- }
-
- /**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
@@ -64,7 +56,7 @@
}
public void updateElement(UIElement element, Map parameters) {
-
+ super.updateElement(element, parameters);
boolean toggleState = JspEditorPlugin.getDefault().getPreferenceStore()
.getBoolean(IVpePreferencesPage.SHOW_BORDER_FOR_UNKNOWN_TAGS);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowBundleAsELHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowBundleAsELHandler.java 2010-11-05 15:59:58 UTC (rev 26298)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowBundleAsELHandler.java 2010-11-05 16:06:24 UTC (rev 26299)
@@ -13,7 +13,6 @@
import java.util.Map;
-import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
@@ -21,7 +20,6 @@
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.commands.IElementUpdater;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.menus.UIElement;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
@@ -32,16 +30,10 @@
/**
* Handler for ShowBundleAsEL
*/
-public class ShowBundleAsELHandler extends AbstractHandler implements
- IElementUpdater {
+public class ShowBundleAsELHandler extends VisualPartAbstractHandler {
+ public static final String COMMAND_ID = "org.jboss.tools.vpe.commands.showBundleAsELCommand"; //$NON-NLS-1$
/**
- * The constructor.
- */
- public ShowBundleAsELHandler() {
- }
-
- /**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
@@ -65,7 +57,7 @@
}
public void updateElement(UIElement element, Map parameters) {
-
+ super.updateElement(element, parameters);
boolean toggleState = JspEditorPlugin
.getDefault()
.getPreferenceStore()
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowNonVisualTagsHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowNonVisualTagsHandler.java 2010-11-05 15:59:58 UTC (rev 26298)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowNonVisualTagsHandler.java 2010-11-05 16:06:24 UTC (rev 26299)
@@ -13,7 +13,6 @@
import java.util.Map;
-import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
@@ -21,7 +20,6 @@
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.commands.IElementUpdater;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.menus.UIElement;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
@@ -32,16 +30,10 @@
/**
* Handler for ShowNonVisualTags
*/
-public class ShowNonVisualTagsHandler extends AbstractHandler implements
- IElementUpdater {
+public class ShowNonVisualTagsHandler extends VisualPartAbstractHandler {
+ public static final String COMMAND_ID = "org.jboss.tools.vpe.commands.showNonVisualTagsCommand"; //$NON-NLS-1$
/**
- * The constructor.
- */
- public ShowNonVisualTagsHandler() {
- }
-
- /**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
@@ -64,7 +56,7 @@
}
public void updateElement(UIElement element, Map parameters) {
-
+ super.updateElement(element, parameters);
boolean toggleState = JspEditorPlugin.getDefault().getPreferenceStore()
.getBoolean(IVpePreferencesPage.SHOW_NON_VISUAL_TAGS);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java 2010-11-05 15:59:58 UTC (rev 26298)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java 2010-11-05 16:06:24 UTC (rev 26299)
@@ -13,24 +13,18 @@
import java.util.Map;
-import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.HandlerEvent;
-import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.ISources;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.commands.IElementUpdater;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.menus.UIElement;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
-import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.VpeEditorPart;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
import org.jboss.tools.vpe.editor.toolbar.IVpeToolBarManager;
@@ -38,36 +32,10 @@
/**
* Handler for ShowTextFormatting
*/
-public class ShowTextFormattingHandler extends AbstractHandler implements
- IElementUpdater {
+public class ShowTextFormattingHandler extends VisualPartAbstractHandler {
public static final String COMMAND_ID = "org.jboss.tools.vpe.commands.showTextFormattingCommand"; //$NON-NLS-1$
/**
- * The constructor.
- */
- public ShowTextFormattingHandler() {
- }
-
- @Override
- public void setEnabled(Object evaluationContext) {
- boolean enabled = false;
-
- if (evaluationContext instanceof IEvaluationContext) {
- IEvaluationContext context = (IEvaluationContext) evaluationContext;
- Object activeEditor = context.getVariable(ISources.ACTIVE_EDITOR_NAME);
- if(activeEditor instanceof JSPMultiPageEditor){
- JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) activeEditor;
- if(jspEditor.getVisualEditor().getController()!=null)
- enabled=((VpeController)(jspEditor.getVisualEditor().getController())).isVisualEditorVisible();
- }
- }
-
- if (enabled != isEnabled()) {
- setBaseEnabled(enabled);
- }
- }
-
- /**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
@@ -90,7 +58,7 @@
}
public void updateElement(UIElement element, Map parameters) {
-
+ super.updateElement(element, parameters);
boolean toggleState = JspEditorPlugin.getDefault().getPreferenceStore()
.getBoolean(IVpePreferencesPage.SHOW_TEXT_FORMATTING);
@@ -101,7 +69,7 @@
IEditorPart editor = openedEditor.getEditor(true);
toggleShowTextFormatting(editor, toggleState);
}
- fireHandlerChanged(new HandlerEvent(this, true, false));
+
}
private void toggleShowTextFormatting(IEditorPart editor,
15 years, 5 months
JBoss Tools SVN: r26298 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-11-05 11:59:58 -0400 (Fri, 05 Nov 2010)
New Revision: 26298
Modified:
trunk/build/target-platform/pom.xml
Log:
split 'local.target' into 'get.local.target' and 'use.local.target' so need not provision every time
Modified: trunk/build/target-platform/pom.xml
===================================================================
--- trunk/build/target-platform/pom.xml 2010-11-05 15:58:16 UTC (rev 26297)
+++ trunk/build/target-platform/pom.xml 2010-11-05 15:59:58 UTC (rev 26298)
@@ -52,10 +52,51 @@
<profiles>
<profile>
- <id>local.target</id>
+ <id>use.local.target</id>
<build>
<plugins>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.3</version>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <!-- add more artifacts if want more target platforms -->
+ <artifact>
+ <file>${target.platform.classifier.multiple.name}.target</file>
+ <type>target</type>
+ <classifier>${target.platform.classifier.multiple.name}</classifier>
+ </artifact>
+ <artifact>
+ <file>${target.platform.classifier.unified.name}.target</file>
+ <type>target</type>
+ <classifier>${target.platform.classifier.unified.name}</classifier>
+ </artifact>
+ <artifact>
+ <file>${target.platform.classifier.local.name}.target</file>
+ <type>target</type>
+ <classifier>${target.platform.classifier.local.name}</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>get.local.target</id>
+ <build>
+ <plugins>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
15 years, 5 months
JBoss Tools SVN: r26297 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-11-05 11:58:16 -0400 (Fri, 05 Nov 2010)
New Revision: 26297
Modified:
trunk/build/target-platform/build.xml
Log:
fix help target
Modified: trunk/build/target-platform/build.xml
===================================================================
--- trunk/build/target-platform/build.xml 2010-11-05 15:47:06 UTC (rev 26296)
+++ trunk/build/target-platform/build.xml 2010-11-05 15:58:16 UTC (rev 26297)
@@ -39,8 +39,22 @@
<!-- ********************************************************************************** -->
<target name="help">
- <echo>Default target is:
+ <echo>This script, if run in its entirety, will:
+
+ a) download features, plugins, binaries, and metadata from the site(s) specified
+ in a given target platform, and create a local p2 repo
+ b) generate a local.target file, which points at the generated local p2 repo
+After running this script, publish this pom and *.target files to your local ~/.m2 repo:
+ mvn clean install -f .../target-platform/pom.xml -P use.local.target
+
+Then you can then refer to it in downstream builds using:
+ mvn install -P local.target
+
+------------------
+
+Default target is:
+
* build.local.target.platform.repo
Can also attempt to:
@@ -73,15 +87,6 @@
<!-- ********************************************************************************** -->
<target name="init">
- <echo>This script, if run in its entirety, will:
-
- a) download features, plugins, binaries, and metadata from the site(s) specified in a given
- target platform, and create a local p2 repo
- b) generate a local.target file, which points at the generated local p2 repo
-
-After running this script you need to 'mvn clean install -f /path/to/target-platform/pom.xml -P local`,
-in order to
-</echo>
<ant antfile="${build.xml}" target="init" />
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
15 years, 5 months