use of org.eclipse.ui.forms.IManagedForm in project liferay-ide by liferay.
the class IDEFormPage method createPartControl.
/**
* (non-Javadoc)
* @see
* FormPage#createPartControl(org.eclipse.swt.
* widgets.Composite)
*/
public void createPartControl(Composite parent) {
super.createPartControl(parent);
// Dynamically add focus listeners to all the forms children in order
// to track the last focus control
IManagedForm managedForm = getManagedForm();
if (managedForm != null) {
addLastFocusListeners(managedForm.getForm());
}
}
use of org.eclipse.ui.forms.IManagedForm in project liferay-ide by liferay.
the class IDEFormPage method createUISectionContainer.
public Composite createUISectionContainer(Composite parent, int columns) {
IManagedForm managedForm = getManagedForm();
Composite container = managedForm.getToolkit().createComposite(parent);
container.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, columns));
return container;
}
use of org.eclipse.ui.forms.IManagedForm in project liferay-ide by liferay.
the class IDEFormPage method createUISection.
public Section createUISection(Composite parent, String text, String description, int style) {
IManagedForm managedForm = getManagedForm();
Section section = managedForm.getToolkit().createSection(parent, style);
section.clientVerticalSpacing = FormLayoutFactory.SECTION_HEADER_VERTICAL_SPACING;
section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
section.setText(text);
section.setDescription(description);
GridData data = new GridData(GridData.FILL_HORIZONTAL);
section.setLayoutData(data);
return section;
}
use of org.eclipse.ui.forms.IManagedForm in project tdq-studio-se by Talend.
the class AbstractMetadataFormPage method getFocusControl.
protected Control getFocusControl() {
IManagedForm managedForm = getManagedForm();
if (managedForm == null) {
return null;
}
Control control = managedForm.getForm();
if (control == null || control.isDisposed()) {
return null;
}
Display display = control.getDisplay();
Control focusControl = display.getFocusControl();
if (focusControl == null || focusControl.isDisposed()) {
return null;
}
return focusControl;
}
use of org.eclipse.ui.forms.IManagedForm in project webtools.servertools by eclipse.
the class ServerPropertiesEditorSection method init.
public void init(final IEditorSite site, IEditorInput input) {
super.init(site, input);
if (server != null) {
fServer = (GenericServer) server.loadAdapter(GenericServer.class, new NullProgressMonitor());
}
fPropertyChangeListener = new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(GenericServerRuntime.SERVER_INSTANCE_PROPERTIES)) {
if (!fUpdating) {
fUpdating = true;
updateControls();
fUpdating = false;
}
}
}
};
server.addPropertyChangeListener(fPropertyChangeListener);
fLaunchListener = new ILaunchesListener2() {
public void launchesRemoved(ILaunch[] launches) {
// Nothing to do
}
private ILaunchConfiguration getServerLaunchConfig(ILaunch[] launches) {
for (int i = 0; i < launches.length; i++) {
ILaunchConfiguration launchConfig = launches[i].getLaunchConfiguration();
if (launchConfig != null) {
String serverId;
try {
serverId = launchConfig.getAttribute(GenericServerBehaviour.ATTR_SERVER_ID, (String) null);
if (fServer.getServer().getId().equals(serverId)) {
return launchConfig;
}
} catch (CoreException e) {
// Ignore
}
}
}
return null;
}
public void launchesChanged(ILaunch[] launches) {
// Nothing to do
}
public void launchesAdded(ILaunch[] launches) {
ILaunchConfiguration lc = getServerLaunchConfig(launches);
try {
if (lc != null) {
if ("true".equals(lc.getAttribute(GenericServerBehaviour.ATTR_STOP, "false"))) {
// $NON-NLS-1$ //$NON-NLS-2$
site.getWorkbenchWindow().getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
IManagedForm managedForm = getManagedForm();
managedForm.getMessageManager().removeMessage(MESSAGE_ID_SERVER_RUNNING);
managedForm.getMessageManager().update();
}
});
} else {
site.getWorkbenchWindow().getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
getManagedForm().getMessageManager().addMessage(MESSAGE_ID_SERVER_RUNNING, GenericServerUIMessages.serverRunningCanNotSave, null, IMessageProvider.WARNING);
}
});
}
}
} catch (CoreException e) {
GenericUiPlugin.getDefault().getLog().log(e.getStatus());
}
}
public void launchesTerminated(ILaunch[] launches) {
if (getServerLaunchConfig(launches) != null) {
site.getWorkbenchWindow().getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
getManagedForm().getMessageManager().removeMessage(MESSAGE_ID_SERVER_RUNNING);
}
});
}
}
};
getLaunchManager().addLaunchListener(fLaunchListener);
}
Aggregations