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); }
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); }
@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(); }
public PreferencePageMain() { super(GRID); setPreferenceStore(PrologConsolePlugin.getDefault().getPreferenceStore()); }
private DefaultPrologConsoleService getDefaultPrologConsoleService() { return ((DefaultPrologConsoleService) PrologConsolePlugin.getDefault().getPrologConsoleService()); }