Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proof of concept of fixing #7135, double-click lang comp spec #7138

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -92,7 +92,7 @@ public SetLanguageDialog(PluginTool tool, LanguageCompilerSpecPair lcsPair, Stri
currentLCSPair = lcsPair;
this.tool = tool;

selectLangPanel = new NewLanguagePanel();
selectLangPanel = new NewLanguagePanel(null);

if (lcsPair != null) {
selectLangPanel.setSelectedLcsPair(lcsPair);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class SelectLanguageDialog extends DialogComponentProvider {
public SelectLanguageDialog(String title, String approveButtonText) {
super(title, true);

languagePanel = new NewLanguagePanel();
languagePanel = new NewLanguagePanel(null);

setTransient(true);
addWorkPanel(languagePanel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void run() {
}

private void build() {
languagePanel = new NewLanguagePanel();
languagePanel = new NewLanguagePanel(this);
languagePanel.setRecommendedLcsPairsList(new ArrayList<LanguageCompilerSpecPair>());
languagePanel.setShowAllLcsPairs(false);
languagePanel.setBorder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
public class NewLanguagePanel extends JPanel {
private static final String DEFAULT_DESCRIPTION_TEXT = " ";

private ImporterLanguageDialog importerLanguageDialog;
private LanguageSortedTableModel tableModel;
private GhidraTable table;
private GhidraTableFilterPanel<LanguageCompilerSpecPair> tableFilterPanel;
Expand All @@ -48,7 +49,8 @@ private void setDescriptionLabelText(String text) {
descriptionLabel.setText(text);
}

public NewLanguagePanel() {
public NewLanguagePanel(ImporterLanguageDialog importerLanguageDialog) {
this.importerLanguageDialog = importerLanguageDialog;
constructEverything();
layoutEverything();
wireEverything();
Expand Down Expand Up @@ -145,6 +147,9 @@ private void wireEverything() {
public void mouseReleased(MouseEvent e) {
if (e.getClickCount() == 2) {
// do the next action thingie
if (importerLanguageDialog != null) {
importerLanguageDialog.close();
}
}
}
});
Expand Down