Search in sources :

Example 6 with MobileBuilder

use of com.twinsoft.convertigo.engine.mobile.MobileBuilder in project convertigo by convertigo.

the class TreeDropAdapter method performDrop.

/* (non-Javadoc)
	 * @see org.eclipse.jface.viewers.ViewerDropAdapter#performDrop(java.lang.Object)
	 */
@Override
public boolean performDrop(Object data) {
    MobileBuilder mb = null;
    Engine.logStudio.info("---------------------- Drop started ----------------------");
    try {
        Object targetObject = getCurrentTarget();
        IEditorPart editorPart = ConvertigoPlugin.getDefault().getApplicationComponentEditor();
        if (editorPart != null) {
            IEditorInput input = editorPart.getEditorInput();
            if (input instanceof com.twinsoft.convertigo.eclipse.editors.mobile.ApplicationComponentEditorInput) {
                com.twinsoft.convertigo.eclipse.editors.mobile.ApplicationComponentEditorInput editorInput = GenericUtils.cast(input);
                mb = editorInput.getApplication().getProject().getMobileBuilder();
            }
            if (input instanceof com.twinsoft.convertigo.eclipse.editors.ngx.ApplicationComponentEditorInput) {
                com.twinsoft.convertigo.eclipse.editors.ngx.ApplicationComponentEditorInput editorInput = GenericUtils.cast(input);
                mb = editorInput.getApplication().getProject().getMobileBuilder();
            }
        }
        // Handle objects copy or move with Drag and drop
        if (targetObject instanceof TreeObject) {
            TreeObject targetTreeObject = (TreeObject) targetObject;
            if (targetTreeObject != null) {
                ProjectExplorerView explorerView = targetTreeObject.getProjectExplorerView();
                Document document = null;
                try {
                    Shell shell = Display.getDefault().getActiveShell();
                    try {
                        // Try to parse text data into an XML document
                        String source = data.toString();
                        document = XMLUtils.getDefaultDocumentBuilder().parse(new InputSource(new StringReader(source)));
                        if (mb != null) {
                            mb.prepareBatchBuild();
                        }
                        BatchOperationHelper.start();
                        boolean insertBefore = (feedback & DND.FEEDBACK_INSERT_BEFORE) != 0;
                        boolean insertAfter = (feedback & DND.FEEDBACK_INSERT_AFTER) != 0;
                        TreeObject sourceObject = (TreeObject) getSelectedObject();
                        if (insertBefore || insertAfter) {
                            TreeParent targetTreeParent = ((TreeObject) targetObject).getParent();
                            if (sourceObject.getParent() != targetTreeParent) {
                                ProjectTreeObject prjTree = targetTreeParent.getProjectTreeObject();
                                String path = targetTreeParent.getPath();
                                ClipboardAction.dnd.paste(source, shell, explorerView, targetTreeParent, true);
                                targetTreeParent = (TreeParent) explorerView.findTreeObjectByPath(prjTree, path);
                            }
                            explorerView.moveChildTo(targetTreeParent, sourceObject, targetTreeObject, insertBefore);
                        } else {
                            ClipboardAction.dnd.paste(source, shell, explorerView, targetTreeObject, true);
                        }
                        BatchOperationHelper.stop();
                        return true;
                    } catch (SAXException sax) {
                        BatchOperationHelper.cancel();
                        if (mb != null) {
                            mb.prepareBatchBuild();
                        }
                        BatchOperationHelper.start();
                        // Parse failed probably because data was not XML but an XPATH String
                        // in this case, create DatabaseObjects of the correct Type according to the folder where the XPATH is dropped on
                        performDrop(data, explorerView, targetTreeObject);
                        BatchOperationHelper.stop();
                        return true;
                    }
                } catch (Exception e) {
                    BatchOperationHelper.cancel();
                    if (e instanceof ObjectWithSameNameException) {
                        document = null;
                    }
                    if (e instanceof InvalidOperationException) {
                        document = null;
                    }
                    // Case of unauthorized databaseObject paste
                    if (document != null) {
                        try {
                            if (!(targetTreeObject instanceof IPropertyTreeObject)) {
                                Element rootElement = document.getDocumentElement();
                                NodeList nodeList = rootElement.getChildNodes();
                                boolean unauthorized = false;
                                int len = nodeList.getLength();
                                Node node;
                                // case of folder, retrieve owner object
                                targetTreeObject = explorerView.getFirstSelectedDatabaseObjectTreeObject(targetTreeObject);
                                if (detail == DND.DROP_COPY) {
                                    for (int i = 0; i < len; i++) {
                                        node = (Node) nodeList.item(i);
                                        if (node.getNodeType() != Node.TEXT_NODE) {
                                            // Special objects paste
                                            if (!paste(node, targetTreeObject)) {
                                                // Real unauthorized databaseObject paste
                                                unauthorized = true;
                                            }
                                        }
                                    }
                                    reloadTreeObject(explorerView, targetTreeObject);
                                } else if (detail == DND.DROP_MOVE) {
                                    for (int i = 0; i < len; i++) {
                                        node = (Node) nodeList.item(i);
                                        if (node.getNodeType() != Node.TEXT_NODE) {
                                            // Special objects move
                                            if (!move(node, targetTreeObject)) {
                                                // Real unauthorized databaseObject move
                                                unauthorized = true;
                                            }
                                        }
                                    }
                                    reloadTreeObject(explorerView, targetTreeObject);
                                } else {
                                    // Real unauthorized databaseObject
                                    unauthorized = true;
                                }
                                if (unauthorized) {
                                    throw e;
                                }
                                return true;
                            }
                        } catch (Exception ex) {
                            ConvertigoPlugin.errorMessageBox(ex.getMessage());
                            return false;
                        }
                    } else {
                        ConvertigoPlugin.errorMessageBox(e.getMessage());
                        return false;
                    }
                }
            }
        }
        return false;
    } finally {
        Engine.logStudio.info("---------------------- Drop ended   ----------------------");
        BatchOperationHelper.cancel();
    }
}
Also used : InputSource(org.xml.sax.InputSource) TreeParent(com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeParent) Element(org.w3c.dom.Element) Node(org.w3c.dom.Node) Document(org.w3c.dom.Document) SAXException(org.xml.sax.SAXException) Shell(org.eclipse.swt.widgets.Shell) StringReader(java.io.StringReader) InvalidOperationException(com.twinsoft.convertigo.engine.InvalidOperationException) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) NodeList(org.w3c.dom.NodeList) IEditorPart(org.eclipse.ui.IEditorPart) IOException(java.io.IOException) ObjectWithSameNameException(com.twinsoft.convertigo.engine.ObjectWithSameNameException) SAXException(org.xml.sax.SAXException) EngineException(com.twinsoft.convertigo.engine.EngineException) InvalidOperationException(com.twinsoft.convertigo.engine.InvalidOperationException) ObjectWithSameNameException(com.twinsoft.convertigo.engine.ObjectWithSameNameException) MobileBuilder(com.twinsoft.convertigo.engine.mobile.MobileBuilder) PropertyTableRowTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.PropertyTableRowTreeObject) NgxComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxComponentTreeObject) IOrderableTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.IOrderableTreeObject) ProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject) FolderTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.FolderTreeObject) ObjectsFolderTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject) NgxUIComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxUIComponentTreeObject) MobileUIComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileUIComponentTreeObject) IPropertyTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.IPropertyTreeObject) PropertyTableTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.PropertyTableTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) ScreenClassTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ScreenClassTreeObject) MobileComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileComponentTreeObject) PropertyTableRowTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.PropertyTableRowTreeObject) NgxComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxComponentTreeObject) IOrderableTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.IOrderableTreeObject) ProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject) FolderTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.FolderTreeObject) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) ObjectsFolderTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject) NgxUIComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxUIComponentTreeObject) MobileUIComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileUIComponentTreeObject) IPropertyTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.IPropertyTreeObject) RequestableObject(com.twinsoft.convertigo.beans.core.RequestableObject) PropertyTableTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.PropertyTableTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) ScreenClassTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ScreenClassTreeObject) MobileComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileComponentTreeObject) ProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject) IEditorInput(org.eclipse.ui.IEditorInput) IPropertyTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.IPropertyTreeObject)

