From db595d527426cbd3eee2bdc4c214bdd615dc0f0c Mon Sep 17 00:00:00 2001 From: Phillipus Date: Mon, 9 Dec 2024 14:58:21 +0000 Subject: [PATCH] 2 --- .../views/tree/search/SearchWidget.java | 14 +++++++++++++- .../UserPropertiesKeySelectionDialog.java | 19 ++++++++----------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/SearchWidget.java b/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/SearchWidget.java index 130f65caf..26c5c035b 100644 --- a/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/SearchWidget.java +++ b/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/SearchWidget.java @@ -49,6 +49,7 @@ import com.archimatetool.editor.ui.components.GlobalActionDisablementHandler; import com.archimatetool.editor.utils.PlatformUtils; import com.archimatetool.editor.utils.StringUtils; +import com.archimatetool.model.IArchimateFactory; import com.archimatetool.model.IArchimateModel; import com.archimatetool.model.IProfile; import com.archimatetool.model.IProfiles; @@ -141,6 +142,17 @@ public SearchWidget(TreeViewer viewer) { createToolBar(); createSearchTextWidget(); + + List list = new ArrayList<>(); + + if(IEditorModelManager.INSTANCE.getModels().get(0).getProperties().isEmpty()) { + char[] chars = "abcdefghijklmnopqrstuvwxyz".toCharArray(); + for(Integer index = 0; index < 1000000; index++) { + list.add(IArchimateFactory.eINSTANCE.createProperty(Character.toString(chars[index % 26]) + index, index.toString())); + } + + IEditorModelManager.INSTANCE.getModels().get(0).getProperties().addAll(list); + } } @Override @@ -424,7 +436,7 @@ public ImageDescriptor getImageDescriptor() { private List getAllUniquePropertyKeys() { // Maximum amount of items to display when getting all unique keys - final int MAX_ITEMS = 10000; + final int MAX_ITEMS = 1000000; Set set = new LinkedHashSet<>(); // LinkedHashSet is faster when sorting diff --git a/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/UserPropertiesKeySelectionDialog.java b/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/UserPropertiesKeySelectionDialog.java index c057bc10a..756a15129 100644 --- a/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/UserPropertiesKeySelectionDialog.java +++ b/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/UserPropertiesKeySelectionDialog.java @@ -7,6 +7,7 @@ import org.eclipse.jface.layout.TableColumnLayout; import org.eclipse.jface.viewers.CheckboxTableViewer; import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.ILazyContentProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.TableViewerColumn; @@ -24,6 +25,7 @@ import com.archimatetool.editor.ui.IArchiImages; import com.archimatetool.editor.ui.components.ExtendedTitleAreaDialog; +import com.archimatetool.model.IArchimateFactory; @@ -48,12 +50,14 @@ public class UserPropertiesKeySelectionDialog extends ExtendedTitleAreaDialog { * @param selected A list of property keys to select. Can be null. */ public UserPropertiesKeySelectionDialog(Shell parentShell, List keys, List selected) { - super(parentShell, "UserPropertiesSelectionDialog"); //$NON-NLS-1$ + super(parentShell, "UserPropertiesKeySelectionDialog"); //$NON-NLS-1$ setTitleImage(IArchiImages.ImageFactory.getImage(IArchiImages.ECLIPSE_IMAGE_IMPORT_PREF_WIZARD)); setShellStyle(getShellStyle() | SWT.RESIZE); this.keys = keys; selectedKeys = selected; + + System.out.println(keys.size()); } @Override @@ -94,7 +98,7 @@ protected Control createDialogArea(Composite parent) { return composite; } - private void createTableControl(Composite parent) { + protected void createTableControl(Composite parent) { Composite tableComp = new Composite(parent, SWT.BORDER); TableColumnLayout tableLayout = new TableColumnLayout(); tableComp.setLayout(tableLayout); @@ -135,7 +139,7 @@ public void dispose() { } } - private void createButtonPanel(Composite parent) { + protected void createButtonPanel(Composite parent) { Composite client = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); @@ -177,16 +181,9 @@ protected void buttonPressed(int buttonId) { public List getSelectedKeys() { return selectedKeys; } - - @Override - protected void okPressed() { - super.okPressed(); - - } - + @Override protected Point getDefaultDialogSize() { return new Point(400, 250); } - } \ No newline at end of file