Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillipus committed Dec 9, 2024
1 parent 6bfda22 commit 94d6efa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,12 @@ private String[] getAllUniquePropertyKeysForModel(int maxSize) {
IArchimateModel model = getArchimateModel();
Set<String> set = new LinkedHashSet<>(); // LinkedHashSet is faster when sorting

char[] chars = "abcdefghijklmnopqrstuvwxyz".toCharArray();

for(Integer index = 0; index < 50000; index++) {
model.getProperties().add(IArchimateFactory.eINSTANCE.createProperty(Character.toString(chars[index % 26]) + index, index.toString()));
}

for(Iterator<EObject> iter = model.eAllContents(); iter.hasNext();) {
EObject element = iter.next();
if(element instanceof IProperty p) {
Expand All @@ -548,7 +554,7 @@ private String[] getAllUniquePropertyKeysForModel(int maxSize) {
private String[] getAllUniquePropertyValuesForKeyForModel(String key, int maxSize) {
IArchimateModel model = getArchimateModel();
Set<String> set = new LinkedHashSet<>(); // LinkedHashSet is faster when sorting

for(Iterator<EObject> iter = model.eAllContents(); iter.hasNext();) {
EObject element = iter.next();
if(element instanceof IProperty p) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -423,12 +424,17 @@ public ImageDescriptor getImageDescriptor() {
}

private List<String> getAllUniquePropertyKeys() {
// Maximum amount of items to display when getting all unique keys
final int MAX_ITEMS = 10000;
final int MAX_ITEMS = 200000000;

Set<String> set = new LinkedHashSet<>(); // LinkedHashSet is faster when sorting

for(IArchimateModel model : IEditorModelManager.INSTANCE.getModels()) {
char[] chars = "abcdefghijklmnopqrstuvwxyz".toCharArray();

for(Integer index = 0; index < 50000; index++) {
model.getProperties().add(IArchimateFactory.eINSTANCE.createProperty(Character.toString(chars[index % 26]) + index, index.toString()));
}

for(Iterator<EObject> iter = model.eAllContents(); iter.hasNext();) {
EObject element = iter.next();
if(element instanceof IProperty property) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -48,7 +49,7 @@ public class UserPropertiesKeySelectionDialog extends ExtendedTitleAreaDialog {
* @param selected A list of property keys to select. Can be null.
*/
public UserPropertiesKeySelectionDialog(Shell parentShell, List<String> keys, List<String> 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);

Expand Down Expand Up @@ -94,7 +95,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);
Expand Down Expand Up @@ -135,7 +136,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();
Expand Down Expand Up @@ -177,16 +178,9 @@ protected void buttonPressed(int buttonId) {
public List<String> getSelectedKeys() {
return selectedKeys;
}

@Override
protected void okPressed() {
super.okPressed();

}


@Override
protected Point getDefaultDialogSize() {
return new Point(400, 250);
}

}

0 comments on commit 94d6efa

Please sign in to comment.