Search in sources :

Example 11 with IPropertyChangeListener

use of org.eclipse.jface.util.IPropertyChangeListener in project mylyn.docs by eclipse.

the class PreferenceStoreFacade method firePropertyChangeEvent.

public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) {
    if (listeners.isEmpty()) {
        return;
    }
    // always get the new value again in case the get methods have been overridden
    if (newValue instanceof Boolean) {
        newValue = getBoolean(name);
    } else if (newValue instanceof Integer) {
        newValue = getInt(name);
    } else if (newValue instanceof Long) {
        newValue = getLong(name);
    } else if (newValue instanceof Double) {
        newValue = getDouble(name);
    } else if (newValue instanceof Float) {
        newValue = getFloat(name);
    } else if (newValue instanceof String) {
        newValue = getString(name);
    }
    if (newValue == oldValue || (newValue != null && newValue.equals(oldValue))) {
        return;
    }
    PropertyChangeEvent event = new PropertyChangeEvent(this, name, oldValue, newValue);
    for (Object o : listeners.getListeners()) {
        IPropertyChangeListener listener = (IPropertyChangeListener) o;
        listener.propertyChange(event);
    }
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent)

Example 12 with IPropertyChangeListener

use of org.eclipse.jface.util.IPropertyChangeListener in project egit by eclipse.

the class GitModelSynchronizeParticipant method initializeConfiguration.

@Override
protected void initializeConfiguration(final ISynchronizePageConfiguration configuration) {
    configuration.setProperty(ISynchronizePageConfiguration.P_VIEWER_ID, VIEWER_ID);
    String modelProvider = WORKSPACE_MODEL_PROVIDER_ID;
    final IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
    if (!gsds.containsFolderLevelSynchronizationRequest()) {
        if (preferenceStore.getBoolean(UIPreferences.SYNC_VIEW_ALWAYS_SHOW_CHANGESET_MODEL)) {
            modelProvider = GitChangeSetModelProvider.ID;
        } else {
            String lastSelectedModel = preferenceStore.getString(UIPreferences.SYNC_VIEW_LAST_SELECTED_MODEL);
            if (// $NON-NLS-1$
            !"".equals(lastSelectedModel))
                modelProvider = lastSelectedModel;
        }
    }
    configuration.setProperty(ModelSynchronizeParticipant.P_VISIBLE_MODEL_PROVIDER, modelProvider);
    configuration.setProperty(SYNCHRONIZATION_DATA, gsds);
    super.initializeConfiguration(configuration);
    configuration.addActionContribution(new GitActionContributor());
    configuration.addPropertyChangeListener(new IPropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent event) {
            String property = event.getProperty();
            if (property.equals(ModelSynchronizeParticipant.P_VISIBLE_MODEL_PROVIDER)) {
                String newValue = (String) event.getNewValue();
                preferenceStore.setValue(UIPreferences.SYNC_VIEW_LAST_SELECTED_MODEL, newValue);
            } else if (property.equals(P_NAVIGATOR)) {
                Object oldNavigator = configuration.getProperty(P_NAVIGATOR);
                if (!(oldNavigator instanceof GitTreeCompareNavigator))
                    configuration.setProperty(P_NAVIGATOR, new GitTreeCompareNavigator((CompareNavigator) oldNavigator));
            }
        }
    });
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore)

Example 13 with IPropertyChangeListener

use of org.eclipse.jface.util.IPropertyChangeListener in project egit by eclipse.

the class CommitEditorPage method createUserArea.

