Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Add fixes for issues #199 and #200 to develop branch #201

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,27 @@ private String getID( Scope scope ) {
}
if (scope instanceof CallSiteScope)
{
ProcedureScope proc_scope = ((CallSiteScope)scope).getProcedureScope();

// forcing to include procedure ID to ensure uniqueness of call site
final int proc_id = ((CallSiteScope)scope).getProcedureScope().getFlatIndex();
final int proc_id = proc_scope.getFlatIndex();
hash_id.append(SEPARATOR_ID);
hash_id.append(proc_id);

// fix issue #200: needs to separate inlined codes from different calls
// assume the following example:
// a -> [i] x
// b -> [i] x
// we should make sure the id of inlined x is different from the two calls
// The reason is that the line scope of both calls are the same (since they are inlined).
// so we have to add the flat id of the parent as an id

if (proc_scope.isAlien()) {
var parent = scope.getParentScope();
if (parent != null) {
hash_id.append(getID(parent));
}
}
} else if (scope instanceof ProcedureScope)
{
ProcedureScope proc_scope = (ProcedureScope) scope;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.List;

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
Expand Down Expand Up @@ -76,6 +77,23 @@ protected Control createDialogArea(Composite parent) {
protected String[] getColumnHeaderLabels() {
return new String[] {" ", "Ranks or threads"};
}

@Override
public void changeEvent(Object data) {
// make sure the OK button is only enabled when at least one item is checked
var list = getEventList();
if (list != null && !list.isEmpty())
// traverse the list in O(n) fashion to see if at least there
for(var item: list) {
if (item.checked) {
// an item has been checked, enabled the ok button
getButton(IDialogConstants.OK_ID).setEnabled(true);
return;
}
}
getButton(IDialogConstants.OK_ID).setEnabled(false);
}

};

return composite;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected Control createContents(Composite parent) {
Group groupFont = createGroupControl(parent, "Fonts", false);
groupFont.setLayout(new GridLayout(1, false));

fontGenericEditor = createFontEditor(groupFont, PreferenceConstants.ID_FONT_GENERIC, "Default column font:", FontManager.getFontGeneric());
fontGenericEditor = createFontEditor(groupFont, PreferenceConstants.ID_FONT_GENERIC, "Default font:", FontManager.getFontGeneric());
fontMetricEditor = createFontEditor(groupFont, PreferenceConstants.ID_FONT_METRIC, "Metric column font:", FontManager.getMetricFont());
fontSourceEditor = createFontEditor(groupFont, PreferenceConstants.ID_FONT_TEXT, "Text editor font:" , FontManager.getTextEditorFont());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ private void createTable() {
*/
public void pack() {
// set the width of the columns
final String TEXT = "{XXX.XX%|";
final String TEXT = "XXX.XX%";
final int PADDING = 4;

final int colorColWidth = GUIHelper.convertHorizontalDpiToPixel(IConstants.COLUMN_COLOR_WIDTH_PIXELS);
dataLayer.setColumnWidthByPosition(0, colorColWidth);

Expand All @@ -212,13 +214,14 @@ public void pack() {
dataLayer.setColumnWidthByPosition(2, widthColNumber);

// the procedure name column should take whatever the remainder space
dataLayer.setColumnWidthPercentageByPosition(1, 97);
dataLayer.setColumnWidthPercentageByPosition(1, 99);
dataLayer.setColumnPercentageSizing(1, true);
dataLayer.setColumnsResizableByDefault(true);

// row's height
gc.setFont(FontManager.getFontGeneric());
Point sizeGeneric = gc.textExtent(TEXT);
final int height = GUIHelper.convertHorizontalDpiToPixel(4 + Math.max(sizeGeneric.y, sizeNumber.y));
final int height = GUIHelper.convertHorizontalDpiToPixel(PADDING + Math.max(sizeGeneric.y, sizeNumber.y));
dataLayer.setDefaultRowHeight(height);

gc.dispose();
Expand Down
Loading