private void createOptionalDependenciesButton(Composite container) { if (isEditable()) { fIncludeOptionalButton = new Button(container, SWT.CHECK); fIncludeOptionalButton.setText(PDEUIMessages.PluginSection_includeOptional); // initialize value IEditorInput input = getPage().getEditorInput(); if (input instanceof IFileEditorInput) { IFile file = ((IFileEditorInput) input).getFile(); try { fIncludeOptionalButton.setSelection( "true".equals(file.getPersistentProperty(OPTIONAL_PROPERTY))); // $NON-NLS-1$ } catch (CoreException e) { } } // create listener to save value when the checkbox is changed fIncludeOptionalButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { IEditorInput input = getPage().getEditorInput(); if (input instanceof IFileEditorInput) { IFile file = ((IFileEditorInput) input).getFile(); try { file.setPersistentProperty( OPTIONAL_PROPERTY, fIncludeOptionalButton.getSelection() ? "true" : null); // $NON-NLS-1$ } catch (CoreException e1) { } } } }); } }
@Override public void refresh() { ISplashInfo info = getSplashInfo(); fBlockNotification = true; fColorSelector.setColorValue(hexToRGB(info.getForegroundColor())); int[] pgeo = info.getProgressGeometry(); boolean addProgress = pgeo != null; info.addProgressBar(addProgress, fBlockNotification); if (addProgress) { for (int i = 0; i < pgeo.length; i++) { fBarSpinners[i].setSelection(pgeo[i]); } } else { resetProgressBarGeometry(); } fAddBarButton.setSelection(addProgress); int[] mgeo = info.getMessageGeometry(); boolean addMessage = mgeo != null; info.addProgressMessage(addMessage, fBlockNotification); if (addMessage) { for (int i = 0; i < mgeo.length; i++) { fMessageSpinners[i].setSelection(mgeo[i]); } } else { resetProgressMessageGeometry(); } fColorSelector.setColorValue( addMessage ? hexToRGB(info.getForegroundColor()) : new RGB(0, 0, 0)); fAddMessageButton.setSelection(addMessage); // Update the UI updateUIFieldTemplateCombo(); fBlockNotification = false; super.refresh(); // Update this sections enablement updateFieldEnablement(); }