private Composite createUserArea(Composite parent, FormToolkit toolkit, PersonIdent person, boolean author) {
    Composite userArea = toolkit.createComposite(parent);
    GridLayoutFactory.fillDefaults().spacing(2, 2).numColumns(3).applyTo(userArea);
    Label userLabel = toolkit.createLabel(userArea, null);
    userLabel.setImage(getImage(author ? UIIcons.ELCL16_AUTHOR : UIIcons.ELCL16_COMMITTER));
    if (author)
        userLabel.setToolTipText(UIText.CommitEditorPage_TooltipAuthor);
    else
        userLabel.setToolTipText(UIText.CommitEditorPage_TooltipCommitter);
    boolean signedOff = isSignedOffBy(person);
    final Text userText = new Text(userArea, SWT.FLAT | SWT.READ_ONLY);
    addToFocusTracking(userText);
    setPerson(userText, person, author);
    toolkit.adapt(userText, false, false);
    userText.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
    IPropertyChangeListener uiPrefsListener = (event) -> {
        String property = event.getProperty();
        if (UIPreferences.DATE_FORMAT.equals(property) || UIPreferences.DATE_FORMAT_CHOICE.equals(property)) {
            setPerson(userText, person, author);
            userArea.layout();
        }
    };
    Activator.getDefault().getPreferenceStore().addPropertyChangeListener(uiPrefsListener);
    userText.addDisposeListener((e) -> {
        Activator.getDefault().getPreferenceStore().removePropertyChangeListener(uiPrefsListener);
    });
    GridDataFactory.fillDefaults().span(signedOff ? 1 : 2, 1).applyTo(userText);
    if (signedOff) {
        Label signedOffLabel = toolkit.createLabel(userArea, null);
        signedOffLabel.setImage(getImage(UIIcons.SIGNED_OFF));
        if (author)
            signedOffLabel.setToolTipText(UIText.CommitEditorPage_TooltipSignedOffByAuthor);
        else
            signedOffLabel.setToolTipText(UIText.CommitEditorPage_TooltipSignedOffByCommitter);
    }
    return userArea;
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) AdapterUtils(org.eclipse.egit.core.AdapterUtils) CLabel(org.eclipse.swt.custom.CLabel) DisposeEvent(org.eclipse.swt.events.DisposeEvent) TableViewer(org.eclipse.jface.viewers.TableViewer) UIPreferences(org.eclipse.egit.ui.UIPreferences) StyledText(org.eclipse.swt.custom.StyledText) FileDiff(org.eclipse.egit.ui.internal.history.FileDiff) DisposeListener(org.eclipse.swt.events.DisposeListener) Hyperlink(org.eclipse.ui.forms.widgets.Hyperlink) HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) Point(org.eclipse.swt.graphics.Point) RevWalk(org.eclipse.jgit.revwalk.RevWalk) IStatus(org.eclipse.core.runtime.IStatus) Composite(org.eclipse.swt.widgets.Composite) PartInitException(org.eclipse.ui.PartInitException) Map(java.util.Map) PreferenceBasedDateFormatter(org.eclipse.egit.ui.internal.PreferenceBasedDateFormatter) ViewerComparator(org.eclipse.jface.viewers.ViewerComparator) IAdaptable(org.eclipse.core.runtime.IAdaptable) ISchedulingRule(org.eclipse.core.runtime.jobs.ISchedulingRule) Text(org.eclipse.swt.widgets.Text) PlatformUI(org.eclipse.ui.PlatformUI) GitLabelProvider(org.eclipse.egit.ui.internal.GitLabelProvider) FormEditor(org.eclipse.ui.forms.editor.FormEditor) Status(org.eclipse.core.runtime.Status) Constants(org.eclipse.jgit.lib.Constants) GitDateFormatter(org.eclipse.jgit.util.GitDateFormatter) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) RevWalkUtils(org.eclipse.jgit.revwalk.RevWalkUtils) IManagedForm(org.eclipse.ui.forms.IManagedForm) GridLayoutFactory(org.eclipse.jface.layout.GridLayoutFactory) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) PersonIdent(org.eclipse.jgit.lib.PersonIdent) CommitFileDiffViewer(org.eclipse.egit.ui.internal.history.CommitFileDiffViewer) List(java.util.List) ExpansionAdapter(org.eclipse.ui.forms.events.ExpansionAdapter) UIText(org.eclipse.egit.ui.internal.UIText) IFormColors(org.eclipse.ui.forms.IFormColors) Ref(org.eclipse.jgit.lib.Ref) SWT(org.eclipse.swt.SWT) UIIcons(org.eclipse.egit.ui.internal.UIIcons) Label(org.eclipse.swt.widgets.Label) FormPage(org.eclipse.ui.forms.editor.FormPage) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) RevCommit(org.eclipse.jgit.revwalk.RevCommit) Activator(org.eclipse.egit.ui.Activator) Image(org.eclipse.swt.graphics.Image) HashMap(java.util.HashMap) JFaceResources(org.eclipse.jface.resource.JFaceResources) PlatformObject(org.eclipse.core.runtime.PlatformObject) MessageFormat(java.text.MessageFormat) ArrayList(java.util.ArrayList) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent) IShowInSource(org.eclipse.ui.part.IShowInSource) ShowInContext(org.eclipse.ui.part.ShowInContext) IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout) Section(org.eclipse.ui.forms.widgets.Section) SpellcheckableMessageArea(org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea) Job(org.eclipse.core.runtime.jobs.Job) GridDataFactory(org.eclipse.jface.layout.GridDataFactory) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) IOException(java.io.IOException) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) ObjectId(org.eclipse.jgit.lib.ObjectId) AbstractHyperlink(org.eclipse.ui.forms.widgets.AbstractHyperlink) ScrolledForm(org.eclipse.ui.forms.widgets.ScrolledForm) UIUtils(org.eclipse.egit.ui.UIUtils) NonNull(org.eclipse.jgit.annotations.NonNull) Platform(org.eclipse.core.runtime.Platform) LocalResourceManager(org.eclipse.jface.resource.LocalResourceManager) Comparator(java.util.Comparator) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter) Collections(java.util.Collections) Repository(org.eclipse.jgit.lib.Repository) Control(org.eclipse.swt.widgets.Control) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) CLabel(org.eclipse.swt.custom.CLabel) Label(org.eclipse.swt.widgets.Label) StyledText(org.eclipse.swt.custom.StyledText) Text(org.eclipse.swt.widgets.Text) UIText(org.eclipse.egit.ui.internal.UIText)

