示例#1
0
 private File getHistoryFile() {
   String value =
       PrologConsolePlugin.getDefault()
           .getPreferenceValue(PDTConsole.PREF_CONSOLE_HISTORY_FILE, null);
   if (value == null) {
     throw new NullPointerException(
         "Required property \"" + PDTConsole.PREF_CONSOLE_HISTORY_FILE + "\" was not specified.");
   }
   return new File(value);
 }
示例#2
0
  private void createPartControl_impl(Composite parent) {

    this.partControl = parent;

    Listener handler =
        new Listener() {

          @Override
          public void handleEvent(Event event) {
            switch (event.type) {
              case SWT.Show:
              case SWT.Hide:
                getDefaultPrologConsoleService()
                    .fireConsoleVisibilityChanged(PrologConsoleView.this);
                break;
              case SWT.FocusOut:
                getDefaultPrologConsoleService().fireConsoleLostFocus(PrologConsoleView.this);
            }
          }
        };
    parent.getParent().addListener(SWT.Show, handler);
    parent.getParent().addListener(SWT.Hide, handler);
    parent.getParent().addListener(SWT.FocusOut, handler);
    PrologConsolePlugin.getDefault().getPrologConsoleService().registerPrologConsole(this);
    getDefaultPrologConsoleService().fireConsoleVisibilityChanged(PrologConsoleView.this);
    PrologRuntimeUIPlugin.getDefault()
        .getPrologInterfaceService()
        .registerActivePrologInterfaceListener(this);
    GridLayout layout = new GridLayout(1, true);
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    parent.setLayout(layout);
    GridData ld = new GridData(GridData.FILL_HORIZONTAL);
    title = new Label(parent, SWT.HORIZONTAL);
    title.setLayoutData(ld);
    viewer = new ConsoleViewer(parent, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
    viewer.getControl().setEnabled(false);
    ld = new GridData(GridData.FILL_BOTH);
    viewer.getControl().setLayoutData(ld);
    createActions();
    initMenus(parent);
    initToolBars();
    getSite().setSelectionProvider(viewer);
  }
示例#3
0
 @Override
 public void dispose() {
   PrologConsolePlugin.getDefault().getPrologConsoleService().unregisterPrologConsole(this);
   PrologRuntimeUIPlugin.getDefault()
       .getPrologInterfaceService()
       .unRegisterActivePrologInterfaceListener(this);
   for (Iterator<PrologInterface> it = models.keySet().iterator(); it.hasNext(); ) {
     PrologInterface pif = it.next();
     try {
       disconnect(pif);
       removeHooks(pif);
     } catch (Throwable e) {
       Debug.report(e);
     }
   }
   models.clear();
   contextMenu.dispose();
   // viewer.getControl().dispose();
   super.dispose();
 }
示例#4
0
 public PreferencePageMain() {
   super(GRID);
   setPreferenceStore(PrologConsolePlugin.getDefault().getPreferenceStore());
 }
示例#5
0
 private DefaultPrologConsoleService getDefaultPrologConsoleService() {
   return ((DefaultPrologConsoleService)
       PrologConsolePlugin.getDefault().getPrologConsoleService());
 }