Examples of ILogResource


Examples of net.sf.logsaw.core.logresource.ILogResource

    noDefaultAndApplyButton();
   
    final Composite root = new Composite(parent, SWT.NONE);
    root.setLayout(new GridLayout(2, false));
   
    ILogResource log = (ILogResource) getElement().getAdapter(ILogResource.class);
   
    Label label = new Label(root, SWT.NONE);
    label.setText(Messages.ResourcePropertyPage_label_type);
   
    Text text = new Text(root, SWT.SINGLE);
    text.setBackground(root.getDisplay().getSystemColor(
        SWT.COLOR_WIDGET_BACKGROUND));
    text.setText(log.getFactory().getName());
   
    label = new Label(root, SWT.NONE);
    label.setText(Messages.ResourcePropertyPage_label_indexSize);
   
    text = new Text(root, SWT.SINGLE);
    text.setBackground(root.getDisplay().getSystemColor(
        SWT.COLOR_WIDGET_BACKGROUND));
    text.setText(IndexPlugin.getDefault().getIndexService().size(log));
   
    label = new Label(root, SWT.NONE);
    label.setText(Messages.ResourcePropertyPage_label_identifier);
   
    text = new Text(root, SWT.SINGLE);
    text.setBackground(root.getDisplay().getSystemColor(
        SWT.COLOR_WIDGET_BACKGROUND));
    text.setText(log.getPK());
   
    // Spacer
    new Label(root, SWT.NONE);
   
    final IConfigurableObject co = (IConfigurableObject) log.getAdapter(IConfigurableObject.class);
    if (co != null) {
      List<IConfigOption<?>> options = co.getAllConfigOptions();
      if (!options.isEmpty()) {
        final Group group = new Group(root, SWT.NONE);
        group.setText(Messages.ResourcePropertyPage_label_config);
View Full Code Here

Examples of net.sf.logsaw.core.logresource.ILogResource

     
      // Collect for multi status
      List<IStatus> statuses = new ArrayList<IStatus>();
      Iterator it = ((IStructuredSelection) selection).iterator();
      while (it.hasNext()) {
        ILogResource log = (ILogResource) it.next();
        if (UIPlugin.getDefault().getLogResourceManager().isJobInProgress(log)) {
          // Log index is in use
          statuses.add(new Status(IStatus.INFO, UIPlugin.PLUGIN_ID,
              NLS.bind(Messages.Generic_info_jobInProgress, log.getName())));
          continue;
        }
       
        // Close editors
        IEditorReference[] editorRefs = page.findEditors(
            (IEditorInput) log.getAdapter(IEditorInput.class),
            null, IWorkbenchPage.MATCH_INPUT);
        page.closeEditors(editorRefs, false);
       
        try {
          UIPlugin.getDefault().getLogResourceManager().remove(log);
View Full Code Here

Examples of net.sf.logsaw.core.logresource.ILogResource

     
      // Collect for multi status
      List<IStatus> statuses = new ArrayList<IStatus>();
      Iterator it = ((IStructuredSelection) selection).iterator();
      while (it.hasNext()) {
        ILogResource log = (ILogResource) it.next();
        if (UIPlugin.getDefault().getLogResourceManager().isJobInProgress(log)) {
          // Log index is in use
          statuses.add(new Status(IStatus.INFO, UIPlugin.PLUGIN_ID,
              NLS.bind(Messages.Generic_info_jobInProgress, log.getName())));
          continue;
        }
       
        try {
          IndexPlugin.getDefault().getIndexService().truncate(log);
         
          IEditorReference[] editorRefs = page.findEditors(
              (IEditorInput) log.getAdapter(IEditorInput.class),
              null, IWorkbenchPage.MATCH_INPUT);
          for (IEditorReference editorRef : editorRefs) {
            // Refresh editor
            IEditorPart editorPart = editorRef.getEditor(false);
            ILogViewEditor editor = editorPart != null ?
View Full Code Here

Examples of net.sf.logsaw.core.logresource.ILogResource

    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
    IWorkbenchPage page = window.getActivePage();
    ILogViewEditor editor =
      (ILogViewEditor) page.getActiveEditor().getAdapter(ILogViewEditor.class);
    if (editor != null) {
      ILogResource log = editor.getLogResource();
      IRestrictable rest = editor.getRestrictable();
      List<ARestriction<?>> list = rest.getRestrictions();
      // Add restriction provided by Quick Filter
      boolean added = addNewRestriction(list, event, log);
     
View Full Code Here

Examples of net.sf.logsaw.core.logresource.ILogResource

    if ((selection != null) && (selection instanceof IStructuredSelection)) {
      // Collect for multi status
      List<IStatus> statuses = new ArrayList<IStatus>();
      Iterator it = ((IStructuredSelection) selection).iterator();
      while (it.hasNext()) {
        ILogResource log = (ILogResource) it.next();
        if (UIPlugin.getDefault().getLogResourceManager().isJobInProgress(log)) {
          // Log index is in use
          statuses.add(new Status(IStatus.INFO, UIPlugin.PLUGIN_ID,
              NLS.bind(Messages.Generic_info_jobInProgress, log.getName())));
          continue;
        }
       
        try {
          doSynchronize(log);
View Full Code Here

Examples of net.sf.logsaw.core.logresource.ILogResource

  /* (non-Javadoc)
   * @see net.sf.logsaw.core.logresource.ILogResourceFactory#createLogResource()
   */
  @Override
  public final ILogResource createLogResource() {
    ILogResource log = doCreateLogResource();
    Assert.isNotNull(log, "log");
    log.setFactory(this);
    return log;
  }
View Full Code Here

Examples of net.sf.logsaw.core.logresource.ILogResource

        moveDownButton.setEnabled(moveDown);
      }
    });
   
    // Setup data binding
    ILogResource log = (ILogResource) getElement().getAdapter(ILogResource.class);
    model = new WritableList(log.getDialect().getFieldProvider().getAllFields(), ALogEntryField.class);
    ViewerSupport.bind(tableViewer, model,
        PojoProperties.values(new String[] {"label"})); //$NON-NLS-1$
   
    Composite buttonArea = new Composite(root, SWT.NONE);
    buttonArea.setLayout(new GridLayout());
View Full Code Here

Examples of net.sf.logsaw.core.logresource.ILogResource

  /* (non-Javadoc)
   * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
   */
  @Override
  protected void performDefaults() {
    ILogResource log = (ILogResource) getElement().getAdapter(ILogResource.class);
    List<ALogEntryField<?, ?>> defaultFields = log.getDialect().getFieldProvider().getDefaultFields();
    sort(log, defaultFields);
    super.performDefaults();
  }
View Full Code Here

Examples of net.sf.logsaw.core.logresource.ILogResource

      tableViewer.setChecked(fld, false);
    }
  }

  private void loadOrderAndCheckState() {
    ILogResource log = (ILogResource) getElement().getAdapter(ILogResource.class);
    config = new LogViewEditorColumnConfiguration(log);
    sort(log, config.getFields());
  }
View Full Code Here

Examples of net.sf.logsaw.core.logresource.ILogResource

  public ILogResource createLogResource(File logFile, String encoding, Locale locale,
      TimeZone timeZone, ILogDialect dialect) {
    Assert.isNotNull(locale, "locale"); //$NON-NLS-1$
    Assert.isNotNull(logFile, "logFile"); //$NON-NLS-1$
    Assert.isNotNull(timeZone, "timeZone"); //$NON-NLS-1$
    ILogResource log = createLogResource();
    log.setName(logFile.getName());
    log.setDialect(dialect);
    try {
      log.configure(SimpleLogResource.OPTION_ENCODING, encoding);
      log.configure(SimpleLogResource.OPTION_LOCALE, LocaleUtils.getLocaleId(locale));
      log.configure(SimpleLogResource.OPTION_TIMEZONE, timeZone.getID());
      log.configure(OPTION_LOGFILE, logFile.getPath());
    } catch (CoreException e) {
      getLogger().error(e.getLocalizedMessage(), e);
    }
    return log;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.