Example 7 with MobileBuilder

use of com.twinsoft.convertigo.engine.mobile.MobileBuilder in project convertigo by convertigo.

the class CLI method generateMobileBuilder.

public void generateMobileBuilder(Project project, String mode) throws Exception {
    MobileBuilder mb = project.getMobileBuilder();
    MobileBuilderBuildMode bm = MobileBuilderBuildMode.production;
    try {
        bm = MobileBuilderBuildMode.valueOf(mode);
    } catch (Exception e) {
    }
    mb.setAppBuildMode(bm);
    List<Project> projects = new ArrayList<>();
    projects.add(project);
    int i = 0;
    do {
        for (Reference ref : projects.get(i).getReferenceList()) {
            if (ref instanceof ProjectSchemaReference) {
                ProjectSchemaReference pref = (ProjectSchemaReference) ref;
                Project p = Engine.theApp.referencedProjectManager.importProject(pref.getParser());
                if (p == null) {
                    Engine.logConvertigo.warn("Failed to import project reference: " + pref.getProjectName() + " (ignored)");
                } else if (!projects.contains(p)) {
                    projects.add(p);
                }
            }
        }
    } while (++i < projects.size());
    Collections.reverse(projects);
    for (Project p : projects) {
        MobileBuilder.initBuilder(p, true);
    }
    Collections.reverse(projects);
    for (Project p : projects) {
        MobileBuilder.releaseBuilder(p, true);
    }
}
Also used : Project(com.twinsoft.convertigo.beans.core.Project) ProjectSchemaReference(com.twinsoft.convertigo.beans.references.ProjectSchemaReference) MobileBuilder(com.twinsoft.convertigo.engine.mobile.MobileBuilder) Reference(com.twinsoft.convertigo.beans.core.Reference) ProjectSchemaReference(com.twinsoft.convertigo.beans.references.ProjectSchemaReference) ArrayList(java.util.ArrayList) MobileBuilderBuildMode(com.twinsoft.convertigo.engine.enums.MobileBuilderBuildMode) IOException(java.io.IOException)

Example 8 with MobileBuilder

use of com.twinsoft.convertigo.engine.mobile.MobileBuilder in project convertigo by convertigo.

the class MobileResourceHelper method fixMobileBuilderTimes.

