Skip to content

Commit

Permalink
Use a NonNotifyingCompoundCommand and set selection to empty when del…
Browse files Browse the repository at this point in the history
…eting

- A NonNotifyingCompoundCommand is faster for the Models Tree if there are lots of property deletions (but doesn't affect the Properties section)

- Deselect all table items when deleting
  • Loading branch information
Phillipus committed Dec 6, 2024
1 parent dcda0a5 commit fbfc2c2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.jface.viewers.TableViewerEditor;
Expand All @@ -64,6 +65,7 @@
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;

import com.archimatetool.editor.model.commands.NonNotifyingCompoundCommand;
import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.editor.ui.UIUtils;
import com.archimatetool.editor.ui.components.ExtendedTitleAreaDialog;
Expand Down Expand Up @@ -334,6 +336,7 @@ private void deleteSelectedPropertyKeys() {
}

fTableViewer.setInput(fKeysMap);
fTableViewer.setSelection(StructuredSelection.EMPTY);
getButton(IDialogConstants.OK_ID).setEnabled(true);
}

Expand Down Expand Up @@ -365,7 +368,7 @@ private void getAllUniquePropertyKeysForModel() {
protected void okPressed() {
super.okPressed();

CompoundCommand compoundCmd = new CompoundCommand(Messages.UserPropertiesManagerDialog_11) {
CompoundCommand compoundCmd = new NonNotifyingCompoundCommand(Messages.UserPropertiesManagerDialog_11) {
@Override
public void execute() {
BusyIndicator.showWhile(null, new Runnable() {
Expand Down

0 comments on commit fbfc2c2

Please sign in to comment.