Search in sources :

Example 1 with JadxSettings

use of jadx.gui.settings.JadxSettings in project jadx by skylot.

the class CodeArea method loadSettings.

public void loadSettings() {
    JadxSettings settings = contentPanel.getTabbedPane().getMainWindow().getSettings();
    setFont(settings.getFont());
}
Also used : JadxSettings(jadx.gui.settings.JadxSettings)

Example 2 with JadxSettings

use of jadx.gui.settings.JadxSettings in project jadx by skylot.

the class JadxGUI method main.

public static void main(String[] args) {
    try {
        LogCollector.register();
        JadxSettings settings = JadxSettingsAdapter.load();
        settings.setLogLevel(LogHelper.LogLevelEnum.INFO);
        // overwrite loaded settings by command line arguments
        if (!settings.overrideProvided(args)) {
            return;
        }
        printSystemInfo();
        LafManager.init(settings);
        NLS.setLocale(settings.getLangLocale());
        SwingUtilities.invokeLater(new MainWindow(settings)::init);
    } catch (Exception e) {
        LOG.error("Error: {}", e.getMessage(), e);
        System.exit(1);
    }
}
Also used : MainWindow(jadx.gui.ui.MainWindow) JadxSettings(jadx.gui.settings.JadxSettings)

Example 3 with JadxSettings

use of jadx.gui.settings.JadxSettings in project jadx by skylot.

the class HtmlPanel method loadSettings.

@Override
public void loadSettings() {
    JadxSettings settings = getTabbedPane().getMainWindow().getSettings();
    textArea.setFont(settings.getFont());
}
Also used : JadxSettings(jadx.gui.settings.JadxSettings)

Example 4 with JadxSettings

use of jadx.gui.settings.JadxSettings in project jadx by skylot.

the class AbstractCodeArea method loadCommonSettings.

public static void loadCommonSettings(MainWindow mainWindow, RSyntaxTextArea area) {
    area.setAntiAliasingEnabled(true);
    mainWindow.getEditorTheme().apply(area);
    JadxSettings settings = mainWindow.getSettings();
    area.setFont(settings.getFont());
}
Also used : JadxSettings(jadx.gui.settings.JadxSettings)

Example 5 with JadxSettings

use of jadx.gui.settings.JadxSettings in project jadx by skylot.

the class AbstractCodeArea method addWrapLineMenuAction.

private void addWrapLineMenuAction(JadxSettings settings) {
    JPopupMenu popupMenu = getPopupMenu();
    popupMenu.addSeparator();
    JCheckBoxMenuItem wrapItem = new JCheckBoxMenuItem(NLS.str("popup.line_wrap"), getLineWrap());
    wrapItem.setAction(new AbstractAction(NLS.str("popup.line_wrap")) {

        @Override
        public void actionPerformed(ActionEvent e) {
            boolean wrap = !getLineWrap();
            settings.setCodeAreaLineWrap(wrap);
            contentPanel.getTabbedPane().getOpenTabs().values().forEach(v -> {
                if (v instanceof AbstractCodeContentPanel) {
                    AbstractCodeArea codeArea = ((AbstractCodeContentPanel) v).getCodeArea();
                    setCodeAreaLineWrap(codeArea, wrap);
                    if (v instanceof ClassCodeContentPanel) {
                        codeArea = ((ClassCodeContentPanel) v).getSmaliCodeArea();
                        setCodeAreaLineWrap(codeArea, wrap);
                    }
                }
            });
            settings.sync();
        }
    });
    popupMenu.add(wrapItem);
    popupMenu.addPopupMenuListener(new DefaultPopupMenuListener() {

        @Override
        public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
            wrapItem.setState(getLineWrap());
        }
    });
}
Also used : Rectangle(java.awt.Rectangle) FocusListener(java.awt.event.FocusListener) SearchContext(org.fife.ui.rtextarea.SearchContext) LoggerFactory(org.slf4j.LoggerFactory) Point(java.awt.Point) KeyAdapter(java.awt.event.KeyAdapter) NLS(jadx.gui.utils.NLS) JCheckBoxMenuItem(javax.swing.JCheckBoxMenuItem) JadxSettings(jadx.gui.settings.JadxSettings) SwingUtilities(javax.swing.SwingUtilities) SearchEngine(org.fife.ui.rtextarea.SearchEngine) JumpPosition(jadx.gui.utils.JumpPosition) UiUtils(jadx.gui.utils.UiUtils) MouseAdapter(java.awt.event.MouseAdapter) JNode(jadx.gui.treemodel.JNode) JClass(jadx.gui.treemodel.JClass) Logger(org.slf4j.Logger) DefaultPopupMenuListener(jadx.gui.utils.DefaultPopupMenuListener) JPopupMenu(javax.swing.JPopupMenu) RSyntaxTextArea(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea) StringUtils(jadx.core.utils.StringUtils) Caret(javax.swing.text.Caret) CaretListener(javax.swing.event.CaretListener) BadLocationException(javax.swing.text.BadLocationException) ContentPanel(jadx.gui.ui.panel.ContentPanel) KeyEvent(java.awt.event.KeyEvent) ActionEvent(java.awt.event.ActionEvent) MouseEvent(java.awt.event.MouseEvent) Nullable(org.jetbrains.annotations.Nullable) Dimension(java.awt.Dimension) AbstractAction(javax.swing.AbstractAction) PopupMenuEvent(javax.swing.event.PopupMenuEvent) FocusEvent(java.awt.event.FocusEvent) CaretEvent(javax.swing.event.CaretEvent) MainWindow(jadx.gui.ui.MainWindow) DefaultCaret(javax.swing.text.DefaultCaret) JViewport(javax.swing.JViewport) ActionEvent(java.awt.event.ActionEvent) DefaultPopupMenuListener(jadx.gui.utils.DefaultPopupMenuListener) AbstractAction(javax.swing.AbstractAction) PopupMenuEvent(javax.swing.event.PopupMenuEvent) JPopupMenu(javax.swing.JPopupMenu) JCheckBoxMenuItem(javax.swing.JCheckBoxMenuItem)

Aggregations

JadxSettings (jadx.gui.settings.JadxSettings)5 MainWindow (jadx.gui.ui.MainWindow)2 StringUtils (jadx.core.utils.StringUtils)1 JClass (jadx.gui.treemodel.JClass)1 JNode (jadx.gui.treemodel.JNode)1 ContentPanel (jadx.gui.ui.panel.ContentPanel)1 DefaultPopupMenuListener (jadx.gui.utils.DefaultPopupMenuListener)1 JumpPosition (jadx.gui.utils.JumpPosition)1 NLS (jadx.gui.utils.NLS)1 UiUtils (jadx.gui.utils.UiUtils)1 Dimension (java.awt.Dimension)1 Point (java.awt.Point)1 Rectangle (java.awt.Rectangle)1 ActionEvent (java.awt.event.ActionEvent)1 FocusEvent (java.awt.event.FocusEvent)1 FocusListener (java.awt.event.FocusListener)1 KeyAdapter (java.awt.event.KeyAdapter)1 KeyEvent (java.awt.event.KeyEvent)1 MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1