private void fixMobileBuilderTimes() {
    try {
        Path resourcePath = mobileApplication.getResourceFolder().toPath();
        if (!Files.exists(resourcePath.resolve("build"))) {
            return;
        }
        MobileBuilder mb = mobileApplication.getProject().getMobileBuilder();
        if (mb != null) {
            mb.waitBuildFinished();
        }
        Path fuPath = Paths.get(project.getDirPath(), "Flashupdate");
        Files.createDirectories(fuPath);
        Path pathMD5 = fuPath.resolve("md5.json");
        JSONObject[] jsonMD5 = { null };
        if (Files.exists(pathMD5)) {
            try {
                jsonMD5[0] = new JSONObject(FileUtils.readFileToString(pathMD5.toFile(), StandardCharsets.UTF_8));
            } catch (Exception e) {
            // TODO: handle exception
            }
        }
        if (jsonMD5[0] == null) {
            jsonMD5[0] = new JSONObject();
        }
        long[] latest = { 0 };
        Files.walk(resourcePath).filter(p -> !p.equals(pathMD5)).forEach(p -> {
            if (Files.isDirectory(p)) {
                return;
            }
            File f = p.toFile();
            String key = resourcePath.relativize(p).toString().replace('\\', '/');
            try {
                JSONObject entryMD5 = jsonMD5[0].has(key) ? jsonMD5[0].getJSONObject(key) : null;
                if (entryMD5 == null || FileUtils.isFileNewer(f, entryMD5.getLong("ts"))) {
                    try (FileInputStream fis = new FileInputStream(f)) {
                        String md5 = DigestUtils.md5Hex(fis);
                        String lastMD5 = entryMD5 == null ? null : entryMD5.getString("md5");
                        if (md5.equals(lastMD5)) {
                            Engine.logEngine.trace("(MobileResourceHelper) restore " + f.getName() + " " + md5 + " from " + f.lastModified() + " to " + entryMD5.getLong("ts"));
                            f.setLastModified(entryMD5.getLong("ts"));
                        } else {
                            Engine.logEngine.trace("(MobileResourceHelper) changed " + f.getName() + " " + md5 + " != " + lastMD5 + " from " + (entryMD5 == null ? null : entryMD5.getLong("ts")) + " to " + f.lastModified());
                            entryMD5 = new JSONObject();
                            entryMD5.put("md5", md5);
                            entryMD5.put("ts", f.lastModified());
                            jsonMD5[0].put(key, entryMD5);
                        }
                    }
                }
            } catch (Exception e) {
                Engine.logEngine.debug("(MobileResourceHelper) fixMobileBuilderTimes failed to handle '" + f + "' : " + e, e);
            }
            if (!f.getName().equals("service-worker.js")) {
                latest[0] = Math.max(latest[0], f.lastModified());
            }
        });
        if (latest[0] > 0) {
            Files.walk(resourcePath).forEach(p -> {
                File f = p.toFile();
                if (f.lastModified() > latest[0]) {
                    f.setLastModified(latest[0]);
                }
            });
        }
        FileUtils.write(pathMD5.toFile(), jsonMD5[0].toString(2), StandardCharsets.UTF_8);
    } catch (Exception e) {
        Engine.logEngine.debug("(MobileResourceHelper) fixMobileBuilderTimes failed : " + e, e);
    }
}
Also used : Path(java.nio.file.Path) IOFileFilter(org.apache.commons.io.filefilter.IOFileFilter) Arrays(java.util.Arrays) URLDecoder(java.net.URLDecoder) ServiceException(com.twinsoft.convertigo.engine.admin.services.ServiceException) FileFilterUtils(org.apache.commons.io.filefilter.FileFilterUtils) ResourceBundle(com.twinsoft.convertigo.engine.MinificationManager.ResourceBundle) MobileBuilder(com.twinsoft.convertigo.engine.mobile.MobileBuilder) HttpServletRequest(javax.servlet.http.HttpServletRequest) Matcher(java.util.regex.Matcher) ZipUtils(com.twinsoft.convertigo.engine.util.ZipUtils) FlashUpdateBuildMode(com.twinsoft.convertigo.beans.core.MobileApplication.FlashUpdateBuildMode) MobileApplication(com.twinsoft.convertigo.beans.core.MobileApplication) LinkedList(java.util.LinkedList) Path(java.nio.file.Path) TrueFileFilter(org.apache.commons.io.filefilter.TrueFileFilter) Files(java.nio.file.Files) Engine(com.twinsoft.convertigo.engine.Engine) JSONObject(org.codehaus.jettison.json.JSONObject) IOException(java.io.IOException) FileUtils(org.apache.commons.io.FileUtils) StringEscapeUtils(org.apache.commons.text.StringEscapeUtils) JSONArray(org.codehaus.jettison.json.JSONArray) FileInputStream(java.io.FileInputStream) File(java.io.File) StandardCharsets(java.nio.charset.StandardCharsets) Project(com.twinsoft.convertigo.beans.core.Project) List(java.util.List) FileFilter(java.io.FileFilter) StringReader(java.io.StringReader) Paths(java.nio.file.Paths) JSONException(org.codehaus.jettison.json.JSONException) MobilePlatform(com.twinsoft.convertigo.beans.core.MobilePlatform) BufferedReader(java.io.BufferedReader) Pattern(java.util.regex.Pattern) EngineException(com.twinsoft.convertigo.engine.EngineException) DigestUtils(org.apache.commons.codec.digest.DigestUtils) InputStream(java.io.InputStream) MobileBuilder(com.twinsoft.convertigo.engine.mobile.MobileBuilder) JSONObject(org.codehaus.jettison.json.JSONObject) File(java.io.File) ServiceException(com.twinsoft.convertigo.engine.admin.services.ServiceException) IOException(java.io.IOException) JSONException(org.codehaus.jettison.json.JSONException) EngineException(com.twinsoft.convertigo.engine.EngineException) FileInputStream(java.io.FileInputStream)

Example 9 with MobileBuilder

use of com.twinsoft.convertigo.engine.mobile.MobileBuilder in project convertigo by convertigo.

the class ApplicationComponentEditor method handleProdBuild.

