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 db595d5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
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 @@ -141,6 +142,17 @@ public SearchWidget(TreeViewer viewer) {

createToolBar();
createSearchTextWidget();

List<IProperty> 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
Expand Down Expand Up @@ -424,7 +436,7 @@ 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 = 1000000;

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

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 All @@ -24,6 +25,7 @@

import com.archimatetool.editor.ui.IArchiImages;
import com.archimatetool.editor.ui.components.ExtendedTitleAreaDialog;
import com.archimatetool.model.IArchimateFactory;



Expand All @@ -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<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);

this.keys = keys;
selectedKeys = selected;

System.out.println(keys.size());
}

@Override
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -177,16 +181,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 db595d5

Please sign in to comment.