Author: dazarov
Date: 2008-05-28 06:20:17 -0400 (Wed, 28 May 2008)
New Revision: 8395
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/SetConstraintCommand.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/palette/
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/palette/PagesPaletteViewerPreferences.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1189
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/SetConstraintCommand.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/SetConstraintCommand.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/SetConstraintCommand.java 2008-05-28
10:20:17 UTC (rev 8395)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.seam.ui.pages.editor.commands;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesElement;
+
+public class SetConstraintCommand extends org.eclipse.gef.commands.Command {
+ private Point newPos;
+ private Dimension newSize;
+ private Point oldPos;
+ private Dimension oldSize;
+ private PagesElement part;
+
+ public void execute() {
+ oldSize = part.getSize();
+ oldPos = part.getLocation();
+
+ part.setLocation(newPos);
+ part.setSize(newSize);
+ }
+
+ public void setShell(Shell shell) {
+ }
+
+ public void redo() {
+ part.setSize(newSize);
+ part.setLocation(newPos);
+ }
+
+ public void setLocation(Rectangle r) {
+ setLocation(r.getLocation());
+ setSize(r.getSize());
+ }
+
+ public void setLocation(Point p) {
+ newPos = p;
+ }
+
+ public void setPart(PagesElement part) {
+ this.part = part;
+ }
+
+ public void setSize(Dimension p) {
+ newSize = p;
+ }
+
+ public void undo() {
+ part.setSize(oldSize);
+ part.setLocation(oldPos);
+ }
+
+}
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/palette/PagesPaletteViewerPreferences.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/palette/PagesPaletteViewerPreferences.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/palette/PagesPaletteViewerPreferences.java 2008-05-28
10:20:17 UTC (rev 8395)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.seam.ui.pages.editor.palette;
+
+import org.eclipse.gef.ui.palette.DefaultPaletteViewerPreferences;
+import org.jboss.tools.seam.ui.pages.SeamUiPagesPlugin;
+import org.jboss.tools.seam.ui.pages.editor.PagesEditor;
+
+
+
+public class PagesPaletteViewerPreferences extends DefaultPaletteViewerPreferences {
+ public PagesPaletteViewerPreferences(PagesEditor editor) {
+ super(SeamUiPagesPlugin.getDefault().getPreferenceStore());
+ }
+}