/** * * @param event */ protected void firePageChanged( final PageChangedEvent event ) { Object[] listeners = pageChangedListeners.getListeners( ); for ( int i = 0; i < listeners.length; i++ ) { final IPageChangedListener l = (IPageChangedListener) listeners[i]; SafeRunnable.run( new SafeRunnable( ) { public void run( ) { l.pageChanged( event ); } } ); } }
/** * Notifies any selection changed listeners that the selected page has * changed. Only listeners registered at the time this method is called * are notified. * * @param event * a selection changed event * * @see IPageChangedListener#pageChanged * * @since 2.1 */ void firePageChanged( final PageChangedEvent event ) { Object[] listeners = pageChangedListeners.getListeners( ); for ( int i = 0; i < listeners.length; i++ ) { final IPageChangedListener l = (IPageChangedListener) listeners[i]; SafeRunnable.run( new SafeRunnable( ) { public void run( ) { l.pageChanged( event ); } } ); } }
@Override protected Object openDialogBox(Control cellEditorWindow) { this.setInjectModel((InjectModel) this.getValue()); CreateInjectWizard wizard = new CreateInjectWizard(this); final WizardDialog dialog = new WizardDialog(cellEditorWindow.getShell(), wizard); if (getInjectModel() != null) { final IPageChangedListener pageChangedListener = new IPageChangedListener() { @Override public void pageChanged(PageChangedEvent event) { if (event.getSelectedPage() instanceof CreateCTablePage) { ((CreateCTablePage) dialog.getCurrentPage()) .setData((InjectModel) getInjectModel()); dialog.removePageChangedListener(this); } } }; dialog.addPageChangedListener(pageChangedListener); } dialog.open(); return this.getInjectModel(); }
protected Object openDialogBox(Control cellEditorWindow) { this.setSqlAreaModel((TableSqlAreaModel) this.getValue()); CreateTableSqlWizard wizard = new CreateTableSqlWizard(this); final WizardDialog dialog = new WizardDialog(cellEditorWindow.getShell(), wizard); if (getSqlAreaModel() != null) { final IPageChangedListener pageChangedListener = new IPageChangedListener() { @Override public void pageChanged(PageChangedEvent event) { if (event.getSelectedPage() instanceof CreateTableSqlPageOne) { ((CreateTableSqlPageOne) dialog.getCurrentPage()) .setData((TableSqlAreaModel) getSqlAreaModel()); dialog.removePageChangedListener(this); } } }; dialog.addPageChangedListener(pageChangedListener); } dialog.open(); return this.getSqlAreaModel(); }
@Override protected Object openDialogBox(Control cellEditorWindow) { this.setSqlSet((SqlSet) this.getValue()); CreateChartSqlWizard wizard = new CreateChartSqlWizard(this); final WizardDialog dialog = new WizardDialog(cellEditorWindow.getShell(), wizard); if (getSqlSet() != null) { final IPageChangedListener pageChangedListener = new IPageChangedListener() { @Override public void pageChanged(PageChangedEvent event) { if (event.getSelectedPage() instanceof CreateSelectChartPage) { ((CreateSelectChartPage) dialog.getCurrentPage()).setData(getSqlSet()); dialog.removePageChangedListener(this); } } }; dialog.addPageChangedListener(pageChangedListener); } dialog.open(); return this.getSqlSet(); }
/** * Notifies any selection changed listeners that the selected page has * changed. Only listeners registered at the time this method is called are * notified. * * @param event * a selection changed event * * @see IPageChangedListener#pageChanged * * @since 3.1 */ protected void firePageChanged(final PageChangedEvent event) { Object[] listeners = pageChangedListeners.getListeners(); for (int i = 0; i < listeners.length; ++i) { final IPageChangedListener l = (IPageChangedListener) listeners[i]; SafeRunnable.run(new SafeRunnable() { public void run() { l.pageChanged(event); } }); } }
/** * Creates page 1 of the multi-page editor, which allows you to change the * font used in page 2. */ void createGraphicalEditor() { graphicalEditor = new GraphicalMulePropertiesEditor(); addPageChangedListener(new IPageChangedListener() { @Override public void pageChanged(PageChangedEvent event) { if (event.getSelectedPage().equals(textEditor) && graphicalEditor.isDirty()){ textEditor.getPropertiesDocument().set(graphicalEditor.getContent()); } else if(textEditor.isDirty()) { graphicalEditor.setContent(textEditor.getPropertiesDocument().get()); } } }); try { graphicalEditorIndex = addPage(graphicalEditor, getEditorInput()); setPageText(graphicalEditorIndex, graphicalEditor.getTitle()); } catch (PartInitException e) { e.printStackTrace(); } }
public void firePageChanged(final PageChangedEvent event) { Object[] listeners = pageChangeListeners.getListeners(); for (int i = 0; i < listeners.length; ++i) { final IPageChangedListener l = (IPageChangedListener) listeners[i]; SafeRunnable.run(new SafeRunnable() { public void run() { l.pageChanged(event); } }); } }
/** * Creates page 1 of the multi-page editor, which allows you to change the font used in page 2. */ void createPage0() throws PartInitException { reportContainer = new ReportContainer(this, jrContext); reportContainer.addPageChangedListener(new IPageChangedListener() { public void pageChanged(PageChangedEvent event) { updateContentOutline(getActivePage()); } }); int index = addPage(reportContainer, getEditorInput()); setPageText(index, Messages.JrxmlEditor_design); }
/** * Notifies any selection changed listeners that the selected page * has changed. * Only listeners registered at the time this method is called are notified. * * @param event a selection changed event * * @see IPageChangedListener#pageChanged * * @since 3.1 */ protected void firePageChanged(final PageChangedEvent event) { Object[] listeners = pageChangedListeners.getListeners(); for (int i = 0; i < listeners.length; i++) { final IPageChangedListener l = (IPageChangedListener) listeners[i]; SafeRunnable.run(new SafeRunnable() { public void run() { l.pageChanged(event); } }); } }
@Override public void performRequest(Request request) { if (request.getType().equals(RequestConstants.REQ_OPEN)) { SqlSet sqlSet = new SqlSet(); CreateChartSqlWizard wizard = new CreateChartSqlWizard(sqlSet); final WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard); if (((ChartBlockModel) this.getModel()).getSqlSet() != null) { final IPageChangedListener pageChangedListener = new IPageChangedListener() { @Override public void pageChanged(PageChangedEvent event) { if (event.getSelectedPage() instanceof CreateSelectChartPage) { ((CreateSelectChartPage) dialog.getCurrentPage()) .setData(((ChartBlockModel) getModel()).getSqlSet()); dialog.removePageChangedListener(this); } } }; dialog.addPageChangedListener(pageChangedListener); } dialog.open(); if (sqlSet.getChartType() != null && sqlSet.getSqls() != null) { ((ChartBlockModel) getModel()).setSqlSet(sqlSet); ((ChartBlockModel) getModel()).setChartType(sqlSet.getChartType().getName()); ((ChartBlockModel) getModel()).setChartTypeDisplayName(sqlSet.getChartType() .getDisplayName()); ((ChartBlockModel) getModel()).setBlockName(sqlSet.getName()); this.getRoot().getViewer().getEditDomain().getCommandStack().execute(new Command() { }); } } }
@Override public void init(IWorkbench targetWorkbench, IStructuredSelection currentSelection) { // this.selection = currentSelection; List<?> selectedResources = IDE.computeSelectedResources(currentSelection); List<IProject> workspaceProjects = Arrays.asList(ResourcesPlugin.getWorkspace().getRoot().getProjects()); // Find all selected projects Set<IProject> projects = selectedResources.stream() .filter(m -> m instanceof IResource) .map(m -> ((IResource) m).getProject()) .filter(p -> p.isOpen()) // only open projects .collect(Collectors.toSet()); // make the behavior predictable by ordering: TreeSet<IProject> sortedProjects = Sets .<IProject> newTreeSet((a, b) -> a.getName() .compareToIgnoreCase(b.getName())); sortedProjects.addAll(projects); // 0) turn into IN4JSProject and give and process further. // a) find out which projects fulfill the npm-"exportable"-contract // b) give back a list to the user what to export, // c) disable things not fullfilling the contract. // d) take choosing from the list and pass to exporter in non-ui package. // 0) List<IN4JSEclipseProject> rawN4jsProjects = Lists.newArrayList(); iP2in4jsP = HashBiMap.create(); for (IProject iProject : workspaceProjects) { IN4JSEclipseProject mappedIn4jsProject = map2In4js(iProject); if (mappedIn4jsProject != null) { rawN4jsProjects.add(mappedIn4jsProject); iP2in4jsP.put(iProject, mappedIn4jsProject); } } // filter out Non-N4JS-projects from initial selection. sortedProjects.retainAll(iP2in4jsP.keySet()); // filter out all non-N4JS-projects from the workspace projects. ArrayList<IProject> filteredWorkspaceProjects = new ArrayList<>(workspaceProjects); filteredWorkspaceProjects.retainAll(iP2in4jsP.keySet()); setWindowTitle("N4JS to npm Export"); setNeedsProgressMonitor(true); Map<IProject, Boolean> selectedProjects = new HashMap<>(); // Add all workspace projects to list, default selection value is false filteredWorkspaceProjects.forEach(project -> selectedProjects.put(project, false)); // Override selection value for all initially selected projects sortedProjects.forEach(project -> selectedProjects.put(project, true)); // exportPage = new ExportSelectionPage("Export Page", rawN4jsProjects, labelProvider); exportPage = new ExportSelectionPage("Export Page", selectedProjects); if (runTools()) toolRunnerPage = new NpmToolRunnerPage("npm Execution Page"); comparePage = new PackageJsonComparePage("Compare package.json Page"); pageListener = new IPageChangedListener() { @Override public void pageChanged(PageChangedEvent event) { if (event.getSelectedPage() == comparePage) { udpatePackagJasonComparison(); } } }; }
public void addPageChangedListener(IPageChangedListener listener) { pageChangedListeners.add(listener); }
public void removePageChangedListener(IPageChangedListener listener) { pageChangedListeners.remove(listener); }
/** * @see org.eclipse.jface.dialogs.IPageChangeProvider#removePageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener) * @since 3.1 */ public void removePageChangedListener(IPageChangedListener listener) { pageChangedListeners.remove(listener); }
public void addPageChangedListener( IPageChangedListener listener ) { pageChangedListeners.add( listener ); }
public void removePageChangedListener( IPageChangedListener listener ) { pageChangedListeners.remove( listener ); }
@Override public void performRequest(Request request) { if (request.getType().equals(RequestConstants.REQ_OPEN)) { try { TableSqlAreaModel sqlArea = new TableSqlAreaModel(); CreateTableSqlWizard wizard = new CreateTableSqlWizard(sqlArea); final WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard); if (((TableModel) this.getModel()).getSqlAreaModel() != null) { final IPageChangedListener pageChangedListener = new IPageChangedListener() { @Override public void pageChanged(PageChangedEvent event) { if (event.getSelectedPage() instanceof CreateTableSqlPageOne) { ((CreateTableSqlPageOne) dialog.getCurrentPage()) .setData(((TableModel) getModel()).getSqlAreaModel()); dialog.removePageChangedListener(this); } } }; dialog.addPageChangedListener(pageChangedListener); } dialog.open(); if (sqlArea.getSqlName() != null && sqlArea.getSqlArea() != null && sqlArea.getCms() != null) { ((TableModel) getModel()).setSqlAreaModel(sqlArea); ((TableModel) getModel()).setSql(sqlArea.getSqlArea()); ((TableModel) getModel()).setSqlName(sqlArea.getSqlName()); ((TableModel) getModel()).removeAllColumn(); ((TableModel) getModel()).addAllColumn(sqlArea.getCms()); ((TableModel) getModel()).setBlockName(sqlArea.getSqlName()); this.getRoot().getViewer().getEditDomain().getCommandStack() .execute(new Command() { }); } } catch (Exception e) { e.printStackTrace(); } } }
/** * Add the page change listener to be notified when the page changes. The newly selected page will be the Object * returned from {@link #getSelectedPage()}. In the default case, this will be the active page Control, IEditorPart, * or <code>null</code>. * <p> * This method has no effect if the listener has already been added. * </p> * * @nooverride * * @since 3.5 */ public void addPageChangedListener(IPageChangedListener listener) { pageChangeListeners.add(listener); }
/** * Remove the page change listener. * <p> * This method has no effect if the listener is not in the list. * </p> * * @nooverride * * @since 3.5 */ public void removePageChangedListener(IPageChangedListener listener) { pageChangeListeners.remove(listener); }
/** * @see org.eclipse.jface.dialogs.IPageChangeProvider#addPageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener) * @since 3.1 */ public void addPageChangedListener(IPageChangedListener listener) { pageChangedListeners.add(listener); }