Lines 48-53
Link Here
|
48 |
import org.netbeans.modules.cnd.modelutil.CsmUtilities; |
48 |
import org.netbeans.modules.cnd.modelutil.CsmUtilities; |
49 |
import org.openide.util.ImageUtilities; |
49 |
import org.openide.util.ImageUtilities; |
50 |
import org.openide.util.NbBundle; |
50 |
import org.openide.util.NbBundle; |
|
|
51 |
import org.openide.util.NbPreferences; |
51 |
import org.openide.windows.TopComponent; |
52 |
import org.openide.windows.TopComponent; |
52 |
|
53 |
|
53 |
/** |
54 |
/** |
Lines 64-70
Link Here
|
64 |
private static final String PREFERRED_ID = "MacroExpansionTopComponent"; // NOI18N |
65 |
private static final String PREFERRED_ID = "MacroExpansionTopComponent"; // NOI18N |
65 |
private MacroExpansionPanel panel = null; |
66 |
private MacroExpansionPanel panel = null; |
66 |
private int lastDividerLocation = -1; |
67 |
private int lastDividerLocation = -1; |
67 |
private boolean lastLocalContext = true; |
|
|
68 |
private boolean lastSyncCaret = true; |
68 |
private boolean lastSyncCaret = true; |
69 |
private boolean lastSyncContext = false; |
69 |
private boolean lastSyncContext = false; |
70 |
private Document lastExpandedContextDoc = null; |
70 |
private Document lastExpandedContextDoc = null; |
Lines 83-89
Link Here
|
83 |
lastExpandedContextDoc = expandedContextDoc; |
83 |
lastExpandedContextDoc = expandedContextDoc; |
84 |
if (panel != null) { |
84 |
if (panel != null) { |
85 |
lastDividerLocation = panel.getDividerLocation(); |
85 |
lastDividerLocation = panel.getDividerLocation(); |
86 |
lastLocalContext = panel.isLocalContext(); |
|
|
87 |
lastSyncCaret = panel.isSyncCaret(); |
86 |
lastSyncCaret = panel.isSyncCaret(); |
88 |
lastSyncContext = panel.isSyncContext(); |
87 |
lastSyncContext = panel.isSyncContext(); |
89 |
} |
88 |
} |
Lines 94-100
Link Here
|
94 |
if (lastDividerLocation != -1) { |
93 |
if (lastDividerLocation != -1) { |
95 |
panel.setDividerLocation(lastDividerLocation); |
94 |
panel.setDividerLocation(lastDividerLocation); |
96 |
} |
95 |
} |
97 |
panel.setLocalContext(lastLocalContext); |
96 |
panel.setLocalContext(isLocalContext()); |
98 |
panel.setSyncCaret(lastSyncCaret); |
97 |
panel.setSyncCaret(lastSyncCaret); |
99 |
panel.setSyncContext(lastSyncContext); |
98 |
panel.setSyncContext(lastSyncContext); |
100 |
if (panel.isSyncCaret()) { |
99 |
if (panel.isSyncCaret()) { |
Lines 120-132
Link Here
|
120 |
* |
119 |
* |
121 |
* @return is macro expansion local |
120 |
* @return is macro expansion local |
122 |
*/ |
121 |
*/ |
123 |
public boolean isLocalContext() { |
122 |
public static boolean isLocalContext() { |
124 |
if (panel != null) { |
123 |
return NbPreferences.forModule(MacroExpansionTopComponent.class).getBoolean("show-local-context", true); |
125 |
lastLocalContext = panel.isLocalContext(); |
|
|
126 |
} |
127 |
return lastLocalContext; |
128 |
} |
124 |
} |
129 |
|
125 |
|
|
|
126 |
public static void setLocalContext(boolean localContext) { |
127 |
NbPreferences.forModule(MacroExpansionTopComponent.class).putBoolean("show-local-context", localContext); |
128 |
} |
130 |
/** |
129 |
/** |
131 |
* Indicates is caret synchronization enabled or not. |
130 |
* Indicates is caret synchronization enabled or not. |
132 |
* |
131 |
* |
Lines 232-238
Link Here
|
232 |
initComponents(); |
231 |
initComponents(); |
233 |
if (panel != null) { |
232 |
if (panel != null) { |
234 |
lastDividerLocation = panel.getDividerLocation(); |
233 |
lastDividerLocation = panel.getDividerLocation(); |
235 |
lastLocalContext = panel.isLocalContext(); |
|
|
236 |
lastSyncCaret = panel.isSyncCaret(); |
234 |
lastSyncCaret = panel.isSyncCaret(); |
237 |
lastSyncContext = panel.isSyncContext(); |
235 |
lastSyncContext = panel.isSyncContext(); |
238 |
|
236 |
|