Package de.innovationgate.eclipse.utils.wga

Examples of de.innovationgate.eclipse.utils.wga.WGADesignStructureHelper$CaseInsensitivSearcher


 
  public static boolean shouldBeValidated(IFile file) { 
    if (!WGADesignStructureHelper.isWGADesignResource(file)) {
      return false;
    } else {
      WGADesignStructureHelper helper = new WGADesignStructureHelper(file);
      if (helper.getFileContainerRoot().getLocation().isPrefixOf(file.getLocation())) {
        // only validate labelfiles in file containers
        if (!file.getFileExtension().equalsIgnoreCase("properties")) {
          return false;
        }       
      }
View Full Code Here


    }

    protected void handleBrowserLayout(Text textControl) {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(Display.getCurrent().getActiveShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
        IFile syncInfo = ((IFileEditorInput)getEditorInput()).getFile();
        WGADesignStructureHelper helper = new WGADesignStructureHelper(syncInfo);       
        dialog.setInput(helper.getTmlRoot());
        dialog.setAllowMultiple(false);
        dialog.setHelpAvailable(false);
        dialog.setTitle("TML layout selection");
        dialog.setValidator(new ISelectionStatusValidator() {
           
            public IStatus validate(Object[] selection) {
                if (selection != null && selection.length == 1) {
                    if (selection[0] instanceof IFile) {
                        return new Status(Status.OK, Plugin.PLUGIN_ID, ((IFile)selection[0]).getFullPath().toString());
                    }
                }
                return new Status(Status.ERROR, Plugin.PLUGIN_ID, "Please select a tml layout file.");
            }
        });
        // first try to find reference in medium "html" - otherwise check all available mediaKeys in design
        IFile preSelection = helper.findReferencedTMLModule(textControl.getText(), "html");
        if (preSelection == null) {
            for (String mediaKey : helper.getMediaKeys()) {
                preSelection = helper.findReferencedTMLModule(textControl.getText(), mediaKey);
                if (preSelection != null) {
                    break;
                }
            }
        }
        if (preSelection != null) {
            dialog.setInitialSelection(preSelection);
        }
        int result = dialog.open();
        if (result == Dialog.OK) {
            IFile selection = (IFile) dialog.getFirstResult();
            textControl.setText(helper.computeTMLReference(selection));
        }
    }
View Full Code Here

    try {
      IContainer designRoot = (IContainer) _designFolderSelectionPage.getSelectedResource();
      String outerLayoutName = _layoutPage.getOuterLayoutName();
      String innerLayoutName = _layoutPage.getInnerLayoutName();
     
      WGADesignStructureHelper helper = new WGADesignStructureHelper(designRoot);
      IFolder html = helper.getTmlRoot().getFolder("html");
      if (!html.exists()) {
        html.create(false, true, new NullProgressMonitor());
      }
     
      IFile outerLayoutFile = html.getFile(new Path(outerLayoutName + ".tml"));
View Full Code Here

  }

  public Set<String> getTMLpaths(IFile file, String medium) {
    Set<String> resources = new HashSet<String>();

    IContainer design = new WGADesignStructureHelper(file).getDesignRoot();
    if (design != null) {

      String expression = "SELECT * FROM references WHERE Project = ? AND FileType = ? AND Medium = ? AND Path Like ?";
      PreparedStatement st = null;
      ResultSet rs = null;
View Full Code Here

  }

  public Set<String> getMediumKeys(IFile file) {
    IProject project = file.getProject();
    Set<String> resources = new HashSet<String>();
    IContainer design = new WGADesignStructureHelper(file).getDesignRoot();
    String expression = "SELECT distinct Medium FROM references WHERE Project = ? AND Path Like ?";
   
    PreparedStatement st = null;
    ResultSet rs = null;
    try {
View Full Code Here

  public void resourceChanged(IResourceChangeEvent event) {
    try {
     
      final IFile fSyncInfo = ((IFileEditorInput)getEditorInput()).getFile();
      final IFile fCsConfig = new WGADesignStructureHelper(fSyncInfo).getCsConfig();
      IFile schema = null;
      if (fSyncInfo != null && fSyncInfo.exists()) {
          schema = fSyncInfo.getParent().getFolder(new Path("files").append("system")).getFile("schema.xml");
      }
      final IFile fSchema = schema;
View Full Code Here

  @Override
  public boolean performFinish() {
    if (_openDesignEditor) {
      try {
        IEditorPart editor = WorkbenchUtils.openEditor(Plugin.getDefault().getWorkbench(), new WGADesignStructureHelper(_designContainer).getSyncInfo(), WGADesignEditor.ID);
        if (editor instanceof WGADesignEditor) {
          ((WGADesignEditor) editor).setActivePage(ResourceIDs.EDITORPAGE_WGA_DESIGN_PLUGINCONFIGURATION);
        }
        return true;
      } catch (PartInitException e) {
View Full Code Here

    if (_designContainer == null) {
      MessageDialog.openInformation(getShell(), "Illegal selection.", "Please select an WGA design folder.");
      return;
    }
   
    _designHelper = new WGADesignStructureHelper(_designContainer);
    try {
      _model = _designHelper.createModel();
    } catch (IOException e) {
      WorkbenchUtils.showErrorDialog(getShell(), "Illegal selection", "Unable to create configuration model for design '" + _designContainer.getLocation() + "'.", e);
      return;
View Full Code Here

      designRoot = (IContainer)((DesignFolderSelectionPage)getPreviousPage()).getSelectedResource();
    }
    if (designRoot == null) {
      messages.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "No design folder selected."));
    } else {
      WGADesignStructureHelper helper = new WGADesignStructureHelper(designRoot);
      IFolder html = helper.getTmlRoot().getFolder("html");
      if (html.exists()) {
        IFile outerLayoutFile = html.getFile(new Path(getOuterLayoutName() + ".tml"));
        if (outerLayoutFile.exists()) {
          messages.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "A module with name '" + outerLayoutName + "' already exists in '" + outerLayoutFile.getParent().getFullPath().toString() + "'."));   
        }
View Full Code Here

      }
     
      if (bestContainer != null) {
        IFile syncInfo = WGADesignStructureHelper.determineSyncInfo(bestContainer);
        if (syncInfo != null) {
          WGADesignStructureHelper helper = new WGADesignStructureHelper(syncInfo);
          return new SingleStructuredSelection(helper.getDesignRoot());
        }
      }
    }
    return new SingleStructuredSelection(workspaceSelection.getProject());   
  }
View Full Code Here

TOP

Related Classes of de.innovationgate.eclipse.utils.wga.WGADesignStructureHelper$CaseInsensitivSearcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.