<commit_before>/****************************************************************************
 *                                                                          *
 * NOA (Nice Office Access)                                                 *
 * ------------------------------------------------------------------------ *
 *                                                                          *
 * The Contents of this file are made available subject to                  *
 * the terms of GNU Lesser General Public License Version 2.1.              *
 *                                                                          *
 * GNU Lesser General Public License Version 2.1                            *
 * ======================================================================== *
 * Copyright 2003-2006 by IOn AG                                            *
 *                                                                          *
 * This library is free software; you can redistribute it and/or            *
 * modify it under the terms of the GNU Lesser General Public               *
 * License version 2.1, as published by the Free Software Foundation.       *
 *                                                                          *
 * This library is distributed in the hope that it will be useful,          *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of           *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        *
 * Lesser General Public License for more details.                          *
 *                                                                          *
 * You should have received a copy of the GNU Lesser General Public         *
 * License along with this library; if not, write to the Free Software      *
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,                    *
 * MA  02111-1307  USA                                                      *
 *                                                                          *
 ****************************************************************************/

// based loosely on Snippet14.java

import java.lang.System;
import java.util.HashMap;
import java.util.concurrent.Future;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.internal.win32.OS;

import ag.ion.bion.officelayer.application.IOfficeApplication;
import ag.ion.bion.officelayer.application.OfficeApplicationException;
import ag.ion.bion.officelayer.application.OfficeApplicationRuntime;
import ag.ion.bion.officelayer.desktop.GlobalCommands;
import ag.ion.bion.officelayer.desktop.IFrame;
import ag.ion.bion.officelayer.document.DocumentDescriptor;
import ag.ion.bion.officelayer.document.IDocument;
import ag.ion.bion.officelayer.text.ITextDocument;
import ag.ion.noa.NOAException;

public class MainWindow extends ApplicationWindow {
    private IOfficeApplication officeApplication=null;
    private ITextDocument textDocument=null;
    private ExecutorService executor = Executors.newSingleThreadExecutor();

    public MainWindow(Shell arg0)
    {
        super(arg0);
    }

    // open a very bare-bones SWT application window
    public static void main(String[] args)
    {
        try
        {
            Shell shell = new Shell(Display.getCurrent(), SWT.SHELL_TRIM);
            MainWindow window =  new MainWindow(shell);
            window.setBlockOnOpen(true);
            window.open();
            Display.getCurrent().dispose();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    protected Point getInitialSize()
    {
        return new Point(500, 375);
    }

    private IFrame officeFrame=null;
    private IDocument document=null;

    /*
     * The path to the office application, in this case on a windows system.
     *
     * On a Linux system this would look like:
     * => private final static String officeHome = "/usr/lib64/libreoffce";
     */
    private final static String OFFICE_PATH = "C:\\Program Files\\LibreOffice 5";

    // and fill it with an embedded LibreOffice Writer<commit_msg>Update classname to match filename<commit_after>/****************************************************************************
 *                                                                          *
 * NOA (Nice Office Access)                                                 *
 * ------------------------------------------------------------------------ *
 *                                                                          *
 * The Contents of this file are made available subject to                  *
 * the terms of GNU Lesser General Public License Version 2.1.              *
 *                                                                          *
 * GNU Lesser General Public License Version 2.1                            *
 * ======================================================================== *
 * Copyright 2003-2006 by IOn AG                                            *
 *                                                                          *
 * This library is free software; you can redistribute it and/or            *
 * modify it under the terms of the GNU Lesser General Public               *
 * License version 2.1, as published by the Free Software Foundation.       *
 *                                                                          *
 * This library is distributed in the hope that it will be useful,          *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of           *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        *
 * Lesser General Public License for more details.                          *
 *                                                                          *
 * You should have received a copy of the GNU Lesser General Public         *
 * License along with this library; if not, write to the Free Software      *
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,                    *
 * MA  02111-1307  USA                                                      *
 *                                                                          *
 ****************************************************************************/

// based loosely on Snippet14.java

import java.lang.System;
import java.util.HashMap;
import java.util.concurrent.Future;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.internal.win32.OS;

import ag.ion.bion.officelayer.application.IOfficeApplication;
import ag.ion.bion.officelayer.application.OfficeApplicationException;
import ag.ion.bion.officelayer.application.OfficeApplicationRuntime;
import ag.ion.bion.officelayer.desktop.GlobalCommands;
import ag.ion.bion.officelayer.desktop.IFrame;
import ag.ion.bion.officelayer.document.DocumentDescriptor;
import ag.ion.bion.officelayer.document.IDocument;
import ag.ion.bion.officelayer.text.ITextDocument;
import ag.ion.noa.NOAException;

public class FrameWithSWT extends ApplicationWindow {
    private IOfficeApplication officeApplication=null;
    private ITextDocument textDocument=null;
    private ExecutorService executor = Executors.newSingleThreadExecutor();

    public FrameWithSWT(Shell arg0)
    {
        super(arg0);
    }

    // open a very bare-bones SWT application window
    public static void main(String[] args)
    {
        try
        {
            Shell shell = new Shell(Display.getCurrent(), SWT.SHELL_TRIM);
            FrameWithSWT window =  new FrameWithSWT(shell);
            window.setBlockOnOpen(true);
            window.open();
            Display.getCurrent().dispose();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    protected Point getInitialSize()
    {
        return new Point(500, 375);
    }

    private IFrame officeFrame=null;
    private IDocument document=null;

    /*
     * The path to the office application, in this case on a windows system.
     *
     * On a Linux system this would look like:
     * => private final static String officeHome = "/usr/lib64/libreoffce";
     */
    private final static String OFFICE_PATH = "C:\\Program Files\\LibreOffice 5";

    // and fill it with an embedded LibreOffice Writer
{'fraction_non_alphanumeric': 0.13322971022538027, 'fraction_numerical': 0.00954812923281892, 'mean_word_length': 1.6801547158583754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 54, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4985096', 'n_tokens_mistral': 2084, 'n_tokens_neox': 1943, 'n_words': 595}