Example 14 with IPropertyChangeListener

use of org.eclipse.jface.util.IPropertyChangeListener in project egit by eclipse.

the class RebaseInteractiveView method createPartControl.

@Override
public void createPartControl(Composite parent) {
    GridLayoutFactory.fillDefaults().applyTo(parent);
    final FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    parent.addDisposeListener(new DisposeListener() {

        @Override
        public void widgetDisposed(DisposeEvent e) {
            toolkit.dispose();
        }
    });
    form = createForm(parent, toolkit);
    createCommandToolBar(form, toolkit);
    planTreeViewer = createPlanTreeViewer(form.getBody(), toolkit);
    planLayout = new PlanLayout();
    planTreeViewer.getTree().getParent().setLayout(planLayout);
    createColumns(planLayout);
    createStepActionToolBar(toolkit);
    createPopupMenu(planTreeViewer);
    setupListeners();
    createLocalDragandDrop();
    planTreeViewer.addDoubleClickListener(new IDoubleClickListener() {

        @Override
        public void doubleClick(DoubleClickEvent event) {
            PlanElement element = (PlanElement) ((IStructuredSelection) event.getSelection()).getFirstElement();
            if (element == null)
                return;
            RepositoryCommit commit = loadCommit(element.getCommit());
            if (commit != null)
                CommitEditor.openQuiet(commit);
        }

        private RepositoryCommit loadCommit(AbbreviatedObjectId abbreviatedObjectId) {
            if (abbreviatedObjectId != null) {
                try (RevWalk walk = new RevWalk(RebaseInteractiveView.this.currentRepository)) {
                    Collection<ObjectId> resolved = walk.getObjectReader().resolve(abbreviatedObjectId);
                    if (resolved.size() == 1) {
                        RevCommit commit = walk.parseCommit(resolved.iterator().next());
                        return new RepositoryCommit(RebaseInteractiveView.this.currentRepository, commit);
                    }
                } catch (IOException e) {
                    return null;
                }
            }
            return null;
        }
    });
    prefListener = new IPreferenceChangeListener() {

        @Override
        public void preferenceChange(PreferenceChangeEvent event) {
            if (!RepositoryUtil.PREFS_DIRECTORIES_REL.equals(event.getKey())) {
                return;
            }
            final Repository repo = currentRepository;
            if (repo == null)
                return;
            if (Activator.getDefault().getRepositoryUtil().contains(repo))
                return;
            // Unselect repository as it has been removed
            Display.getDefault().asyncExec(new Runnable() {

                @Override
                public void run() {
                    currentRepository = null;
                    showRepository(null);
                }
            });
        }
    };
    InstanceScope.INSTANCE.getNode(org.eclipse.egit.core.Activator.getPluginId()).addPreferenceChangeListener(prefListener);
    uiPrefsListener = new IPropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent event) {
            String property = event.getProperty();
            if (UIPreferences.DATE_FORMAT.equals(property) || UIPreferences.DATE_FORMAT_CHOICE.equals(property) || UIPreferences.RESOURCEHISTORY_SHOW_RELATIVE_DATE.equals(property)) {
                refresh();
            }
        }
    };
    Activator.getDefault().getPreferenceStore().addPropertyChangeListener(uiPrefsListener);
    IActionBars actionBars = getViewSite().getActionBars();
    IToolBarManager toolbar = actionBars.getToolBarManager();
    listenOnRepositoryViewSelection = RebaseInteractivePreferences.isReactOnSelection();
    // link with selection
    Action linkSelectionAction = new BooleanPrefAction((IPersistentPreferenceStore) Activator.getDefault().getPreferenceStore(), UIPreferences.REBASE_INTERACTIVE_SYNC_SELECTION, UIText.InteractiveRebaseView_LinkSelection) {

        @Override
        public void apply(boolean value) {
            listenOnRepositoryViewSelection = value;
        }
    };
    linkSelectionAction.setImageDescriptor(UIIcons.ELCL16_SYNCED);
    toolbar.add(linkSelectionAction);
    switchRepositoriesAction = new RepositoryToolbarAction(false, () -> currentRepository, repo -> setInput(new StructuredSelection(repo)));
    toolbar.add(switchRepositoriesAction);
    UIUtils.notifySelectionChangedWithCurrentSelection(selectionChangedListener, getSite());
    getSite().setSelectionProvider(new RepositorySelectionProvider(planTreeViewer, () -> currentRepository));
}
Also used : AdapterUtils(org.eclipse.egit.core.AdapterUtils) UIPreferences(org.eclipse.egit.ui.UIPreferences) IWorkbenchPartSite(org.eclipse.ui.IWorkbenchPartSite) DND(org.eclipse.swt.dnd.DND) CommitEditor(org.eclipse.egit.ui.internal.commit.CommitEditor) RepositoryState(org.eclipse.jgit.lib.RepositoryState) LocalSelectionTransfer(org.eclipse.jface.util.LocalSelectionTransfer) RevWalk(org.eclipse.jgit.revwalk.RevWalk) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent) ProcessStepsRebaseCommand(org.eclipse.egit.ui.internal.commands.shared.ProcessStepsRebaseCommand) Composite(org.eclipse.swt.widgets.Composite) PartInitException(org.eclipse.ui.PartInitException) PreferenceBasedDateFormatter(org.eclipse.egit.ui.internal.PreferenceBasedDateFormatter) KeyEvent(org.eclipse.swt.events.KeyEvent) KeyAdapter(org.eclipse.swt.events.KeyAdapter) IEditorPart(org.eclipse.ui.IEditorPart) AbortRebaseCommand(org.eclipse.egit.ui.internal.commands.shared.AbortRebaseCommand) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Separator(org.eclipse.jface.action.Separator) IEditorInput(org.eclipse.ui.IEditorInput) PlatformUI(org.eclipse.ui.PlatformUI) MenuManager(org.eclipse.jface.action.MenuManager) ToolItem(org.eclipse.swt.widgets.ToolItem) AbstractRebaseCommandHandler(org.eclipse.egit.ui.internal.commands.shared.AbstractRebaseCommandHandler) GridLayoutFactory(org.eclipse.jface.layout.GridLayoutFactory) Transfer(org.eclipse.swt.dnd.Transfer) InstanceScope(org.eclipse.core.runtime.preferences.InstanceScope) UIText(org.eclipse.egit.ui.internal.UIText) PreferenceChangeEvent(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent) SWT(org.eclipse.swt.SWT) BooleanPrefAction(org.eclipse.egit.ui.internal.actions.BooleanPrefAction) ElementType(org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.ElementType) RepositorySelectionProvider(org.eclipse.egit.ui.internal.selection.RepositorySelectionProvider) ViewPart(org.eclipse.ui.part.ViewPart) RevCommit(org.eclipse.jgit.revwalk.RevCommit) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) Format(org.eclipse.jgit.util.GitDateFormatter.Format) JFaceResources(org.eclipse.jface.resource.JFaceResources) RebaseInteractivePlan(org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) ArrayList(java.util.ArrayList) IFileEditorInput(org.eclipse.ui.IFileEditorInput) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) PlanElement(org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.PlanElement) IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) Font(org.eclipse.swt.graphics.Font) DoubleClickEvent(org.eclipse.jface.viewers.DoubleClickEvent) IPreferenceChangeListener(org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener) GridDataFactory(org.eclipse.jface.layout.GridDataFactory) IViewSite(org.eclipse.ui.IViewSite) IOException(java.io.IOException) ExecutionException(org.eclipse.core.commands.ExecutionException) IActionBars(org.eclipse.ui.IActionBars) CommonUtils(org.eclipse.egit.ui.internal.CommonUtils) Form(org.eclipse.ui.forms.widgets.Form) RepositoryToolbarAction(org.eclipse.egit.ui.internal.components.RepositoryMenuUtil.RepositoryToolbarAction) ToolTip(org.eclipse.jface.window.ToolTip) Repository(org.eclipse.jgit.lib.Repository) ElementAction(org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.ElementAction) DisposeEvent(org.eclipse.swt.events.DisposeEvent) DisposeListener(org.eclipse.swt.events.DisposeListener) IAction(org.eclipse.jface.action.IAction) ToolBar(org.eclipse.swt.widgets.ToolBar) IToolBarManager(org.eclipse.jface.action.IToolBarManager) SWTKeySupport(org.eclipse.jface.bindings.keys.SWTKeySupport) ColumnPixelData(org.eclipse.jface.viewers.ColumnPixelData) GC(org.eclipse.swt.graphics.GC) ISelectionListener(org.eclipse.ui.ISelectionListener) ColumnViewerToolTipSupport(org.eclipse.jface.viewers.ColumnViewerToolTipSupport) RepositoryCommit(org.eclipse.egit.ui.internal.commit.RepositoryCommit) IWorkbenchAction(org.eclipse.ui.actions.ActionFactory.IWorkbenchAction) TreeViewerColumn(org.eclipse.jface.viewers.TreeViewerColumn) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener) Collection(java.util.Collection) GitDateFormatter(org.eclipse.jgit.util.GitDateFormatter) Display(org.eclipse.swt.widgets.Display) ColumnLabelProvider(org.eclipse.jface.viewers.ColumnLabelProvider) AbbreviatedObjectId(org.eclipse.jgit.lib.AbbreviatedObjectId) List(java.util.List) Tree(org.eclipse.swt.widgets.Tree) ISelection(org.eclipse.jface.viewers.ISelection) TreeViewer(org.eclipse.jface.viewers.TreeViewer) UIIcons(org.eclipse.egit.ui.internal.UIIcons) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) ISelectionService(org.eclipse.ui.ISelectionService) RepositoryMapping(org.eclipse.egit.core.project.RepositoryMapping) RepositoryTreeNode(org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode) Activator(org.eclipse.egit.ui.Activator) Image(org.eclipse.swt.graphics.Image) RepositoryUtil(org.eclipse.egit.core.RepositoryUtil) IPersistentPreferenceStore(org.eclipse.jface.preference.IPersistentPreferenceStore) ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) ContinueRebaseCommand(org.eclipse.egit.ui.internal.commands.shared.ContinueRebaseCommand) IWorkbenchActionConstants(org.eclipse.ui.IWorkbenchActionConstants) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Action(org.eclipse.jface.action.Action) TreeItem(org.eclipse.swt.widgets.TreeItem) ObjectId(org.eclipse.jgit.lib.ObjectId) IResource(org.eclipse.core.resources.IResource) UIUtils(org.eclipse.egit.ui.UIUtils) TreeColumnLayout(org.eclipse.jface.layout.TreeColumnLayout) LocalResourceManager(org.eclipse.jface.resource.LocalResourceManager) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Menu(org.eclipse.swt.widgets.Menu) RepositoriesView(org.eclipse.egit.ui.internal.repository.RepositoriesView) Control(org.eclipse.swt.widgets.Control) SkipRebaseCommand(org.eclipse.egit.ui.internal.commands.shared.SkipRebaseCommand) DisposeListener(org.eclipse.swt.events.DisposeListener) BooleanPrefAction(org.eclipse.egit.ui.internal.actions.BooleanPrefAction) RepositoryToolbarAction(org.eclipse.egit.ui.internal.components.RepositoryMenuUtil.RepositoryToolbarAction) ElementAction(org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.ElementAction) IAction(org.eclipse.jface.action.IAction) IWorkbenchAction(org.eclipse.ui.actions.ActionFactory.IWorkbenchAction) Action(org.eclipse.jface.action.Action) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) RepositorySelectionProvider(org.eclipse.egit.ui.internal.selection.RepositorySelectionProvider) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) DisposeEvent(org.eclipse.swt.events.DisposeEvent) PlanElement(org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.PlanElement) AbbreviatedObjectId(org.eclipse.jgit.lib.AbbreviatedObjectId) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener) IActionBars(org.eclipse.ui.IActionBars) RevCommit(org.eclipse.jgit.revwalk.RevCommit) IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) RepositoryToolbarAction(org.eclipse.egit.ui.internal.components.RepositoryMenuUtil.RepositoryToolbarAction) PreferenceChangeEvent(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent) IPreferenceChangeListener(org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent) DoubleClickEvent(org.eclipse.jface.viewers.DoubleClickEvent) IOException(java.io.IOException) RevWalk(org.eclipse.jgit.revwalk.RevWalk) RepositoryCommit(org.eclipse.egit.ui.internal.commit.RepositoryCommit) Repository(org.eclipse.jgit.lib.Repository) IToolBarManager(org.eclipse.jface.action.IToolBarManager) Collection(java.util.Collection) BooleanPrefAction(org.eclipse.egit.ui.internal.actions.BooleanPrefAction)

