use of com.intellij.openapi.ui.DialogWrapper in project intellij-community by JetBrains.
the class SmoothProgressAdapter method showDialog.
private void showDialog() {
if (myDialog == null) {
//System.out.println("showDialog()");
myDialog = new DialogWrapper(myProject, false) {
{
getWindow().setBounds(0, 0, 1, 1);
setResizable(false);
}
@Override
protected boolean isProgressDialog() {
return true;
}
@Override
protected JComponent createCenterPanel() {
return null;
}
};
myDialog.setModal(true);
myDialog.setUndecorated(true);
myDialog.show();
}
}
use of com.intellij.openapi.ui.DialogWrapper in project intellij-community by JetBrains.
the class ShowNonRetinaImagesActions method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = e.getProject();
if (project == null)
return;
class ImageInfo {
boolean retina;
boolean normal;
boolean dark;
boolean retina_dark;
}
HashMap<String, ImageInfo> info = new HashMap<>();
final Collection<VirtualFile> images = FilenameIndex.getAllFilesByExt(project, "png", GlobalSearchScope.projectScope(project));
for (VirtualFile image : images) {
final String path = image.getPath();
final String key = toKey(path);
ImageInfo imageInfo = info.get(key);
if (imageInfo == null) {
imageInfo = new ImageInfo();
info.put(key, imageInfo);
}
if (path.endsWith("@2x_dark.png")) {
imageInfo.retina_dark = true;
} else if (path.endsWith("_dark.png")) {
imageInfo.dark = true;
} else if (path.endsWith("@2x.png")) {
imageInfo.retina = true;
} else {
imageInfo.normal = true;
}
}
final ArrayList<String> retinaMissed = new ArrayList<>();
for (String key : info.keySet()) {
if (!info.get(key).retina && info.get(key).normal) {
retinaMissed.add(key);
}
}
Collections.sort(retinaMissed, String.CASE_INSENSITIVE_ORDER);
new DialogWrapper(project) {
{
init();
}
@Nullable
@Override
protected JComponent createCenterPanel() {
return new JBScrollPane(new JTextArea(StringUtil.join(retinaMissed, "\n")));
}
}.show();
}
use of com.intellij.openapi.ui.DialogWrapper in project intellij-community by JetBrains.
the class RegistryUi method show.
public boolean show() {
DialogWrapper dialog = new DialogWrapper(true) {
{
setTitle("Registry");
setModal(true);
init();
revaliateActions();
}
private AbstractAction myCloseAction;
@Nullable
@Override
protected JComponent createNorthPanel() {
if (!ApplicationManager.getApplication().isInternal()) {
JLabel warningLabel = new JLabel(XmlStringUtil.wrapInHtml("<b>Changing these values may cause unwanted behavior of " + ApplicationNamesInfo.getInstance().getFullProductName() + ". Please do not change these unless you have been asked.</b>"));
warningLabel.setIcon(UIUtil.getWarningIcon());
warningLabel.setForeground(JBColor.RED);
return warningLabel;
}
return null;
}
@Override
protected JComponent createCenterPanel() {
return myContent;
}
@Override
protected void dispose() {
super.dispose();
RegistryUi.this.dispose();
}
@Override
protected String getDimensionServiceKey() {
return "Registry";
}
@Override
public JComponent getPreferredFocusedComponent() {
return myTable;
}
@NotNull
@Override
protected Action[] createActions() {
return new Action[] { myRestoreDefaultsAction, myCloseAction };
}
@Override
protected void createDefaultActions() {
super.createDefaultActions();
myCloseAction = new AbstractAction("Close") {
@Override
public void actionPerformed(@NotNull ActionEvent e) {
processClose();
doOKAction();
}
};
myCloseAction.putValue(DialogWrapper.DEFAULT_ACTION, true);
}
@Override
public void doCancelAction() {
final TableCellEditor cellEditor = myTable.getCellEditor();
if (cellEditor != null) {
cellEditor.stopCellEditing();
}
processClose();
super.doCancelAction();
}
};
return dialog.showAndGet();
}
use of com.intellij.openapi.ui.DialogWrapper in project intellij-community by JetBrains.
the class AntSetPanel method showDialog.
@Nullable
public AntInstallation showDialog(JComponent parent) {
final DialogWrapper dialog = new MyDialog(parent);
if (!dialog.showAndGet()) {
return null;
}
apply();
return myForm.getSelectedAnt();
}
use of com.intellij.openapi.ui.DialogWrapper in project intellij-community by JetBrains.
the class MergePanel2 method setDiffRequest.
public void setDiffRequest(DiffRequest data) {
setTitle(data.getWindowTitle());
disposeMergeList();
for (int i = 0; i < EDITORS_COUNT; i++) {
getEditorPlace(i).setDocument(null);
}
LOG.assertTrue(!myDuringCreation);
myDuringCreation = true;
myProvider.putData(data.getGenericData());
try {
myData = data;
String[] titles = myData.getContentTitles();
for (int i = 0; i < myEditorsPanels.length; i++) {
LabeledComponent editorsPanel = myEditorsPanels[i];
editorsPanel.getLabel().setText(titles[i].isEmpty() ? " " : titles[i]);
}
createMergeList();
data.customizeToolbar(myPanel.resetToolbar());
myPanel.registerToolbarActions();
if (data instanceof MergeRequestImpl && myBuilder != null) {
Convertor<DialogWrapper, Boolean> preOkHook = new Convertor<DialogWrapper, Boolean>() {
@Override
public Boolean convert(DialogWrapper dialog) {
ChangeCounter counter = ChangeCounter.getOrCreate(myMergeList);
int changes = counter.getChangeCounter();
int conflicts = counter.getConflictCounter();
if (changes == 0 && conflicts == 0)
return true;
return Messages.showYesNoDialog(dialog.getRootPane(), DiffBundle.message("merge.dialog.apply.partially.resolved.changes.confirmation.message", changes, conflicts), DiffBundle.message("apply.partially.resolved.merge.dialog.title"), Messages.getQuestionIcon()) == Messages.YES;
}
};
((MergeRequestImpl) data).setActions(myBuilder, this, preOkHook);
}
} finally {
myDuringCreation = false;
}
}
Aggregations