use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class DockableEditorTabbedContainer method processDropOver.
@Override
public Image processDropOver(@NotNull DockableContent content, RelativePoint point) {
JBTabs current = getTabsAt(content, point);
if (myCurrentOver != null && myCurrentOver != current) {
resetDropOver(content);
}
if (myCurrentOver == null && current != null) {
myCurrentOver = current;
Presentation presentation = content.getPresentation();
myCurrentOverInfo = new TabInfo(new JLabel("")).setText(presentation.getText()).setIcon(presentation.getIcon());
myCurrentOverImg = myCurrentOver.startDropOver(myCurrentOverInfo, point);
}
if (myCurrentOver != null) {
myCurrentOver.processDropOver(myCurrentOverInfo, point);
}
return myCurrentOverImg;
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class GotoHomeAction method update.
protected void update(final FileSystemTree fileSystemTree, final AnActionEvent e) {
final Presentation presentation = e.getPresentation();
if (!presentation.isEnabled())
return;
final VirtualFile userHomeDir = VfsUtil.getUserHomeDir();
presentation.setEnabled(userHomeDir != null && fileSystemTree.isUnderRoots(userHomeDir));
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class GotoProjectDirectory method update.
protected void update(final FileSystemTree fileSystemTree, final AnActionEvent e) {
final Presentation presentation = e.getPresentation();
presentation.setIcon(ourIcon);
final VirtualFile projectPath = getProjectDir(e);
presentation.setEnabled(projectPath != null && fileSystemTree.isUnderRoots(projectPath));
}
use of com.intellij.openapi.actionSystem.Presentation in project android by JetBrains.
the class AndroidInlineLayoutTest method doTestCommonInlineAction.
private void doTestCommonInlineAction(boolean inlineThisOnly) {
final String testName = getTestName(true);
myFixture.copyFileToProject(BASE_PATH + testName + "_included.xml", "res/layout/included.xml");
final VirtualFile f = myFixture.copyFileToProject(BASE_PATH + testName + ".xml", "res/layout/test.xml");
myFixture.configureFromExistingVirtualFile(f);
AndroidInlineLayoutHandler.setTestConfig(new AndroidInlineTestConfig(inlineThisOnly));
try {
final Presentation p = myFixture.testAction(new InlineAction());
assertTrue(p.isEnabled());
assertTrue(p.isVisible());
} finally {
AndroidInlineLayoutHandler.setTestConfig(null);
}
myFixture.checkResultByFile(BASE_PATH + testName + "_after.xml", true);
}
use of com.intellij.openapi.actionSystem.Presentation in project android by JetBrains.
the class AndroidInlineLayoutTest method test9.
public void test9() throws Exception {
final String testName = getTestName(true);
myFixture.copyFileToProject(BASE_PATH + testName + ".xml", "res/layout/test.xml");
final VirtualFile f = myFixture.copyFileToProject(BASE_PATH + testName + "_included.xml", "res/layout/included.xml");
myFixture.configureFromExistingVirtualFile(f);
AndroidInlineLayoutHandler.setTestConfig(new AndroidInlineTestConfig(true));
try {
final Presentation p = myFixture.testAction(new InlineAction());
assertTrue(p.isEnabled());
assertTrue(p.isVisible());
} finally {
AndroidInlineLayoutHandler.setTestConfig(null);
}
myFixture.checkResultByFile("res/layout/test.xml", BASE_PATH + testName + "_after.xml", true);
assertNull(myFixture.getTempDirFixture().getFile("res/layout/included.xml"));
}
Aggregations