Example 15 with IPropertyChangeListener

use of org.eclipse.jface.util.IPropertyChangeListener in project egit by eclipse.

the class CommittingPreferencePage method initialize.

@Override
protected void initialize() {
    super.initialize();
    useStagingView.setPropertyChangeListener(new IPropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent event) {
            if (FieldEditor.VALUE.equals(event.getProperty())) {
                autoStage.setEnabled(((Boolean) event.getNewValue()).booleanValue(), generalGroup);
            }
        }
    });
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent)

Aggregations

IPropertyChangeListener (org.eclipse.jface.util.IPropertyChangeListener)126 PropertyChangeEvent (org.eclipse.jface.util.PropertyChangeEvent)120 Composite (org.eclipse.swt.widgets.Composite)55 GridData (org.eclipse.swt.layout.GridData)44 Label (org.eclipse.swt.widgets.Label)39 GridLayout (org.eclipse.swt.layout.GridLayout)37 SelectionEvent (org.eclipse.swt.events.SelectionEvent)31 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)25 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)22 Button (org.eclipse.swt.widgets.Button)22 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)21 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)20 ColorSelector (org.eclipse.jface.preference.ColorSelector)14 ComboViewer (org.eclipse.jface.viewers.ComboViewer)12 Text (org.eclipse.swt.widgets.Text)11 Iterator (java.util.Iterator)10 ISelection (org.eclipse.jface.viewers.ISelection)10 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)10 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)9 SashForm (org.eclipse.swt.custom.SashForm)9