Skip to content

Commit

Permalink
Save last used decompiler
Browse files Browse the repository at this point in the history
  • Loading branch information
sotasan committed Nov 7, 2023
1 parent a427e0b commit 2bd3bd6
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sotasan.decompiler.controllers;

import com.sotasan.decompiler.models.FileModel;
import com.sotasan.decompiler.services.ProcessService;
import com.sotasan.decompiler.transformers.Transformer;
import com.sotasan.decompiler.types.ClassType;
import com.sotasan.decompiler.views.TabsView;
Expand All @@ -19,10 +20,14 @@ public class TabsController extends BaseController<TabsView> implements ActionLi
private TabsController() {
super(new TabsView());
getView().getComboBox().addActionListener(this);
String transformer = ProcessService.PREFERENCES.get("transformer", null);
if (transformer != null)
getView().getComboBox().setSelectedItem(Transformer.valueOf(transformer));
}

@Override
public void actionPerformed(ActionEvent event) {
ProcessService.PREFERENCES.put("transformer", getTransformer().name());
for (int i = 0; i < getView().getTabCount(); i++) {
TabController controller = ((TabView) getView().getComponentAt(i)).getController();
if (controller.getFileModel().getType() instanceof ClassType)
Expand Down

0 comments on commit 2bd3bd6

Please sign in to comment.