private void handleProdBuild() {
    terminateNode(true);
    if (prodJob != null) {
        prodJob.cancel();
        prodJob = null;
    }
    if (buildMode == null) {
        return;
    }
    NgxBuilderBuildMode buildMode = this.buildMode;
    boolean[] terminated = { false };
    MobileBuilder mb = project.getMobileBuilder();
    if (buildMode.equals(NgxBuilderBuildMode.prod)) {
        mb.setAppBuildMode(MobileBuilderBuildMode.production);
    } else {
        mb.setAppBuildMode(MobileBuilderBuildMode.fast);
    }
    String endPointUrl = applicationEditorInput.application.getParent().getEndpoint();
    if (endPointUrl.isBlank()) {
        endPointUrl = EnginePropertiesManager.getProperty(PropertyName.APPLICATION_SERVER_CONVERTIGO_ENDPOINT);
        if (endPointUrl.isBlank()) {
            endPointUrl = EnginePropertiesManager.getProperty(PropertyName.APPLICATION_SERVER_CONVERTIGO_URL);
        }
    }
    String baseHref = "/convertigo/projects/" + project.getName() + "/DisplayObjects/mobile/";
    try {
        baseHref = (endPointUrl.isEmpty() ? "/convertigo" : endPointUrl.replaceFirst("https?://.*?/", "/").replaceFirst("(/.*)/.*?$", "$1")) + "/projects/" + project.getName() + "/DisplayObjects/mobile/";
    } catch (Exception e) {
    }
    final String appBaseHref = baseHref;
    String appName = applicationEditorInput.application.getParent().getComputedApplicationName();
    prodJob = Job.create("Build in " + buildMode.label() + " mode for " + appName, monitor -> {
        try {
            Engine.logStudio.debug("Build in " + buildMode.label() + " mode requested for " + appName);
            monitor.beginTask("Removing previous build directory", 5);
            monitor.worked(1);
            File displayObjectsMobile = new File(project.getDirPath(), "DisplayObjects/mobile");
            displayObjectsMobile.mkdirs();
            monitor.worked(1);
            for (File f : displayObjectsMobile.listFiles()) {
                if (!f.getName().equals("assets")) {
                    com.twinsoft.convertigo.engine.util.FileUtils.deleteQuietly(f);
                }
            }
            monitor.worked(3);
            monitor.beginTask("Launching the " + buildMode.label() + " build", 200);
            String path = nodeDir.getAbsolutePath();
            ProcessBuilder pb = ProcessUtils.getNpmProcessBuilder(path, "npm", "run", buildMode.command());
            List<String> cmd = pb.command();
            cmd.add("--");
            // #183 add useless option to help terminateNode method to find the current path
            cmd.add("--output-path=" + new File(project.getDirFile(), "DisplayObjects/mobile").getAbsolutePath());
            // #393 add base href for project's web app
            cmd.add("--base-href=" + appBaseHref);
            pb.redirectErrorStream(true);
            pb.directory(ionicDir);
            Process p = pb.start();
            processes.add(p);
            BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
            String line;
            Matcher matcher = Pattern.compile("(\\d+)% (.*)").matcher("");
            int lastProgress = 0;
            Engine.execute(() -> {
                while (!monitor.isCanceled() && !terminated[0]) {
                    try {
                        Thread.sleep(100);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                if (!terminated[0]) {
                    terminateNode(true);
                }
            });
            while (!monitor.isCanceled() && (line = br.readLine()) != null) {
                line = pRemoveEchap.matcher(line).replaceAll("");
                if (StringUtils.isNotBlank(line)) {
                    matcher.reset(line);
                    if (matcher.find()) {
                        if (lastProgress == 0) {
                            monitor.beginTask("Webpack in progress", 200);
                        }
                        int progress = Integer.parseInt(matcher.group(1));
                        int diff = progress - lastProgress;
                        lastProgress = progress;
                        monitor.subTask(matcher.group(2));
                        monitor.worked(diff);
                        if (progress == 100) {
                            lastProgress = 0;
                            monitor.beginTask("Build almost finish", 200);
                        }
                    } else {
                        monitor.worked(1);
                    }
                    Engine.logStudio.debug(line);
                    if (line.contains("- Hash:")) {
                        Engine.logStudio.debug("Build " + buildMode.label() + " finished for " + appName);
                        if (buildMode == NgxBuilderBuildMode.watch) {
                            monitor.beginTask("Build finished, waiting for changes or build cancel", 200);
                        }
                    }
                }
            }
            buildItem.getDisplay().asyncExec(() -> {
                if (!buildItem.isDisposed()) {
                    buildItem.setSelection(false);
                }
            });
            monitor.done();
            terminateNode(true);
        } catch (Exception e) {
            Engine.logStudio.error("Failed to process the build: " + e.getMessage(), e);
        }
        terminated[0] = true;
    });
    prodJob.schedule();
}
Also used : Element(com.teamdev.jxbrowser.dom.Element) CoreException(org.eclipse.core.runtime.CoreException) FocusEvent(org.eclipse.swt.events.FocusEvent) ApplicationComponent(com.twinsoft.convertigo.beans.ngx.components.ApplicationComponent) StringUtils(org.apache.commons.lang3.StringUtils) Point(org.eclipse.swt.graphics.Point) UISharedComponent(com.twinsoft.convertigo.beans.ngx.components.UISharedComponent) Matcher(java.util.regex.Matcher) Composite(org.eclipse.swt.widgets.Composite) PartInitException(org.eclipse.ui.PartInitException) KeyEvent(org.eclipse.swt.events.KeyEvent) PageComponent(com.twinsoft.convertigo.beans.ngx.components.PageComponent) MessageDialog(org.eclipse.jface.dialogs.MessageDialog) KeyAdapter(org.eclipse.swt.events.KeyAdapter) IEditorPart(org.eclipse.ui.IEditorPart) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Text(org.eclipse.swt.widgets.Text) IEditorInput(org.eclipse.ui.IEditorInput) PlatformUI(org.eclipse.ui.PlatformUI) Set(java.util.Set) ToolItem(org.eclipse.swt.widgets.ToolItem) IOUtils(org.apache.commons.io.IOUtils) MenuItem(org.eclipse.swt.widgets.MenuItem) SWT(org.eclipse.swt.SWT) JsAccessible(com.teamdev.jxbrowser.js.JsAccessible) EditorPart(org.eclipse.ui.part.EditorPart) SwtUtils(com.twinsoft.convertigo.eclipse.swt.SwtUtils) DatabaseObjectFoundException(com.twinsoft.convertigo.engine.DatabaseObjectFoundException) SelectionListener(org.eclipse.swt.events.SelectionListener) UIControlEvent(com.twinsoft.convertigo.beans.ngx.components.UIControlEvent) MobileComponent(com.twinsoft.convertigo.beans.ngx.components.MobileComponent) JFaceResources(org.eclipse.jface.resource.JFaceResources) IEditorSite(org.eclipse.ui.IEditorSite) UIActionStack(com.twinsoft.convertigo.beans.ngx.components.UIActionStack) RequestPermissionCallback(com.teamdev.jxbrowser.permission.callback.RequestPermissionCallback) GridData(org.eclipse.swt.layout.GridData) RowData(org.eclipse.swt.layout.RowData) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) Engine(com.twinsoft.convertigo.engine.Engine) UIUseShared(com.twinsoft.convertigo.beans.ngx.components.UIUseShared) JSONObject(org.codehaus.jettison.json.JSONObject) JSONArray(org.codehaus.jettison.json.JSONArray) PaletteSource(com.twinsoft.convertigo.eclipse.dnd.PaletteSource) MobileDebugView(com.twinsoft.convertigo.eclipse.views.mobile.MobileDebugView) MobileBuilderBuildMode(com.twinsoft.convertigo.engine.enums.MobileBuilderBuildMode) NgxBuilderBuildMode(com.twinsoft.convertigo.engine.enums.NgxBuilderBuildMode) JsObject(com.teamdev.jxbrowser.js.JsObject) InputStreamReader(java.io.InputStreamReader) File(java.io.File) Node(com.teamdev.jxbrowser.dom.Node) Project(com.twinsoft.convertigo.beans.core.Project) JSONException(org.codehaus.jettison.json.JSONException) ModifyListener(org.eclipse.swt.events.ModifyListener) FileUtils(com.twinsoft.convertigo.engine.util.FileUtils) IEditorReference(org.eclipse.ui.IEditorReference) UIComponent(com.twinsoft.convertigo.beans.ngx.components.UIComponent) BufferedReader(java.io.BufferedReader) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ProcessUtils(com.twinsoft.convertigo.engine.util.ProcessUtils) GridLayout(org.eclipse.swt.layout.GridLayout) WalkHelper(com.twinsoft.convertigo.engine.helpers.WalkHelper) ClipboardAction(com.twinsoft.convertigo.eclipse.popup.actions.ClipboardAction) ToolBar(org.eclipse.swt.widgets.ToolBar) VerifyListener(org.eclipse.swt.events.VerifyListener) MobileEventListener(com.twinsoft.convertigo.engine.mobile.MobileEventListener) EnginePropertiesManager(com.twinsoft.convertigo.engine.EnginePropertiesManager) InjectJsCallback(com.teamdev.jxbrowser.browser.callback.InjectJsCallback) UIDynamicInvoke(com.twinsoft.convertigo.beans.ngx.components.UIDynamicInvoke) NetworkUtils(com.twinsoft.convertigo.engine.util.NetworkUtils) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Collection(java.util.Collection) UIDynamicAction(com.twinsoft.convertigo.beans.ngx.components.UIDynamicAction) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ConvertigoPlugin(com.twinsoft.convertigo.eclipse.ConvertigoPlugin) PropertyName(com.twinsoft.convertigo.engine.EnginePropertiesManager.PropertyName) List(java.util.List) Pattern(java.util.regex.Pattern) ShowContextMenuCallback(com.teamdev.jxbrowser.browser.callback.ShowContextMenuCallback) Label(org.eclipse.swt.widgets.Label) CompositeEvent(com.twinsoft.convertigo.eclipse.editors.CompositeEvent) Document(com.teamdev.jxbrowser.dom.Document) Image(org.eclipse.swt.graphics.Image) Rectangle(org.eclipse.swt.graphics.Rectangle) FocusListener(org.eclipse.swt.events.FocusListener) Event(org.eclipse.swt.widgets.Event) Frame(com.teamdev.jxbrowser.frame.Frame) MobileBuilder(com.twinsoft.convertigo.engine.mobile.MobileBuilder) HashSet(java.util.HashSet) PaletteSourceTransfer(com.twinsoft.convertigo.eclipse.dnd.PaletteSourceTransfer) BatchOperationHelper(com.twinsoft.convertigo.engine.helpers.BatchOperationHelper) Charset(java.nio.charset.Charset) UIDynamicElement(com.twinsoft.convertigo.beans.ngx.components.UIDynamicElement) Browser(com.teamdev.jxbrowser.browser.Browser) LinkedList(java.util.LinkedList) TreeParent(com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeParent) Response(com.teamdev.jxbrowser.browser.callback.InjectJsCallback.Response) Job(org.eclipse.core.runtime.jobs.Job) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) RowLayout(org.eclipse.swt.layout.RowLayout) IResource(org.eclipse.core.resources.IResource) NumberUtils(org.apache.commons.lang3.math.NumberUtils) KeyListener(org.eclipse.swt.events.KeyListener) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Menu(org.eclipse.swt.widgets.Menu) FocusAdapter(org.eclipse.swt.events.FocusAdapter) C8oBrowser(com.twinsoft.convertigo.eclipse.swt.C8oBrowser) Control(org.eclipse.swt.widgets.Control) InputStreamReader(java.io.InputStreamReader) Matcher(java.util.regex.Matcher) NgxBuilderBuildMode(com.twinsoft.convertigo.engine.enums.NgxBuilderBuildMode) CoreException(org.eclipse.core.runtime.CoreException) PartInitException(org.eclipse.ui.PartInitException) DatabaseObjectFoundException(com.twinsoft.convertigo.engine.DatabaseObjectFoundException) JSONException(org.codehaus.jettison.json.JSONException) MobileBuilder(com.twinsoft.convertigo.engine.mobile.MobileBuilder) BufferedReader(java.io.BufferedReader) List(java.util.List) LinkedList(java.util.LinkedList) File(java.io.File)

