Author: max.andersen(a)jboss.com
Date: 2012-05-01 07:07:31 -0400 (Tue, 01 May 2012)
New Revision: 40670
Modified:
branches/jbosstools-3.3.0.Beta3/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyButtonCommand.java
branches/jbosstools-3.3.0.Beta3/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyComboCommand.java
branches/jbosstools-3.3.0.Beta3/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyCommand.java
Log:
JBIDE-11487 fixed my stupid missing commit and run error. while driving 130 km/h on Danish
freeway. Truly sorry.
Modified:
branches/jbosstools-3.3.0.Beta3/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyButtonCommand.java
===================================================================
---
branches/jbosstools-3.3.0.Beta3/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyButtonCommand.java 2012-05-01
04:19:01 UTC (rev 40669)
+++
branches/jbosstools-3.3.0.Beta3/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyButtonCommand.java 2012-05-01
11:07:31 UTC (rev 40670)
@@ -10,6 +10,10 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.ui.editor;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
@@ -19,6 +23,9 @@
* @since 2.3
*/
public class ServerWorkingCopyPropertyButtonCommand extends ServerCommand {
+ public static int POST_EXECUTE = 1;
+ public static int POST_UNDO = 2;
+ public static int POST_REDO = 3;
protected boolean oldVal;
protected boolean newVal;
protected String key;
@@ -41,6 +48,7 @@
public void execute() {
if( key != null )
wc.setAttribute(key, newVal);
+ postOp(POST_EXECUTE);
}
public void undo() {
@@ -52,5 +60,21 @@
button.setSelection(oldVal);
if( listener != null )
button.addSelectionListener(listener);
+ postOp(POST_UNDO);
}
+ public IStatus redo(IProgressMonitor monitor, IAdaptable adapt) {
+ if( listener != null )
+ button.removeSelectionListener(listener);
+ if( key != null )
+ wc.setAttribute(key, newVal);
+ if( button != null && !button.isDisposed())
+ button.setSelection(newVal);
+ if( listener != null )
+ button.addSelectionListener(listener);
+ postOp(POST_REDO);
+ return Status.OK_STATUS;
+ }
+ protected void postOp(int type) {
+ // Do Nothing
+ }
}
\ No newline at end of file
Modified:
branches/jbosstools-3.3.0.Beta3/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyComboCommand.java
===================================================================
---
branches/jbosstools-3.3.0.Beta3/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyComboCommand.java 2012-05-01
04:19:01 UTC (rev 40669)
+++
branches/jbosstools-3.3.0.Beta3/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyComboCommand.java 2012-05-01
11:07:31 UTC (rev 40670)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.ui.editor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.wst.server.core.IServerWorkingCopy;
@@ -18,6 +20,9 @@
* @since 2.3
*/
public class ServerWorkingCopyPropertyComboCommand extends ServerCommand {
+ public static int POST_EXECUTE = 1;
+ public static int POST_UNDO = 2;
+ public static int POST_REDO = 3;
protected String oldVal;
protected String newVal;
protected String key;
@@ -39,6 +44,7 @@
public void execute() {
wc.setAttribute(key, newVal);
+ postOp(POST_EXECUTE);
}
public void undo() {
@@ -49,5 +55,21 @@
combo.setText(oldVal);
if( listener != null )
combo.addModifyListener(listener);
+ postOp(POST_UNDO);
}
+
+ public IStatus redo() {
+ if( listener != null )
+ combo.removeModifyListener(listener);
+ wc.setAttribute(key, newVal);
+ if( combo != null && !combo.isDisposed())
+ combo.setText(newVal);
+ if( listener != null )
+ combo.addModifyListener(listener);
+ postOp(POST_REDO);
+ return Status.OK_STATUS;
+ }
+ protected void postOp(int type) {
+ // Do Nothing
+ }
}
\ No newline at end of file
Modified:
branches/jbosstools-3.3.0.Beta3/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyCommand.java
===================================================================
---
branches/jbosstools-3.3.0.Beta3/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyCommand.java 2012-05-01
04:19:01 UTC (rev 40669)
+++
branches/jbosstools-3.3.0.Beta3/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyCommand.java 2012-05-01
11:07:31 UTC (rev 40670)
@@ -10,6 +10,10 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.ui.editor;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.wst.server.core.IServerWorkingCopy;
@@ -18,6 +22,10 @@
* @since 2.3
*/
public class ServerWorkingCopyPropertyCommand extends ServerCommand {
+ public static int POST_EXECUTE = 1;
+ public static int POST_UNDO = 2;
+ public static int POST_REDO = 3;
+
protected String oldVal;
protected String newVal;
protected String key;
@@ -43,6 +51,7 @@
public void execute() {
wc.setAttribute(key, newVal);
+ postOp(POST_EXECUTE);
}
public void undo() {
@@ -53,5 +62,21 @@
text.setText(oldVal);
if( listener != null )
text.addModifyListener(listener);
+ postOp(POST_UNDO);
}
+ public IStatus redo(IProgressMonitor monitor, IAdaptable adapt) {
+ if( listener != null )
+ text.removeModifyListener(listener);
+ wc.setAttribute(key, newVal);
+ if( text != null && !text.isDisposed())
+ text.setText(newVal);
+ if( listener != null )
+ text.addModifyListener(listener);
+ postOp(POST_REDO);
+ return Status.OK_STATUS;
+ }
+
+ protected void postOp(int type) {
+ // Do Nothing
+ }
}
\ No newline at end of file