import org.tizen.webuibuilder.outline.OutlineRenameAction;
import org.tizen.webuibuilder.outline.OutlineViewEditPart;
import org.tizen.webuibuilder.pagetemplate.action.CreateTemplateAction;
-import org.tizen.webuibuilder.pagetemplate.action.CssSelecotrAction;
import org.tizen.webuibuilder.pagetemplate.action.ExportTemplateAction;
import org.tizen.webuibuilder.pagetemplate.action.ImportTemplateAction;
import org.tizen.webuibuilder.pagetemplate.action.NewPageAction;
import org.tizen.webuibuilder.ui.editor.ruler.DesignerRuler;
import org.tizen.webuibuilder.ui.editor.ruler.DesignerRulerProvider;
import org.tizen.webuibuilder.ui.editor.texteditor.TextEditor;
+import org.tizen.webuibuilder.ui.selector.CssSelecotrAction;
import org.tizen.webuibuilder.ui.views.nscreen.NScreenHistory;
import org.tizen.webuibuilder.ui.views.nscreen.NScreenItem;
import org.tizen.webuibuilder.ui.views.nscreen.NScreenUtil;
-package org.tizen.webuibuilder.pagetemplate.action;
+package org.tizen.webuibuilder.ui.selector;
import java.util.List;
+import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.commands.Command;
import org.tizen.webuibuilder.ui.actions.WebUIBuilderActionConstants;
import org.tizen.webuibuilder.ui.contextmenu.Messages;
import org.tizen.webuibuilder.ui.editor.PageDesigner;
-import org.tizen.webuibuilder.ui.selector.CSSSelectorDialog;
-import org.tizen.webuibuilder.ui.selector.CSSSelectorUtil;
public class CssSelecotrAction extends SelectionAction {
EditPart editpart = (EditPart) object;
Object model = editpart.getModel();
- if (!(model instanceof Part) || ((Part)model).isDocumentPart()) {
- enabled = false;
+ if (!(model instanceof Part) || ((Part) model).isDocumentPart()) {
+ enabled = false;
break;
}
}
DesignerEditPart selectionDesignerPart = selectionParts.get(0);
Control control = designEditPartViewer.getControl();
- Rectangle rect = selectionDesignerPart.getFigure().getBounds();
-
Part part = (Part) selectionDesignerPart.getModel();
String id = part.getIdPropertyValue();
+ Rectangle rect = selectionDesignerPart.getFigure().getBounds();
org.eclipse.swt.graphics.Point p = control.toDisplay(rect.x, rect.y);
- int x = p.x + rect.width, y = p.y;
+ Figure f = (Figure) designEditPartViewer.getCurrentPage().getFigure();
+ Rectangle fr = f.getBounds();
+ Rectangle frc = fr.getCopy();
+ f.translateToAbsolute(frc);
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
-
CSSSelectorDialog selector = new CSSSelectorDialog(shell, id);
selector.setGoingBridge(designEditPartViewer.getGoingBridge());
+ // 5 means margin between figure and dialog
+ int x = p.x + rect.width + frc.x + 5, y = p.y;
+
selector.setPosition(x, y);
String obj = (String) selector.open();
if (obj == null || obj.isEmpty()) {