Example 10 with MobileBuilder

use of com.twinsoft.convertigo.engine.mobile.MobileBuilder in project convertigo by convertigo.

the class ApplicationComponentEditor method createToolbar.

private void createToolbar(Composite parent) {
    toolbar = new ToolBar(parent, SWT.VERTICAL);
    GridData gd = new GridData(GridData.FILL, GridData.FILL, false, true);
    gd.verticalSpan = 2;
    gd.verticalIndent = 4;
    toolbar.setLayoutData(gd);
    ToolItem item = new ToolItem(toolbar, SWT.DROP_DOWN);
    item.setToolTipText("Select device viewport. Click to toggle the custom device bar.");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/com/twinsoft/convertigo/beans/core/images/mobiledevice_color_16x16.png")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            if (e.detail == SWT.ARROW) {
                ToolItem item = (ToolItem) e.widget;
                Rectangle rect = item.getBounds();
                Point pt = item.getParent().toDisplay(new Point(rect.x + 8, rect.y + 8));
                devicesMenu.setLocation(pt);
                devicesMenu.setVisible(true);
            } else {
                setDeviceBarVisible(!deviceBar.getVisible());
            }
        }
    });
    new ToolItem(toolbar, SWT.SEPARATOR);
    item = new ToolItem(toolbar, SWT.PUSH);
    item.setToolTipText("Change orientation");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/com/twinsoft/convertigo/beans/connectors/images/fullsyncconnector_color_16x16.png")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            String width = deviceWidth.getText();
            deviceWidth.setText(deviceHeight.getText());
            deviceHeight.setText(width);
            updateBrowserSize();
        }
    });
    new ToolItem(toolbar, SWT.SEPARATOR);
    item = new ToolItem(toolbar, SWT.PUSH);
    item.setToolTipText("Refresh");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/studio/refresh.gif")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            doReload();
        }
    });
    item = new ToolItem(toolbar, SWT.PUSH);
    item.setToolTipText("Back");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/studio/undo.gif")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            C8oBrowser.run(() -> {
                int index = c8oBrowser.getCurrentNavigationEntryIndex();
                if (index > 2) {
                    c8oBrowser.goBack();
                }
            });
        }
    });
    new ToolItem(toolbar, SWT.SEPARATOR);
    item = new ToolItem(toolbar, SWT.PUSH);
    item.setToolTipText("Remove highlight");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/studio/write_wait_zone.d.gif")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            exHighlightElement = null;
            exHighlightMobileComponent = null;
            C8oBrowser.run(() -> c8oBrowser.executeJavaScriptAndReturnValue("_c8o_remove_all_overlay()"));
        }
    });
    new ToolItem(toolbar, SWT.SEPARATOR);
    item = new ToolItem(toolbar, SWT.PUSH);
    item.setToolTipText("Show debug");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/studio/debug.gif")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            MobileDebugView view = ConvertigoPlugin.getDefault().getMobileDebugView(true);
            getSite().getPage().activate(view);
            view.onActivated(ApplicationComponentEditor.this);
        }
    });
    item = new ToolItem(toolbar, SWT.PUSH);
    item.setToolTipText("Open in default browser");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/com/twinsoft/convertigo/beans/statements/images/ContinueWithSiteClipperStatement_color_16x16.png")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            C8oBrowser.run(() -> {
                String url = headlessBuild ? getPageUrl() : c8oBrowser.getURL();
                if (url.startsWith("http")) {
                    org.eclipse.swt.program.Program.launch(url);
                }
            });
        }
    });
    item = new ToolItem(toolbar, SWT.CHECK);
    item.setToolTipText("Headless build");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/com/twinsoft/convertigo/beans/statements/images/invokebrowserjs_16x16.png")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            headlessBuild = ((ToolItem) e.widget).getSelection();
            try {
                JSONObject device = new JSONObject(FileUtils.readFileToString(devicePref, "UTF-8"));
                device.put("headlessBuild", headlessBuild);
                FileUtils.write(devicePref, device.toString(4), "UTF-8");
            } catch (Exception ex) {
            // TODO: handle exception
            }
            if (headlessBuild) {
                initLoader();
            }
            doLoad();
        }
    });
    item.setSelection(headlessBuild);
    final Menu mBuild = new Menu(toolbar);
    for (NgxBuilderBuildMode mode : NgxBuilderBuildMode.values()) {
        MenuItem menuItem = new MenuItem(mBuild, SWT.NONE);
        menuItem.setText(mode.label());
        menuItem.setToolTipText(mode.description());
        menuItem.setData(mode);
        menuItem.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream(mode.icon())));
        menuItem.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                buildItem.setSelection(true);
                buildMode = (NgxBuilderBuildMode) e.widget.getData();
                handleProdBuild();
            }
        });
    }
    buildItem = item = new ToolItem(toolbar, SWT.CHECK);
    item.setToolTipText("Build locally");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/studio/build_prod_b.png")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            boolean selected = ((ToolItem) e.widget).getSelection();
            if (!selected) {
                buildMode = null;
                handleProdBuild();
            } else {
                ToolItem item = (ToolItem) e.widget;
                Rectangle rect = item.getBounds();
                Point pt = item.getParent().toDisplay(new Point(rect.x, rect.y));
                mBuild.setLocation(pt);
                mBuild.setVisible(true);
                buildItem.setSelection(false);
            }
        }
    });
    new ToolItem(toolbar, SWT.SEPARATOR);
    item = new ToolItem(toolbar, SWT.CHECK);
    item.setToolTipText("Toggle auto build");
    item.setSelection(true);
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/studio/accumulate.gif")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            MobileBuilder mb = applicationEditorInput.application.getProject().getMobileBuilder();
            mb.setAutoBuild(((ToolItem) e.widget).getSelection());
        }
    });
    item = new ToolItem(toolbar, SWT.PUSH);
    item.setToolTipText("Manage modules");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/studio/show_blocks.gif")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            MessageDialog dialog = new MessageDialog(null, "Node_module Update / Reinstall", null, "This will update or reinstall all your project's node_module dependencies. Update when you just " + "added a new dependency to your ionicTpl/package.json file, or re-install if you want clean all your node_modules and do a fresh install (takes more time).", MessageDialog.QUESTION, new String[] { "Update", "Re-install", "Cancel" }, 0);
            int result = dialog.open();
            if (result < 2) {
                launchBuilder(true, result == 1);
            }
        }
    });
    // final ToolItem buildModeItem = item = new ToolItem(toolbar, SWT.DROP_DOWN);
    // final Menu buildModeMenu = new Menu(parent.getShell());
    // SelectionListener buildModeListener = new SelectionAdapter() {
    // 
    // @Override
    // public void widgetSelected(SelectionEvent e) {
    // dialogBuild(buildModeItem, (MenuItem) e.widget);
    // }
    // 
    // };
    // 
    // for (MobileBuilderBuildMode mode: MobileBuilderBuildMode.values()) {
    // MenuItem menuItem = new MenuItem(buildModeMenu, SWT.NONE);
    // menuItem.setText(mode.label());
    // menuItem.setToolTipText(mode.description());
    // menuItem.setData(mode);
    // menuItem.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream(mode.icon())));
    // menuItem.addSelectionListener(buildModeListener);
    // if (mode.equals(buildMode)) {
    // item.setImage(menuItem.getImage());
    // item.setToolTipText(mode.description());
    // }
    // }
    // 
    // item.addSelectionListener(new SelectionAdapter() {
    // 
    // @Override
    // public void widgetSelected(SelectionEvent e) {
    // if (e.detail == SWT.ARROW) {
    // ToolItem item = (ToolItem) e.widget;
    // Rectangle rect = item.getBounds();
    // Point pt = item.getParent().toDisplay(new Point(rect.x + 8, rect.y + 8));
    // buildModeMenu.setLocation(pt);
    // buildModeMenu.setVisible(true);
    // } else {
    // dialogBuild(buildMode);
    // }
    // }
    // 
    // });
    new ToolItem(toolbar, SWT.SEPARATOR);
    item = new ToolItem(toolbar, SWT.DROP_DOWN);
    item.setToolTipText("Select dataset");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/studio/cvs_show_history.gif")));
    SelectionListener selectionListener = new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            setDataset(((MenuItem) e.widget).getText());
        }
    };
    Image iDataset = new Image(parent.getDisplay(), getClass().getResourceAsStream("/studio/cvs_checkin.gif"));
    Image iDatasetSelected = new Image(parent.getDisplay(), getClass().getResourceAsStream("/studio/cvs_checkout.gif"));
    final Menu mDataset = new Menu(toolbar);
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            for (MenuItem item : mDataset.getItems()) {
                item.dispose();
            }
            MenuItem menuItem = new MenuItem(mDataset, SWT.NONE);
            menuItem.setText("none");
            for (String fDataset : datasetDir.list()) {
                Matcher m = pDatasetFile.matcher(fDataset);
                if (m.matches()) {
                    menuItem = new MenuItem(mDataset, SWT.NONE);
                    menuItem.setText(m.group(1));
                }
            }
            for (MenuItem item : mDataset.getItems()) {
                if (item.getText().equals(dataset)) {
                    item.setImage(iDatasetSelected);
                } else {
                    item.setImage(iDataset);
                }
                item.addSelectionListener(selectionListener);
            }
            ToolItem item = (ToolItem) e.widget;
            Rectangle rect = item.getBounds();
            Point pt = item.getParent().toDisplay(new Point(rect.x, rect.y));
            mDataset.setLocation(pt);
            mDataset.setVisible(true);
        }
    });
    item = new ToolItem(toolbar, SWT.PUSH);
    item.setToolTipText("Save dataset");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/studio/cvs_add.gif")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            String[] name = { dataset.equals("none") ? "" : dataset };
            String extra = "";
            int response;
            do {
                MessageDialog dialog = new MessageDialog(null, "Dataset name", null, "What is the name of the dataset ?" + extra, MessageDialog.QUESTION, 0, new String[] { "Save", "Cancel" }) {

                    @Override
                    protected Control createCustomArea(Composite parent) {
                        Text t = new Text(parent, SWT.NONE);
                        t.setLayoutData(new GridData(GridData.FILL_BOTH));
                        t.setText(name[0]);
                        t.addModifyListener(new ModifyListener() {

                            @Override
                            public void modifyText(ModifyEvent e) {
                                name[0] = t.getText();
                            }
                        });
                        return t;
                    }
                };
                response = dialog.open();
                extra = "";
                if (response == 0) {
                    if (StringUtils.isBlank(name[0])) {
                        extra = " (cannot be empty)";
                    } else if (name[0].equals("none")) {
                        extra = " (cannot override 'none')";
                    }
                }
            } while (!extra.isEmpty());
            if (response == 0) {
                C8oBrowser.run(() -> {
                    String value = c8oBrowser.executeJavaScriptAndReturnValue("sessionStorage._c8ocafsession_storage_data");
                    try {
                        FileUtils.write(new File(datasetDir, name[0] + ".json"), new JSONArray(value).toString(2), "UTF-8");
                        toast("Dataset '" + name[0] + "' saved !");
                        dataset = name[0];
                    } catch (Exception e1) {
                        toast("Dataset '" + name[0] + "' NOT saved ! " + e1.getMessage());
                    }
                });
            }
        }
    });
    item = new ToolItem(toolbar, SWT.PUSH);
    item.setToolTipText("Remove dataset");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/studio/cvs_delete.gif")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            if (!dataset.equals("none")) {
                boolean ok = MessageDialog.openQuestion(null, "Delete '" + dataset + "' ?", "You really want delete'" + dataset + "' ?");
                if (ok) {
                    new File(datasetDir, dataset + ".json").delete();
                    toast("Dataset '" + dataset + "' removed !");
                    setDataset("none");
                }
            } else {
                toast("No dataset selected !");
            }
        }
    });
    showGrids = item = new ToolItem(toolbar, SWT.CHECK);
    item.setToolTipText("Show all grids or current selected");
    item.setImage(new Image(parent.getDisplay(), getClass().getResourceAsStream("/studio/grid_color_16x16.png")));
    item.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            boolean showGrid = ((ToolItem) e.widget).getSelection();
            C8oBrowser.run(() -> c8oBrowser.executeJavaScriptAndReturnValue("_c8o_showGrids(" + (showGrid ? "true" : "false") + ")"));
        }
    });
}
Also used : ModifyListener(org.eclipse.swt.events.ModifyListener) Matcher(java.util.regex.Matcher) Rectangle(org.eclipse.swt.graphics.Rectangle) Image(org.eclipse.swt.graphics.Image) Control(org.eclipse.swt.widgets.Control) ModifyEvent(org.eclipse.swt.events.ModifyEvent) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Menu(org.eclipse.swt.widgets.Menu) MessageDialog(org.eclipse.jface.dialogs.MessageDialog) ToolItem(org.eclipse.swt.widgets.ToolItem) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) JSONArray(org.codehaus.jettison.json.JSONArray) MenuItem(org.eclipse.swt.widgets.MenuItem) Text(org.eclipse.swt.widgets.Text) Point(org.eclipse.swt.graphics.Point) NgxBuilderBuildMode(com.twinsoft.convertigo.engine.enums.NgxBuilderBuildMode) CoreException(org.eclipse.core.runtime.CoreException) PartInitException(org.eclipse.ui.PartInitException) DatabaseObjectFoundException(com.twinsoft.convertigo.engine.DatabaseObjectFoundException) JSONException(org.codehaus.jettison.json.JSONException) MobileDebugView(com.twinsoft.convertigo.eclipse.views.mobile.MobileDebugView) JSONObject(org.codehaus.jettison.json.JSONObject) MobileBuilder(com.twinsoft.convertigo.engine.mobile.MobileBuilder) ToolBar(org.eclipse.swt.widgets.ToolBar) GridData(org.eclipse.swt.layout.GridData) File(java.io.File) SelectionListener(org.eclipse.swt.events.SelectionListener)

Aggregations

MobileBuilder (com.twinsoft.convertigo.engine.mobile.MobileBuilder)16 IEditorInput (org.eclipse.ui.IEditorInput)10 IEditorPart (org.eclipse.ui.IEditorPart)8 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)7 CoreException (org.eclipse.core.runtime.CoreException)7 Text (org.eclipse.swt.widgets.Text)7 Project (com.twinsoft.convertigo.beans.core.Project)6 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)6 File (java.io.File)6 Matcher (java.util.regex.Matcher)6 JSONArray (org.codehaus.jettison.json.JSONArray)6 JSONException (org.codehaus.jettison.json.JSONException)6 Point (org.eclipse.swt.graphics.Point)6 Rectangle (org.eclipse.swt.graphics.Rectangle)6 Composite (org.eclipse.swt.widgets.Composite)6 Control (org.eclipse.swt.widgets.Control)6 MobileDebugView (com.twinsoft.convertigo.eclipse.views.mobile.MobileDebugView)5 DatabaseObjectFoundException (com.twinsoft.convertigo.engine.DatabaseObjectFoundException)5 MessageDialog (org.eclipse.jface.dialogs.MessageDialog)5 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)5