本文整理匯總了Java中com.intellij.application.options.colors.SimpleEditorPreview類的典型用法代碼示例。如果您正苦於以下問題:Java SimpleEditorPreview類的具體用法?Java SimpleEditorPreview怎麽用?Java SimpleEditorPreview使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SimpleEditorPreview類屬於com.intellij.application.options.colors包,在下文中一共展示了SimpleEditorPreview類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: actionPerformed
import com.intellij.application.options.colors.SimpleEditorPreview; //導入依賴的package包/類
@Override
public void actionPerformed(AnActionEvent e) {
final ColorAndFontOptions colorAndFontOptions = new ColorAndFontOptions(){
@Override
protected List<ColorAndFontPanelFactory> createPanelFactories() {
final GeneralColorsPage colorsPage = new GeneralColorsPage();
final ColorAndFontPanelFactory panelFactory = new ColorAndFontPanelFactory() {
@NotNull
@Override
public NewColorAndFontPanel createPanel(@NotNull ColorAndFontOptions options) {
final SimpleEditorPreview preview = new SimpleEditorPreview(options, colorsPage);
return NewColorAndFontPanel.create(preview, colorsPage.getDisplayName(), options, null, colorsPage);
}
@NotNull
@Override
public String getPanelDisplayName() {
return "Editor | " + getDisplayName() + " | " + colorsPage.getDisplayName();
}
};
return Collections.singletonList(panelFactory);
}
};
final Configurable[] configurables = colorAndFontOptions.buildConfigurables();
try {
final SearchableConfigurable general = colorAndFontOptions.findSubConfigurable(GeneralColorsPage.class);
if (general != null) {
final LineData lineData = getLineData(myLineNumber);
ShowSettingsUtil.getInstance().editConfigurable(myEditor.getProject(), general,
general.enableSearch(getAttributesKey(lineData).getExternalName()));
}
}
finally {
for (Configurable configurable : configurables) {
configurable.disposeUIResources();
}
colorAndFontOptions.disposeUIResources();
}
}
示例2: actionPerformed
import com.intellij.application.options.colors.SimpleEditorPreview; //導入依賴的package包/類
@Override
public void actionPerformed(AnActionEvent e) {
final ColorAndFontOptions colorAndFontOptions = new ColorAndFontOptions(){
@Override
protected List<ColorAndFontPanelFactory> createPanelFactories() {
final GeneralColorsPage colorsPage = new GeneralColorsPage();
final ColorAndFontPanelFactory panelFactory = new ColorAndFontPanelFactory() {
@Nonnull
@Override
public NewColorAndFontPanel createPanel(@Nonnull ColorAndFontOptions options) {
final SimpleEditorPreview preview = new SimpleEditorPreview(options, colorsPage);
return NewColorAndFontPanel.create(preview, colorsPage.getDisplayName(), options, null, colorsPage);
}
@Nonnull
@Override
public String getPanelDisplayName() {
return "Editor | " + getDisplayName() + " | " + colorsPage.getDisplayName();
}
};
return Collections.singletonList(panelFactory);
}
};
final Configurable[] configurables = colorAndFontOptions.buildConfigurables();
try {
final SearchableConfigurable general = colorAndFontOptions.findSubConfigurable(GeneralColorsPage.class);
if (general != null) {
final LineData lineData = getLineData(myLineNumber);
ShowSettingsUtil.getInstance().editConfigurable(myEditor.getProject(), general,
general.enableSearch(getAttributesKey(lineData).getExternalName()));
}
}
finally {
for (Configurable configurable : configurables) {
configurable.disposeUIResources();
}
colorAndFontOptions.disposeUIResources();
}
}