use of org.eclipse.jface.dialogs.Dialog in project egit by eclipse.
the class ConfigureFetchCommand method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
RepositoryTreeNode selectedNode = getFirstOrNull(getSelectedNodes(event));
final String configName;
if (selectedNode instanceof RemoteNode)
configName = ((RemoteNode) selectedNode).getObject();
else if (selectedNode instanceof FetchNode)
configName = ((RemoteNode) selectedNode.getParent()).getObject();
else
return null;
Dialog dlg = SimpleConfigureFetchDialog.getDialog(getShell(event), selectedNode.getRepository(), configName);
dlg.open();
return null;
}
use of org.eclipse.jface.dialogs.Dialog in project egit by eclipse.
the class ConfigurePushCommand method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
RepositoryTreeNode selectedNode = getFirstOrNull(getSelectedNodes(event));
final String configName;
if (selectedNode instanceof RemoteNode)
configName = ((RemoteNode) selectedNode).getObject();
else if (selectedNode instanceof PushNode)
configName = ((RemoteNode) selectedNode.getParent()).getObject();
else
return null;
Dialog dlg = SimpleConfigurePushDialog.getDialog(getShell(event), selectedNode.getRepository(), configName);
dlg.open();
return null;
}
use of org.eclipse.jface.dialogs.Dialog in project portfolio by buchen.
the class PortfolioPart method internalSetClient.
public void internalSetClient(Client client) {
this.client = client;
this.dirty.setDirty(false);
this.context.set(Client.class, client);
client.addPropertyChangeListener(event -> notifyModelUpdated());
if (client.getFileVersionAfterRead() < Client.VERSION_WITH_CURRENCY_SUPPORT) {
Display.getDefault().asyncExec(() -> {
Dialog dialog = new ClientMigrationDialog(Display.getDefault().getActiveShell(), client);
dialog.open();
});
}
new ConsistencyChecksJob(client, false).schedule(100);
scheduleOnlineUpdateJobs();
}
use of org.eclipse.jface.dialogs.Dialog in project portfolio by buchen.
the class ImportCSVHandler method execute.
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part, @Named(IServiceConstants.ACTIVE_SHELL) Shell shell) {
Client client = MenuHelper.getActiveClient(part);
if (client == null)
return;
FileDialog fileDialog = new FileDialog(shell, SWT.OPEN);
fileDialog.setFilterNames(new String[] { Messages.CSVImportLabelFileCSV, Messages.CSVImportLabelFileAll });
// $NON-NLS-1$ //$NON-NLS-2$
fileDialog.setFilterExtensions(new String[] { "*.csv", "*.*" });
String fileName = fileDialog.open();
if (fileName == null)
return;
IPreferenceStore preferences = ((PortfolioPart) part.getObject()).getPreferenceStore();
Dialog wizwardDialog = new WizardDialog(shell, new CSVImportWizard(client, preferences, new File(fileName)));
wizwardDialog.open();
}
use of org.eclipse.jface.dialogs.Dialog in project portfolio by buchen.
the class ImportPDFHandler method openWizard.
protected void openWizard(Shell shell, Client client, List<Extractor.InputFile> files, IPreferenceStore preferences, boolean isLegacyMode) {
try {
ImportExtractedItemsWizard wizard = new ImportExtractedItemsWizard(client, null, preferences, files);
wizard.setLegacyMode(isLegacyMode);
Dialog wizwardDialog = new WizardDialog(shell, wizard);
wizwardDialog.open();
} catch (IOException e) {
PortfolioPlugin.log(e);
MessageDialog.openError(Display.getDefault().getActiveShell(), Messages.LabelError, e.getMessage());
}
}
Aggregations