protected Viewer createMergeViewer(Composite parent, CompareConfiguration compareConfiguration) { compareConfiguration.setProperty(DefaultMergeEditor.PROVIDER, mergeEditorProvider); return new DefaultMergeViewer(parent, SWT.NULL, compareConfiguration, documentProvider, sourceViewerConfigurationProvider); }
private void updateStructure() { getCompareConfiguration().setProperty("ALL_STRUCTURE_REFRESH", null); //$NON-NLS-1$ }
private void updateStructure(char leg) { String key = null; switch (leg) { case ANCESTOR_CONTRIBUTOR: key = "ANCESTOR_STRUCTURE_REFRESH"; //$NON-NLS-1$ break; case LEFT_CONTRIBUTOR: key = "LEFT_STRUCTURE_REFRESH"; //$NON-NLS-1$ break; case RIGHT_CONTRIBUTOR: key = "RIGHT_STRUCTURE_REFRESH"; //$NON-NLS-1$ break; default: break; } Assert.isNotNull(key); getCompareConfiguration().setProperty(key, null); } }
private static CompareConfiguration createCompareConfiguration(ISynchronizePageConfiguration pageConfiguration) { CompareConfiguration compareConfiguration = new CompareConfiguration(); Object o = pageConfiguration.getProperty(IGNORE_WHITSPACE_PAGE_PROPERTY); if (o != null && (o.equals(Boolean.TRUE) || o.equals(Boolean.FALSE))) { compareConfiguration.setProperty(CompareConfiguration.IGNORE_WHITESPACE, o); } return compareConfiguration; }
public void propertyChange(PropertyChangeEvent event) { String key= event.getProperty(); if (key.equals(INITIALLY_SHOW_ANCESTOR_PANE)) { boolean b= fOverlayStore.getBoolean(INITIALLY_SHOW_ANCESTOR_PANE); if (fCompareConfiguration != null) { fCompareConfiguration.setProperty(INITIALLY_SHOW_ANCESTOR_PANE, new Boolean(b)); } } } };
private static CompareConfiguration createCompareConfiguration(ISynchronizePageConfiguration pageConfiguration) { CompareConfiguration compareConfiguration = new CompareConfiguration(); Object o = pageConfiguration.getProperty(IGNORE_WHITSPACE_PAGE_PROPERTY); if (o != null && (o.equals(Boolean.TRUE) || o.equals(Boolean.FALSE))) { compareConfiguration.setProperty(CompareConfiguration.IGNORE_WHITESPACE, o); } return compareConfiguration; }
@Override public void run() { boolean b= !Utilities.getBoolean(fCompareConfiguration, fPropertyKey, false); setChecked(b); if (fCompareConfiguration != null) fCompareConfiguration.setProperty(fPropertyKey, Boolean.valueOf(b)); }
public void run() { boolean b= !Utilities.getBoolean(fCompareConfiguration, fPropertyKey, false); setChecked(b); if (fCompareConfiguration != null) fCompareConfiguration.setProperty(fPropertyKey, new Boolean(b)); }
@Override public void run() { boolean b= !JavaCompareUtilities.getBoolean(fCompareConfiguration, fPropertyKey, false); setChecked(b); if (fCompareConfiguration != null) fCompareConfiguration.setProperty(fPropertyKey, Boolean.valueOf(b)); }
public void run() { boolean b= !JavaCompareUtilities.getBoolean(fCompareConfiguration, fPropertyKey, false); setChecked(b); if (fCompareConfiguration != null) fCompareConfiguration.setProperty(fPropertyKey, new Boolean(b)); }
@Override public void run() { boolean b= !JavaCompareUtilities.getBoolean(fCompareConfiguration, fPropertyKey, false); setChecked(b); if (fCompareConfiguration != null) fCompareConfiguration.setProperty(fPropertyKey, Boolean.valueOf(b)); }
@Override public void run() { // First make sure the ancestor is hidden if (!isIgnoreAncestor()) getCompareConfiguration().setProperty(ICompareUIConstants.PROP_ANCESTOR_VISIBLE, Boolean.FALSE); // Then set the property to ignore the ancestor getCompareConfiguration().setProperty(ICompareUIConstants.PROP_IGNORE_ANCESTOR, Boolean.valueOf(!isIgnoreAncestor())); Utilities.initToggleAction(this, getResourceBundle(), ignoreAncestorActionKey, isIgnoreAncestor()); } };
protected boolean isEnabled(ISelection selection) { if (fInput == null) { CompareConfiguration cc= new CompareConfiguration(); // buffered merge mode: don't ask for confirmation // when switching between modified resources cc.setProperty(CompareEditor.CONFIRM_SAVE_PROPERTY, new Boolean(false)); // uncomment following line to have separate outline view //cc.setProperty(CompareConfiguration.USE_OUTLINE_VIEW, new Boolean(true)); fInput= new ResourceCompareInput(cc); } return fInput.isEnabled(selection); }
void setProperty(boolean state) { if (fCompareConfiguration != null) { Map filters = new HashMap(); if (fCompareConfiguration.getProperty(COMPARE_FILTERS) != null) { filters.putAll((Map) fCompareConfiguration .getProperty(COMPARE_FILTERS)); } if (state) { filters.put(fCompareFilterDescriptor.getFilterId(), fCompareFilter); } else { filters.remove(fCompareFilterDescriptor.getFilterId()); } fCompareConfiguration.setProperty(COMPARE_FILTERS, filters); } }
private void setAncestorVisibility(boolean visible, boolean enabled) { if (fAncestorItem != null) { Action action= (Action) fAncestorItem.getAction(); if (action != null) { action.setChecked(visible); action.setEnabled(enabled); } } getCompareConfiguration().setProperty(ICompareUIConstants.PROP_ANCESTOR_VISIBLE, Boolean.valueOf(visible)); }
private void setAncestorVisibility(boolean visible, boolean enabled) { if (fAncestorItem != null) { Action action= (Action) fAncestorItem.getAction(); if (action != null) { action.setChecked(visible); action.setEnabled(enabled); } } getCompareConfiguration().setProperty(ICompareUIConstants.PROP_ANCESTOR_VISIBLE, new Boolean(visible)); }
@Override protected boolean isEnabled(ISelection selection) { if (fInput == null) { CompareConfiguration cc= new CompareConfiguration(); // buffered merge mode: don't ask for confirmation // when switching between modified resources cc.setProperty(CompareEditor.CONFIRM_SAVE_PROPERTY, Boolean.FALSE); // uncomment following line to have separate outline view //cc.setProperty(CompareConfiguration.USE_OUTLINE_VIEW, Boolean.TRUE); fInput= new ResourceCompareInput(cc); } return fInput.isEnabled(selection); }
/* package */ void internalCompareAsText(Object input) { Set set = (Set)getCompareConfiguration().getProperty(ICompareAsText.PROP_TEXT_INPUTS); if (set == null) { set = new HashSet(); getCompareConfiguration().setProperty(ICompareAsText.PROP_TEXT_INPUTS, set); } set.add(input); if (fContentInputPane.getInput().equals(input)) { // We need to null the input and then reset it so we get the text merge viewer fContentInputPane.setInput(null); fContentInputPane.setInput(input); } }
public ComparePreferencePage() { setPreferenceStore(CompareUIPlugin.getDefault().getPreferenceStore()); fOverlayStore= new OverlayPreferenceStore(getPreferenceStore(), fKeys); fPreferenceChangeListener= event -> { String key= event.getProperty(); if (key.equals(INITIALLY_SHOW_ANCESTOR_PANE)) { boolean b= fOverlayStore.getBoolean(INITIALLY_SHOW_ANCESTOR_PANE); if (fCompareConfiguration != null) { fCompareConfiguration.setProperty(INITIALLY_SHOW_ANCESTOR_PANE, Boolean.valueOf(b)); } } }; fOverlayStore.addPropertyChangeListener(fPreferenceChangeListener); }
private Control createPreviewer(Composite parent) { final CompareConfiguration compareConfiguration = new CompareConfiguration(); compareConfiguration.setLeftLabel(ResourceUtil.getString("CompareResultDialog.expectedLabel")); //$NON-NLS-1$ compareConfiguration.setLeftEditable(false); compareConfiguration.setRightLabel(ResourceUtil.getString("CompareResultDialog.actualLabel")); //$NON-NLS-1$ compareConfiguration.setRightEditable(false); compareConfiguration.setProperty(CompareConfiguration.IGNORE_WHITESPACE, Boolean.FALSE); fViewer = new CompareResultMergeViewer(parent, SWT.NONE, compareConfiguration); fViewer.setInput(new DiffNode(new CompareElement(fExpected), new CompareElement(fActual))); Control control = fViewer.getControl(); control.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { if(compareConfiguration != null) { compareConfiguration.dispose(); } } }); return control; }